System Requirements We recommend consulting the standard hardware section of the Polkadot Wiki for specs.
Below we describe two ways of running our chain node:
Docker Container This is the recommended way to experiment with your own node. It will get you started within 5 minutes. Since docker is running pre-build containers, this setup minimizes the steps required to get started and isolates any potential issues.
Bare Metal Running a bare metal setup requires you to compile centrifuge chain from source, which can take between a 10 minutes up to 4 hours, depending on your specs. For a production grade setup, we do recommend to run a bare metal validators for 2 reasons: a) It minimizes the tools involved, which increases security, b) The performance is slightly supperior.
subkey
version v2.0.0
.subkey generate
. Make sure you save the output in a safe place. For mainnet keys use network flag: subkey generate -n centrifuge
0x
prefix). Note that we do expose RPC and WS ports here for simplicity – these ports should not be exposed in a production grade setup.a) Catalyst testnet:
1docker run -it centrifugeio/centrifuge-chain:parachain-20220321225409-cec1169 --base-path=/chain-data --rpc-cors=all --port=<user generated> --rpc-port=9933 --ws-port=9944 --node-key=<user generated> --ws-external --rpc-external --pruning=archive --rpc-methods=Unsafe --name=<user generated> --chain=catalyst --execution=wasm --wasm-execution=compiled --parachain-id=2031 --state-cache-size=0 --bootnodes=/ip4/34.107.115.238/tcp/30333/ws/p2p/12D3KooWHcuqE4UwB8tkiyDazFeuAhHNw9rdUV8DhN6pZCqwMDix -- --rpc-cors=all --port=<user generated> --rpc-port=9934 --ws-port=9945 --node-key=<user generated> --ws-external --rpc-external --no-telemetry --name=<user generated> --chain=/config/rococo.json
b) Mainnet:
1docker run -it centrifugeio/centrifuge-chain:parachain-20220303141305-681f4a6 --base-path=/chain-data --rpc-cors=all --port=<user generated> --rpc-port=9933 --ws-port=9944 --node-key=<user generated> --ws-external --rpc-external --pruning=archive --rpc-methods=Unsafe --name=<user generated> --chain=centrifuge --execution=wasm --wasm-execution=compiled --parachain-id=2031 --state-cache-size=0 --bootnodes=/ip4/34.159.117.205/tcp/30333/ws/p2p/12D3KooWMspZo4aMEXWBH4UXm3gfiVkeu1AE68Y2JDdVzU723QPc -- --rpc-cors=all --port=<user generated> --rpc-port=9934 --ws-port=9945 --node-key=<user generated> --ws-external --rpc-external --no-telemetry --name=<user generated> --chain=polkadot
Install dependencies:
a) On Unix systems (Debian, Ubuntu, ...): sudo apt install -y cmake pkg-config libssl-dev git gcc build-essential clang libclang-dev
b) On MacOS: brew install openssl cmake llvm
Install Rust: curl https://sh.rustup.rs -sSf | sh
Make sure that you are using the latest Rust stable by default: rustup default stable
Install nightly for WASM support:
1RUST_TOOLCHAIN=nightly2rustup update $RUST_TOOLCHAIN
If above does not work, use:
1RUST_TOOLCHAIN=nightly-2020-08-162rustup update $RUST_TOOLCHAIN34rustup toolchain install $RUST_TOOLCHAIN5rustup default $RUST_TOOLCHAIN67rustup target add wasm32-unknown-unknown --toolchain $RUST_TOOLCHAIN
Add the WASM target: rustup target add wasm32-unknown-unknown --toolchain $RUST_TOOLCHAIN
Clone centrifuge-chain: git clone -b v0.10.4-rc1 git@github.com:centrifuge/centrifuge-chain.git
Change directory: cd centrifuge-chain
Optional - run the tests: cargo test --all
Build Centrifuge Chain: cargo build --release
Ensure you have subkey installed (can be on another machine).
Generate a new key pair with subkey that will be used as your node-key: subkey generate
. Make sure you save the output in a safe place.
The node is now built and available in target/release/centrifuge-chain
.
Below are the commands to start a node. {name}
is the name that will show up in Polkadot Telemetry and {node-key}
is the private key (Secret seed
in the output of subkey) you just generated (without the 0x prefix).
Mainnet:
1./target/release/centrifuge-chain2 --unsafe-ws-external3 --unsafe-rpc-external4 --rpc-cors=all5 --rpc-methods=unsafe6 --pruning=archive7 --name=centrifuge8 --node-key=NODE_KEY_HERE9 --chain=centrifuge10 --parachain-id=203111 --bootnodes=/ip4/34.159.117.205/tcp/30333/ws/p2p/12D3KooWMspZo4aMEXWBH4UXm3gfiVkeu1AE68Y2JDdVzU723QPc12 --port=3033313 --rpc-port=993314 --ws-port=994415 --base-path=DATA_PATH_HERE16 --log=main,info17 --execution=wasm18 --wasm-execution=compiled19 --ws-max-connections=500020 --21 --execution=wasm22 --wasm-execution=compiled23 --chain=polkadot