The joystream-node is the main server application that connects to the network, synchronizes the blockchain with other nodes and produces blocks if configured as a validator node.
The latest pre-built binaries can be downloaded from the releases page.
Generally these will be built from master
branch and will pertain to the currently active network.
Clone the repository and install build tools:
git clone https://github.com/Joystream/joystream.git
cd joystream/
./setup.sh
Compile the node and runtime:
WASM_BUILD_TOOLCHAIN=nightly-2022-11-15 cargo +nightly-2022-11-15 build --release
This produces the binary in ./target/release/joystream-node
./target/release/joystream-node --dev
If you repeatedly need to restart a new chain, this script will build and run a fresh new local development chain (purging existing chain data):
./scripts/run-dev-chain.sh
Use the --chain
argument, and specify the path to the genesis chain.json
file for that public network.
Here is the JSON "chain spec" file for the Joystream mainnet joy-mainnet.json.
./target/release/joystream-node --chain joy-mainnet.json
Running unit tests:
cargo +nightly-2022-11-15 test --release --all
Running full suite of checks, tests, formatting and linting:
yarn cargo-checks
Always format your rust code with cargo fmt
before committing:
cargo fmt --all
If you are building a tagged release from master
branch and want to install the executable to your path follow the step below.
This will install the executable joystream-node
to your ~/.cargo/bin
folder, which you would normally have in your $PATH
environment.
# From the project root directory
WASM_BUILD_TOOLCHAIN=nightly-2022-11-15 cargo +nightly-2022-11-15 install joystream-node --path bin/node/ --locked
Now you can run and connect to the network:
joystream-node --chain joy-mainnet.json