Node Setup
The recommended way to run the Acurast node is by using the published Docker image.
Get the chain spec
Download the Acurast Canary chain spec from the Acurast GitHub repository.
Configure the node
Create an acurast-node
folder. Inside this folder, the following 2 folders and file:
chain-specs
- place the downloaded chain spec heredata
- this is where the node will store its datadocker-compose.yml
- this is where the docker-compose configuration will be placed
In the docker-compose.yml
file, put the following content:
services:
node:
image: "acurast/node-canary:acurast-v0.16.0"
command: "--chain /node/chain-specs/acurast-kusama-parachain-2239-raw.json \
--base-path /node/data \
--bootnodes /ip4/82.220.38.222/tcp/30334/ws/p2p/12D3KooWKrSDeVQ4tVQ1eGjqVAhAW3cgMQFHNCBbJrpmupEvdD4A \
--port 30334 \
--rpc-port 9934 \
--rpc-external \
--rpc-methods safe \
--rpc-cors all \
--database=rocksdb \
--pruning=archive"
ports:
- "30334:30334"
- "9934:9934"
volumes:
- ./:/node
logging:
options:
max-size: "10m"
max-file: "3"
The configuration above will start the Acurast node with the following options:
--chain
- specifies the chain spec file--base-path
- specifies the base path for the node data--bootnodes
- specifies the bootnodes to connect to--port
- specifies the p2p port for the node--rpc-port
- specifies the RPC port for the node--rpc-external
- allows external access to the RPC interface--rpc-methods safe
- allows only safe RPC methods--rpc-cors all
- allows all CORS requests--database=rocksdb
- specifies the database type--pruning=archive
- specifies the pruning mode, changearchive
to the number of blocks to keep if you want to prune the database
Start the node
In acurast-node
folder and run the following command:
docker compose up -d
This will start the Acurast node in detached mode. You can check the logs by running:
docker compose logs -f
Run a Collator
A node can be turned into a collator configuring its identity. One way to do so is to use a tool like subkey.
subkey generate
The output of the above command is something like:
Secret phrase: <MNEMONIC>
Network ID: substrate
Secret seed: 0x4f....
Public key (hex): 0x86....
Account ID: 0x86....
Public key (SS58): 5F7Cm8Kt57dX3SkdtYYDGdMn3yiPvC8dr3oSratmGjjLmSss
SS58 Address: 5F7Cm8Kt57dX3SkdtYYDGdMn3yiPvC8dr3oSratmGjjLmSss
Then configure the node with the generated key by calling the following RPC:
curl -H "Content-Type: application/json" \
--data '{
"jsonrpc":"2.0",
"method":"author_insertKey",
"params":[
"aura",
"INSERT_SECRET_PHRASE",
"INSERT_PUBLIC_KEY_HEX_FORMAT"
],
"id":1
}' \
http://localhost:9934
In order for the above call to succeed, the node needs to be started with --rpc-methods unsafe
. Once the key has been registered, the node can be restarted with the --collator
flag.
The node is now setup as a collator, but it will not start authoring blocks yet. At this stage on the Canary network, the Acurast team manages the list of collators that can actually author blocks until staking functionally is introduced.