Search…
⌃K

How to Run a SORA Mainnet Node

TL;DR

  • Anyone can run a node on the SORA mainnet
  • There are two types of nodes:
    • Syncing nodes (that just receive and relay data)
    • Validating nodes (that make the blocks)

Prerequisites

You will need:
  • A machine with Linux, Windows or macOS
  • Docker. Follow the installation guide for your operating system.
  • At least 8GB RAM (preferably 16GB RAM, although 64GB RAM will be needed for production)
  • 300GB free space (preferably SSD, with the ability to expand)
  • Intel(R) Core(TM) i7–7700K CPU @ 4.20GHz (alternatively, a 4-Core processor with a frequency of 2.2 GHz)
Check that docker is installed using the docker --version command in terminal.
C:\\Users\\Pg> docker --version
Docker version 20.10.2, build 2291f61
C:\\Users\\Pg>
It’s recommended to use the latest docker version.
Check the container with the docker run hello-world command in terminal. If everything works fine, Docker will pull the hello-world image and run it. You should see the following output:
1
C:\\Users\\Pg> docker run hello-world
2
Unable to find image 'hello-world:latest' locally
3
latest: Pulling from library/hello-world
4
0e03bdcc26d7: Pull complete
5
Digest: sha256:95ddb6c31407e84e91a986b004aee40975cb0bda14b5949f6faac5d2deadb4b9
6
Status: Downloaded newer image for hello-world:latest
7
8
Hello from Docker!
9
This message shows that your installation appears to be working correctly.
10
11
To generate this message, Docker took the following steps:
12
1. The Docker client contacted the Docker daemon.
13
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
14
(amd64)
15
3. The Docker daemon created a new container from that image which runs the
16
executable that produces the output you are currently reading.
17
4. The Docker daemon streamed that output to the Docker client, which sent it
18
to your terminal.
19
20
To try something more ambitious, you can run an Ubuntu container with:
21
$ docker run -it ubuntu bash
22
23
Share images, automate workflows, and more with a free Docker ID:
24
<https://hub.docker.com/>
25
26
For more examples and ideas, visit:
27
<https://docs.docker.com/get-started/>
If something went wrong, please visit the Docker documentation site, and depending on your operating system, you can also download Docker here:

Get the latest SORA Node version number

Users should use version 1.4.5 for the time being. We will update this article with the latest version after every update.
You should use the latest SORA Node version in order to run a node. You can see the latest build number here, and find the last version with thex.y.z format.
Use this version number for further docker commands in this guide. The number of the version will be marked as <version> in the commands (note: enter the version number without the brackets).

Running a Syncing Node

On Linux/Mac

Pull the docker image from the docker repository:
docker pull sora2/substrate:1.4.5
Create a folder for the node configuration:
mkdir sora2
cd sora2
And grant access to the folder
chown 10000:10000 `pwd`
On macOS you might need to use instead:
sudo chown <username>:1000
Run the docker image (don’t forget to insert your version below!)
docker run --rm -p 127.0.0.1:9933:9933 -p 127.0.0.1:9944:9944 -v `pwd`:/chain sora2/substrate:1.2.1 --name sora2-node --chain main --base-path /chain --unsafe-ws-external --unsafe-rpc-external --wasm-execution compiled

On Windows

Pull the docker image from the docker repository
docker pull sora2/substrate:1.4.5
Create a folder for the node configuration
C:\\Users\\<username>\\sora2-node
Check access to the folder:
All checkboxes should be activated for the user:
Run the docker command:
docker run --rm -p 127.0.0.1:9933:9933 -p 127.0.0.1:9944:9944 -v sora2-node:/chain -u 0 sora2/substrate:1.4.5 --name sora2-node --chain main --base-path /chain --unsafe-ws-external --unsafe-rpc-external --wasm-execution compiled
Now you can connect to your node with polkadot.js apps. Select Local node and click Switch.
Then your node should sync!

Running a Validator Node

On Linux/Mac

docker pull sora2/substrate:1.4.5
Create a folder for the node configuration
mkdir sora2
cd sora2
And grant access to the folder
chown 10000:10000 `pwd`
On macOS you might need to use instead:
sudo chown <username>:1000
And run the Docker command
docker run --rm -p 127.0.0.1:9933:9933 -p 127.0.0.1:9944:9944 -v `pwd`:/chain sora2/substrate:1.4.5 --name sora2-node --chain main --base-path /chain --validator --rpc-methods Unsafe --rpc-cors all --execution Wasm --wasm-execution compiled
You can add the following flag to enable Telemetry for your node
--telemetry-url "wss://telemetry.polkadot.io/submit/ 0"

On Windows

Pull the docker image from the docker repository
docker pull sora2/substrate:1.4.5
Create a folder for the node configuration
C:\\Users\\<username>\\sora2-node
Check the access to the folder:
All checkboxes should be activated for the user:
Run the Docker command
docker run --rm -p 127.0.0.1:9933:9933 -p 127.0.0.1:9944:9944 -v `pwd`:/chain sora2/substrate:1.4.5 --name sora2-node --chain main --base-path /chain --validator --rpc-methods Unsafe --rpc-cors all --execution Wasm --wasm-execution compiled

Get session keys

With polkadot.js app

Open polkadot.js apps and switch to your local node.
In the Development section, select Local Node (ws://127.0.0.1:9944) and click Switch.
Now you’re able to see the screen with your node information. (Once your node has fully synced)
Navigate to Developer RPC calls
Select author rotateKeys()
And click Submit RPC call button.
You’ll get your session key in the output. Copy the key as you will need them for a further step.

With command line

Open the terminal (or other command line client) and run the command
curl -H “Content-Type: application/json” -d ‘{“id”:1, “jsonrpc”:”2.0", “method”: “author_rotateKeys”, “params”:[]}’ http://localhost:9933
The output will contain the session key
{“jsonrpc”:”2.0",”result”:”0x5e977ddcc0c69a6aed067052d5bd8f6bd365fae03562fd447d434e9814ac415d7c9ffe722364922bda314e44654f5c0cdc00d152470d5433f12cb73d078061863ac769d5f17b5460f042d221edf0099d2ce4c23edbe96ac943452cc4d3ad6d72”,”id”:1}
Copy the result, in the current example it is
0x5e977ddcc0c69a6aed067052d5bd8f6bd365fae03562fd447d434e9814ac415d7c9ffe722364922bda314e44654f5c0cdc00d152470d5433f12cb73d078061863ac769d5f17b5460f042d221edf0099d2ce4c23edbe96ac943452cc4d3ad6d72

Adding a Validator

First, you should go to Accounts and already have an account connected.
Navigate to Network → Staking → Account actions
and click Validator:
Select stash and controller account. It’s recommended to use different accounts for stash and controller. (In the example we are using PAVEL (EXTENSION))
Set the bonded value:
Set the session key (the result of rotateKeys call) and reward commission:
And sign the transaction.
Make sure that you have been added to the stashes:
Finally, wait for the next Era.
When the next Era starts, your validator will be added.

Get Payouts

Open Staking → Payouts. If your validator participates in the consensus, then you’ll be able to get payouts after the Era.
Polkadot.js apps always display XOR, because they don’t support multi assets. There should be said VAL on the screenshot below.
Click the Payout all button and sign the transaction
Make sure to pay attention as the reward will be shared among Validator and Nominators according the Stake.

Add node to Telemetry

If you want to add your node to telemetry just add this tag when you run the docker image
--telemetry-url "wss://telemetry.polkadot.io/submit/ 0"
You can change the name of your node by editing the parameter value of:
--name sora2-node

Running an Archive node

On Linux/Mac

docker pull sora2/substrate:1.4.5
Create a folder for the node configuration
mkdir sora2
cd sora2
And grant access to the folder
chown 10000:10000 `pwd`
On macOS you might need to use instead:
sudo chown <username>:1000
And run the Docker command
docker run --rm -p 127.0.0.1:9933:9933 -p 127.0.0.1:9944:9944 -v `pwd`:/chain sora2/substrate:1.4.5 --name sora2-my-node --chain main --base-path /chain --unsafe-ws-external --pruning archive --unsafe-rpc-external --wasm-execution compiled

On Windows

Pull the docker image from the docker repository
docker pull sora2/substrate:1.4.5
Create a folder for the node configuration
C:\\Users\\<username>\\sora2-node
Check the access to the folder
All checkboxes should be activated for the user
Run the Docker command
docker run --rm -p 127.0.0.1:9933:9933 -p 127.0.0.1:9944:9944 -v sora2-node:/chain -u 0 sora2/substrate:1.4.5 --name sora2-my-node --chain main --base-path /chain --unsafe-ws-external --pruning archive --unsafe-rpc-external --wasm-execution compiled
The node will take some time to sync. The output in logs should look like this:
2021-04-30 11:33:33 💤 Idle (0 peers), best: #0 (0x7e4e…8ad5), finalized #0 (0x7e4e…8ad5), ⬇ 37.1kiB/s ⬆ 16.3kiB/s
2021-04-30 11:33:38 ⚙️ Syncing 31.0 bps, target=#38470 (1 peers), best: #155 (0xa9e2…5b22), finalized #0 (0x7e4e…8ad5), ⬇ 127.6kiB/s ⬆ 0.9kiB/s
2021-04-30 11:33:43 ⚙️ Syncing 35.6 bps, target=#38470 (2 peers), best: #333 (0x4c68…2957), finalized #0 (0x7e4e…8ad5), ⬇ 7.9kiB/s ⬆ 0.2kiB/s
2021-04-30 11:33:48 ⚙️ Syncing 32.4 bps, target=#38471 (2 peers), best: #495 (0x9082…f220), finalized #0 (0x7e4e…8ad5), ⬇ 41.3kiB/s ⬆ 1.1kiB/s
2021-04-30 11:33:53 ⚙️ Syncing 34.6 bps, target=#38471 (2 peers), best: #668 (0xb34a…121a), finalized #512 (0x1f6e…cc65), ⬇ 0.1kiB/s ⬆ 0
You can connect to your own node with Polkadot.js apps. Open Polkadot.js apps and navigate to the Development section in the network selector.
If you’re running a node on your local machine then select Local Node and click Switch. Otherwise, enter your custom endpoint and save.

FAQ

Q: I’m getting an error starting the node.
A: Double check if you have entered the command and flags correctly and that there are no typos. If that does not work, locate your Sora2 folder, erase its contents, pull the docker image and try running the node again.
Q: I don’t have XOR for initial staking.
A: You can exchange tokens for XOR on Polkaswap, or transfer tokens from ETH to the SORA Mainnet using the bridge function in Polkaswap and then exchange for XOR.
Q: Where can I see my node in telemetry?
A: You can see it here
Q: My node is having trouble syncing, what can I do?
A: You can add the setting --in-peers 80 and that should solve the issue, otherwise see the next question.
Q: I have checked all the documentation and my question still has no answer, who else can I ask?
A: You can always join the SORA Devs Telegram community and ask any other questions you may have there, other community members and the admins will be happy to help!