ParaState Testnet Node Setup Guideline - ParaState/frontier GitHub Wiki

If you want the previous version of guideline (for ParaState Testnet 2021-04-22), check here.

ToC

In this guide, you will learn how to set up a ParaState node to join our testnet. After that, you could submit a request to join the validator group.

Setup a ParaState Node

Recommended Hardware

  • CPU: 2.0 GHz x86-64 CPU
  • Memory: 8GB RAM
  • Disk: 500GB High-Speed Storage (SSD)
  • For your reference, we deploy our own ParaTime node on Azure D2s_v3 instances (2 VCPU, 8GB Memory, 500GB Disk space)

Environment

Currently, we only support Ubuntu 20.04. Please use Ubuntu 20.04 to setup your ParaState node.

Download Pre-built Binaries

Download our pre-built node binaries from GitHub release page:

mkdir -p ~/parastate-node
cd ~/parastate-node
wget https://github.com/ParaState/frontier/releases/download/v0.21.7.15/parastate-node.tar.gz
wget https://github.com/ParaState/frontier/releases/download/v0.21.7.15/2021-07-15-spec-raw.json
tar zxvf parastate-node.tar.gz
rm -f parastate-node.tar.gz

You could check SHA-1 message digest of downloaded files and compare those on GitHub release page to make sure your download is correct.

cd ~/parastate-node
sha1sum *

# (the following lines are outputs from command)
c096b6ab4566ae2efbc56a146c5abd56fa3ff115  2021-07-15-spec-raw.json
ae448c56a4808bd1ffc28add0b955ad15d99ad47  libssvm-evmc.so
1f1f538fad833bab586bc777ca2af644df2e08af  parastate-node

Expose ports

  • 30333: Default p2p traffic port. Make sure you expose this port externally.
  • 9933: Default RPC traffic port.
  • 9944: Default WebSocket traffic port.

Generate Your Own Keys

You'll need your own keys to run a ParaState node. Follow Generate Your Own Keys tutorial from Substrate Developer Hub:

# Install subkey tool
curl https://getsubstrate.io -sSf | bash -s -- --fast
source ~/.cargo/env
cargo install --force subkey --git https://github.com/paritytech/substrate --version 2.0.1 --locked

# Generate a mnemonic and see the sr25519 key and address
subkey generate --scheme sr25519

# Use the same mnemonic to see ed25519 key and address
subkey inspect --scheme ed25519 "<Your Mnemonic>"

For example:

  • Generate random mnemonic with sr25519 address
subkey generate --scheme sr25519

# (the following lines are outputs from command)
Secret phrase `decorate dry struggle hammer grain uncle dolphin brain economy issue melt raise` is account:
  Secret seed:       0x3c3c9ba1cd3332afcdb68267e2c43436c6970a42bc8827bfacc9b3194c4e0adb
  Public key (hex):  0x6459eb9cb52781cfb0777e3edb28c77e33c00faefc07538287f518d1e718a662
  Public key (SS58): 5ELHMh5NRcjKK5sytWRDGJwWnuiWJo4va9Y54cMbHQe2gUfv
  Account ID:        0x6459eb9cb52781cfb0777e3edb28c77e33c00faefc07538287f518d1e718a662
  SS58 Address:      5ELHMh5NRcjKK5sytWRDGJwWnuiWJo4va9Y54cMbHQe2gUfv
  • Generate ed25519 address from generated mnemonic
subkey inspect --scheme ed25519 'decorate dry struggle hammer grain uncle dolphin brain economy issue melt raise'

# (the following lines are outputs from command)
Secret phrase `decorate dry struggle hammer grain uncle dolphin brain economy issue melt raise` is account:
  Secret seed:       0x3c3c9ba1cd3332afcdb68267e2c43436c6970a42bc8827bfacc9b3194c4e0adb
  Public key (hex):  0x163289d89a257f0692d6537714ea0a860eebbc708e67c0daeb6becf4625edef2
  Public key (SS58): 5CZovXXFjYeksynJdCsMTieiDSdDE3oZtb55KwhJneg6JXyT
  Account ID:        0x163289d89a257f0692d6537714ea0a860eebbc708e67c0daeb6becf4625edef2
  SS58 Address:      5CZovXXFjYeksynJdCsMTieiDSdDE3oZtb55KwhJneg6JXyT

Run ParaState Node

The following scripts will start a ParaState node and connect to ParaState Testnet (2021-07-15):

export YOUR_NODE_NAME='<repalce your node name here>'
cd ~/parastate-node
LD_LIBRARY_PATH=. ./parastate-node \
  --execution=Native \
  --base-path ./data \
  --chain ./2021-07-15-spec-raw.json \
  --port 30333 \
  --rpc-port 9933 \
  --ws-port 9944 \
  --validator \
  --telemetry-url 'wss://telemetry.polkadot.io/submit/ 0' \
  --name "$YOUR_NODE_NAME" \
  --bootnodes "/ip4/13.112.97.203/tcp/30333/p2p/12D3KooWCW1zfn6uMNbS5Skv5399mpmiAa3yC925EaCDNkgsEimn"

After your node starts importing blocks, you could check your node status at Polkadot Telemetry.

Add Your Key to Your ParaState Node

Follow Add Keys to Keystore tutorial from Substrate Developer Hub to add previous generated keys to your node:

  • We need to use the author.insertKey RPC call to add keys. Here you need to restart your node with --rpc-methods Unsafe temporary. You should restart your node without this flag after adding keys.
  • Go to Polkadot-JS Apps UI and connect it to your node. (Reminder: You might need to restart your node with the --unsafe-ws-external flag to connect from a different host.)
  • Navigate to Developer -> RPC Call and choose author and insertKey with the following arguments for Aura key:
    • keytype: aura
    • suri: <Your Mnemonic> (eg. clip organ olive upper oak void inject side suit toilet stick narrow)
    • publicKey: <Your Raw sr25519 Key> (eg. 0x9effc1668ca381c242885516ec9fa2b19c67b6684c02a8a3237b6862e5c8cd7e)

  • Insert againt with GRANDPA key:
    • keytype: gran
    • suri: <Your Mnemonic> (eg. clip organ olive upper oak void inject side suit toilet stick narrow)
    • publicKey: <Your Raw ed25519 Key> (eg. 0xb48004c6e1625282313b07d1c9950935e86894a2e4f21fb1ffee9854d180c781)
  • Navigate to Accounts -> Accounts and choose Add account. Use your mnemonic seed to create an account at your browser.

images/guideline/add-account.png

Update Developer Settings

  • Go to Polkadot-JS Apps UI and connect it to your node. (Reminder: You might need to restart your node with the --unsafe-ws-external flag to connect from a different host.)
  • Navigate to Settings -> Developer and paste the following json:
{
  "Address": "MultiAddress",
  "LookupSource": "MultiAddress",
  "Keys": "SessionKeys2",
  "Account": {
    "nonce": "U256",
    "balance": "U256"
  },
  "Transaction": {
    "nonce": "U256",
    "action": "String",
    "gas_price": "u64",
    "gas_limit": "u64",
    "value": "U256",
    "input": "Vec<u8>",
    "signature": "Signature"
  },
  "Signature": {
    "v": "u64",
    "r": "H256",
    "s": "H256"
  }
}

images/guideline/settings.png

Join ParaState Validator Set

Get Validator Token

At the next step Set Your Rotate Keys, you will need some validator token at you validator account. You could get some validator token from our Faucet for ParaState Testnet Validator. Just submit your validator account (sr25519) at our faucet, and we'll transfer some validator token to your validator account (sr25519) so that you can set up your rotate keys.

Set Your Rotate Keys

When you receive our notification about joining the Validator Set, we will delegate some tokens to your validator account. This will give your account permission to set your rotate keys.

When you want to join the ParaState validator set, you need to follow these steps:

  • Restart your node with --rpc-methods Unsafe temporary for author.rotateKeys() RPC call.
  • Go to Polkadot-JS Apps UI and connect it to your node. (Reminder: You might need to restart your node with the --unsafe-ws-external flag to connect from a different host.)
  • Navigate to Developer -> RPC Call and choose author and rotateKeys():

  • Copy the hex value result.
  • (GET BALANCE BEFORE THIS STEP) Navigate to Developer -> Extrinsics. Select the account you added from your mnemonic seed and choose session and setKeys(keys, proof). Paste copied hex value (rotate keys) to keys field and set 0x00 to the proof field:

images/guideline/set-keys.png

Request to Join Validator Set

After setting keys, please file a request with your validator account (sr25519) to join ParaState Testnet validator set (link TBD). You'll be added to the validator set once our admin approves your request.

ParaState Validator Registration Plan

We plan to open the validator set registration at (date TBD). Here is the timeline and number of validator slots:

  • In the first month, 10 validator slots opened
  • In the second month, the validator slots doubled, 20 validator slots opened
  • In the third month, the validator slots doubled, 40 validator slots opened
  • In the fourth month, the validator slots doubled, 80 validator slots opened
  • After the fifth month, the validator slots are set to unlimited. Try to accept validators as many as possible.

To join the ParaState validator set, you should fill this form (link TBD) to submit your validator account (sr25519). We'll announce the validator set at the beginning of each month.

Setup Reward Account

After becoming a validator, you could get block rewards when generating blocks if you setup your reward address.

Get Validator Token

At the next step Set Ethereum-compatible Address, you will need some validator token at you validator account. You could get some validator token from our Faucet for ParaState Testnet Validator. Just submit your validator account (sr25519) at our faucet, and we'll transfer some validator token to your validator account (sr25519) so that you can set up your reward account.

Set Ethereum-compatible Address

  • Go to Polkadot-JS Apps UI and connect it to your node. (Reminder: You might need to restart your node with the --unsafe-ws-external flag to connect from a different host.)
  • Navigate to Developer -> Extrinsics. Select the account you added from your mnemonic seed and choose evm and setEthAddr(eth_addr). Input your Ethereum-compatible address to eth_addr field and submit the transaction.