Download binaries from tari.com. This is the easiest way to run a Tari node, but you're essentially trusting the person that built and uploaded them that nothing untoward has happened.
We've tried to limit the risks by publishing hashes of the binaries on our website.
You can check that the binaries match the hash by running
sha256sum path/to/tari_base_node
To build the Tari codebase from source, there are a few dependencies you need to have installed.
First you'll need to make sure you have a full development environment set up:
brew update
brew install cmake openssl tor ncurses coreutils
brew install --cask powershell
sudo apt-get update
sudo apt-get -y install openssl libssl-dev pkg-config libsqlite3-dev clang git cmake libc++-dev libc++abi-dev libprotobuf-dev protobuf-compiler libncurses5-dev libncursesw5-dev
sudo apt-get install -y wget apt-transport-https
sudo wget -q "https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb"
sudo dpkg -i packages-microsoft-prod.deb
sudo apt-get update
sudo add-apt-repository universe
sudo apt-get install -y powershell
First you'll need to make sure you have a full development environment set up:
-
git
-
LLVM
- https://releases.llvm.org/
- Create a
LIBCLANG_PATH
environment variable pointing to the LLVM lib path, e.g.setx LIBCLANG_PATH "C:\Program Files\LLVM\lib"
-
Build Tools
- Microsoft Visual Studio Version 2019 or later
- C++ CMake tools for Windows
- MSVC build tools (latest version for your platform ARM, ARM64 or x64.x86)
- Spectre-mitigated libs (latest version for your platform ARM, ARM64 or x64.x86)
or
- Microsoft Visual Studio Version 2019 or later
-
SQLite:
- Download 32bit/64bit Precompiled Binaries for Windows for SQL Lite and unzip
to local path, e.g.
%USERPROFILE%\.sqlite
- Open the appropriate x64\x86
Native Tools Command Prompt for VS 2019
in%USERPROFILE%\.sqlite
- Run either of these, depending on your environment (32bit/64bit):
lib /DEF:sqlite3.def /OUT:sqlite3.lib /MACHINE:x64
lib /DEF:sqlite3.def /OUT:sqlite3.lib /MACHINE:x86
- Run either of these, depending on your environment (32bit/64bit):
- Ensure the directory containing
sqlite3.dll
, e.g.%USERPROFILE%\.sqlite
, is in the path - Create a
SQLITE3_LIB_DIR
environment variable pointing to the SQLite lib path, e.g.setx SQLITE3_LIB_DIR "%USERPROFILE%\.sqlite"
- Download 32bit/64bit Precompiled Binaries for Windows for SQL Lite and unzip
to local path, e.g.
-
OpenSSL:
-
Download full version of the 64bit Precompiled Binaries for Windows for OpenSSL
-
Install using all the default prompts
Note: It is important that the dlls are available in the path. To test:
where libcrypto-1_1-x64.dll where libssl-1_1-x64.dll
-
-
Tor
- Donwload Tor Windows Expert Bundle
- Extract to local path, e.g.
C:\Program Files (x86)\Tor Services
- Ensure the directory containing the Tor executable, e.g.
C:\Program Files (x86)\Tor Services\Tor
, is in the path
You can follow along at The Rust Website or just follow these steps to get Rust installed on your machine.
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Then make sure that cargo
has been added to your path.
export PATH="$HOME/.cargo/bin:$PATH"
Follow the installation process for Windows at The Rust Website. Then make
sure that cargo
and rustc
has been added to your path:
cargo --version
rustc --version
In your directory of choice (e.g. %USERPROFILE%\Code
on Windows), clone the Tari repo
git clone https://github.com/tari-project/tari.git
Grab a cup of coffee and begin the Tari build
(*nix)
cd tari
cargo build --release
(Windows)
This is similar to building in Ubuntu, except the Microsoft Visual Studio environment must be sourced. Open the
appropriate x64\x86 Native Tools Command Prompt for VS 2019, and in your main Tari directory perform the
build, which will create the executable inside your %USERPROFILE%\Code\tari\target\release
directory:
cd %USERPROFILE%\Code\tari
cargo build --release
A successful build should output something as follows
Compiling tari_wallet v0.0.9 (.../tari/base_layer/wallet)
Compiling test_faucet v0.0.1 (.../tari/applications/test_faucet)
Compiling tari_wallet_ffi v0.0.9 (.../tari/base_layer/wallet_ffi)
Compiling tari_base_node v0.0.9 (.../tari/applications/tari_base_node)
Finished release [optimized] target(s) in 12m 24s
Compiled executable can be found by following path:
./target/release/tari_base_node
./target/release/tari_console_wallet
./target/release/tari_merge_mining_proxy
Alternatively, cargo can build and install the executable into ~/.cargo/bin
(%USERPROFILE%\.cargo\bin
on Windows), so it will be executable from anywhere
on your system.
cargo install --path=applications/tari_base_node --force
cargo install --path=applications/tari_console_wallet --force
cargo install --path=applications/tari_merge_mining_proxy --force
Alternatively, cargo can build and install the executable into %USERPROFILE%\.cargo\bin
, so it will be executable from
anywhere on your system.
cargo install --path=applications/tari_base_node --force
cargo install --path=applications/tari_console_wallet --force
cargo install --path=applications/tari_merge_mining_proxy --force
The executables will either be inside your ~/tari/target/release
(on Linux) or %USERPROFILE%\Code\tari\target\release
(on Windows) directory, or alternatively, inside your ~/.cargo/bin
(on Linux) %USERPROFILE%\.cargo\bin
(on Windows)
directory, depending on the build choice above, and must be run from the command line. If the former build method was
used, you can run it from that directory, or you more likely want to copy it somewhere more convenient.
To run from any directory of your choice, where the executable is visible in the path (first time use):
tari_base_node --init --create-id
tari_base_node
tari_console_wallet --init --create-id
tari_console_wallet
Consecutive runs:
tari_base_node
tari_console_wallet
tari_merge_mining_proxy
Alternatively, you can run the Tari components from your source directory using cargo
(first time use):
cargo run --bin tari_base_node --release -- --init --create-id
cargo run --bin tari_base_node --release
cargo run --bin tari_console_wallet --release -- --init --create-id
cargo run --bin tari_console_wallet --release
Consecutive runs:
cargo run --bin tari_base_node --release
cargo run --bin tari_console_wallet --release
cargo run --bin tari_merge_mining_proxy --release
Using all the default options, the blockchain database, wallet database, console wallet database, log files and all
configuration files will be created in the ~/.tari
(on Linux) or %USERPROFILE%\.tari
(on Windows) directory.
Alternatively, by specifying --base-path <base-path>
on the command line as well, all of this will be created in that
directory.
Docker images can be found at https://quay.io/repository/tarilabs/tari_base_node
Using docker-compose.yaml
version: "3"
services:
tari_base_node:
image: quay.io/tarilabs/tari_base_node:v0.5.4
restart: unless-stopped
volumes:
- ./data:/root/.tari
# These 2 params are required for an interactive docker-compose session
stdin_open: true
tty: true
expose:
- 18142
ports:
- "18142:18142"
Then run docker-compose up -d
to start your docker service.
Check the running state with docker-compose ps
Name Command State Ports
------------------------------------------------------------------
tbn_tari_base_node_1 start.sh Up 0.0.0.0:18142->18142/tcp
To connect to the console, use docker ps
to get the container ID which to attach to the tari_base_node in docker
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
73427509a4bb quay.io/tarilabs/tari_base_node:v0.5.4 "start.sh" 45 minutes ago Up 26 minutes 0.0.0.0:18142->18142/tcp tbn_tari_base_node_1
With the container ID 73427509a4bb
, connect to the tari_base_node console as follows docker attach 73427509a4bb
>> help
Available commands are:
help, version, get-balance, list-utxos, list-transactions, list-completed-transactions, cancel-transaction, send-tari, get-chain-metadata, list-peers, reset-offline-peers, ban-peer, unban-peer, list-connections, list-headers, check-db, calc-timing, discover-peer, get-block, search-utxo, search-kernel, search-stxo, get-mempool-stats, get-mempool-state, whoami, toggle-mining, get-mining-state, make-it-rain, coin-split, get-state-info, quit, exit
>> get-chain-metadata
Height of longest chain : 5228
Geometric mean of longest chain : 5892870
Best block : 2c4f92854b2160324b8afebaa476b39be4004d2a7a19c69dd2d4e4da257bfee2
Pruning horizon : 0
Effective pruned height : 0
>> get-state-info
Current state machine state:
Synchronizing blocks: Syncing from the following peers:
510c83279adc7cb7d7dda0aa07
Syncing 5229/5233