Skip to main content

Node Setup

Step by step guide on how to setup an Acurast node for the Rococo testnet.

Get the source code and build

Clone the Acurast parachain source code from its Github repo:

git clone https://github.com/Acurast/acurast-substrate.git

Make sure to checkout the appropriate tag, acurast-v0.1.1 at the time of writing.

cd acurast-substrate
git checkout acurast-v0.1.1

Before building, make sure the Rust toolchain is installed.

Build the node:

cargo build --release

Then run the node:

./target/release/acurast-node --rococo-runtime --bootnodes /ip4/138.201.85.115/tcp/40335/p2p/12D3KooWAYwTLAQu47uBmCvA1uYpJs7ND1mkoCJTdU1Z6VYqgTp1 --parachain-id 2239 --base-path /tmp/para/acurast --port 40335 --ws-port 8846 --rpc-port 8082 --unsafe-ws-external --rpc-methods=unsafe --rpc-external --rpc-cors=all -- --execution wasm --chain rococo.json --port 30345 --ws-port 9979

Replace the /tmp/para/acurast path to the location you want the chain data to be stored in. Also adapt the port numbers and the rpc/websocket options as necessary.

The rococo.json file in the command above needs to be the Rococo chain spec and can be downloaded here.

Run as a Collator

To run as a collator, first start the node, by adding the --collator flag to the command used to run the node, e.g.:

./target/release/acurast-node --collator --rococo-runtime --bootnodes /ip4/138.201.85.115/tcp/40335/p2p/12D3KooWAYwTLAQu47uBmCvA1uYpJs7ND1mkoCJTdU1Z6VYqgTp1 --parachain-id 2239 --base-path /tmp/para/acurast --port 40335 --ws-port 8846 --rpc-port 8082 --unsafe-ws-external --rpc-methods=unsafe --rpc-external --rpc-cors=all -- --execution wasm --chain rococo.json --port 30345 --ws-port 9979

Then, setup the Nimbus ID of the collator by calling the author_rotateKeys rpc as follow:

curl http://127.0.0.1:8082 -H \
"Content-Type:application/json;charset=utf-8" -d \
'{
"jsonrpc":"2.0",
"id":1,
"method":"author_rotateKeys",
"params": []
}'

The collator node should respond with the public key of your new session key, the 64 hexadecimal characters after the 0x prefix represent your Nimbus ID, e.g.:

{"jsonrpc": "2.0", "result": "0x72c7ca7ef07941a3caeb520806576b52cb085f7577cc12cd36c2d64dbf73757", "id": 1}

"0x72c7ca7ef07941a3caeb520806576b52cb085f7577cc12cd36c2d64dbf73757" is the Nimbus public key to be used in the following step.

Then, make sure to have at least 20,010 ACRST tokens: 20,000 ACRST to join the candidates pool and 10 ACRST for extrinsics fees, please request that amount to Acurast Team on Discord or Telegram.

After that open the Polkadot JS apps wallet and connect to Acurast Testnet on Rococo Relaychain (https://polkadot.js.org/apps/#/explorer), then go to: Developer --> extrinsic --> select the account you are willing to use for your collator --> select "session" pallet --> select "setKeys" --> copy-paste the Nimbus key obtained before on "keys" field --> put "0x00" on "proof" field --> click on "Submit Transaction" and sign the extrinsic --> wait for block confirmation

Then, go to: Developer --> JavaScript --> create new script or just delete an existing one --> copy-paste the following script --> click on "Play" button --> take a note of the "Candidate pool size" (you will need it in the next step)

Get candidatePool size script

// Simple script to get candidate pool size
const candidatePool = await api.query.parachainStaking.candidatePool();
console.log(Candidate pool size is: ${candidatePool.length});

Then go to: Developer --> extrinsic --> select the account you are willing to use for your collator --> select "parachainStaking" pallet --> select "joinCandidates" --> put "20000000000000000" on "bond" field --> put "Candidate pool size" number as noted before on "candidateCount" field --> click on "Submit Transaction" and sign the extrinsic --> wait for block confirmation

Congrats! Your collator should be joined the candidates pool, if there are free slots available in the active set, your collator should start producing blocks at the beginning of next session. The team will control the number of candidates and will increase the "totalSelected" amount in order to allow everyone to be active in the set, at opposite you will need more tokens in order to overcome the last one in the list and become an active collator.