use

Contribute to the Network

Contributors

Running a Full Node

Requirements

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:

  1. 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.

  2. 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.

Run your node in a Docker Container

  1. Ensure you have docker as well as subkey installed. Use subkey version v2.0.0.
  2. 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. For mainnet keys use network flag: subkey generate -n centrifuge
  3. Start your node by running the following, where {name} is the name that will show up in Polkadot Telemetry and {node-key} is the private key you just generated (without the 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:

  1. Pull down Rococo Chain Spec from: wget -P /config/ https://raw.githubusercontent.com/paritytech/polkadot/08c200f6540f67c16846d3152de50f0fbbc2a73d/node/service/res/rococo.json
  2. Place it in a directory of choice that will be mounted in the docker container and refer to it, in the example below I placed it in the /config folder.
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

Bare metal instructions

  1. 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

  2. Install Rust: curl https://sh.rustup.rs -sSf | sh

  3. Make sure that you are using the latest Rust stable by default: rustup default stable

  4. Install nightly for WASM support:

    1RUST_TOOLCHAIN=nightly
    2rustup update $RUST_TOOLCHAIN
  5. If above does not work, use:

    1RUST_TOOLCHAIN=nightly-2020-08-16
    2rustup update $RUST_TOOLCHAIN
    3
    4rustup toolchain install $RUST_TOOLCHAIN
    5rustup default $RUST_TOOLCHAIN
    6
    7rustup target add wasm32-unknown-unknown --toolchain $RUST_TOOLCHAIN
  6. Add the WASM target: rustup target add wasm32-unknown-unknown --toolchain $RUST_TOOLCHAIN

  7. Clone centrifuge-chain: git clone -b v0.10.4-rc1 git@github.com:centrifuge/centrifuge-chain.git

  8. Change directory: cd centrifuge-chain

  9. Optional - run the tests: cargo test --all

  10. Build Centrifuge Chain: cargo build --release

  11. Ensure you have subkey installed (can be on another machine).

  12. 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.

Executing the binary

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-chain
2 --unsafe-ws-external
3 --unsafe-rpc-external
4 --rpc-cors=all
5 --rpc-methods=unsafe
6 --pruning=archive
7 --name=centrifuge
8 --node-key=NODE_KEY_HERE
9 --chain=centrifuge
10 --parachain-id=2031
11 --bootnodes=/ip4/34.159.117.205/tcp/30333/ws/p2p/12D3KooWMspZo4aMEXWBH4UXm3gfiVkeu1AE68Y2JDdVzU723QPc
12 --port=30333
13 --rpc-port=9933
14 --ws-port=9944
15 --base-path=DATA_PATH_HERE
16 --log=main,info
17 --execution=wasm
18 --wasm-execution=compiled
19 --ws-max-connections=5000
20 --
21 --execution=wasm
22 --wasm-execution=compiled
23 --chain=polkadot