Setup a ParaState Node

In this chapter, 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.

  • 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 set up your ParaState node.

Download Pre-built Binaries

Download our pre-built node binaries from the 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 the SHA-1 message digest of downloaded files and compare those on the GitHub release page to make sure your download is correct.

cd ~/parastate-node
sha1sum *

# (the following lines are outputs from the 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 the 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

## In case of a message similar to this: "consider adding` cargo-features = ["edition2021"] `to the manifest", Please update with this command:
cargo install --force cargo-outdated --git https://github.com/cuviper/cargo-outdated.git --branch cargo-2021

# 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 a random mnemonic with the sr25519 address

subkey generate --scheme sr25519

# (the following lines are outputs from the 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 an ed25519 address from the generated mnemonic

subkey inspect --scheme ed25519 'decorate dry struggle hammer grain uncle dolphin brain economy issue melt raise'

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

Run the ParaState Node

The following scripts will start a ParaState node and connect to the 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 the Add Keys to Keystore tutorial from the 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 the 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 the 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.

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"
  }
}

Last updated