Skip to content

Latest commit

 

History

History
229 lines (161 loc) · 5.72 KB

File metadata and controls

229 lines (161 loc) · 5.72 KB

Setting up a Collator and Full-Node

Running a collator or full-node will allow you to sync and verify the integrity of the interBTC bridge. To get started, follow this guide.

At the end of this document you will have:

  • Connected to a network
  • Synced a local full-node
  • Registered as a collator

?> Please note that there are limited slots for registering as a collator.

The following instructions have been tested on Linux.

Prerequisites

Checkout the standard hardware requirements on the Polkadot Wiki.

Create a local directory to store persistent data:

mkdir -p data

Optional: Snapshots

Syncing the embedded relay chain can take a number of days. Polkashots hosts database snapshots of Kusama and Polkadot which can be downloaded in minutes. Follow the relevant guide and extract the snapshot to the data directory.

Quickstart

Map the directory into a local volume used by the docker container.

Kintsugi

docker run \
  --network host \
  --volume ${PWD}/data:/data \
  interlayhq/interbtc:1.24.0 \
  --base-path=/data \
  --chain=kintsugi \
  --execution=wasm \
  --wasm-execution=compiled \
  --unsafe-ws-external \
  --rpc-methods=unsafe \
  --pruning=archive \
  -- \
  --rpc-cors=all \
  --no-telemetry \
  --execution=wasm \
  --wasm-execution=compiled \
  --database=rocksdb \
  --pruning=1000

Interlay

docker run \
  --network host \
  --volume ${PWD}/data:/data \
  interlayhq/interbtc:1.24.0-hotfix \
  --base-path=/data \
  --chain=interlay \
  --execution=wasm \
  --wasm-execution=compiled \
  --unsafe-ws-external \
  --rpc-methods=unsafe \
  --pruning=archive \
  -- \
  --rpc-cors=all \
  --no-telemetry \
  --execution=wasm \
  --wasm-execution=compiled \
  --database=rocksdb \
  --pruning=1000

Standard Installation

1. Install a pre-built binary

Download the pre-built binary:

Kintsugi

wget https://github.com/interlay/interbtc/releases/download/1.24.0/interbtc-parachain
chmod +x interbtc-parachain

Interlay

wget https://github.com/interlay/interbtc/releases/download/1.24.0-hotfix/interbtc-parachain
chmod +x interbtc-parachain

2. [Optional] Install from source

Build the parachain from source, this is necessary if we do not host builds compatible with your architecture.

2.1 Install Rust

We typically aim to support the latest version of nightly, check the README for the most up-to-date build instructions.

curl https://sh.rustup.rs -sSf | sh

2.2 Build the node

?> This step will take some time depending on your hardware.

Clone the parachain code, checkout the appropriate release and build the node:

git clone git@github.com:interlay/interbtc.git
cd interbtc

Kintsugi

git checkout 1.24.0
cargo build --release

Interlay

git checkout 1.24.0-hotfix
cargo build --release

3. Run the node

Move the binary into your $PATH and run the parachain full-node:

Kintsugi

interbtc-parachain \
  --base-path=${PWD}/data \
  --chain=kintsugi \
  --execution=wasm \
  --wasm-execution=compiled \
  --unsafe-ws-external \
  --rpc-methods=unsafe \
  --pruning=archive \
  -- \
  --rpc-cors=all \
  --no-telemetry \
  --execution=wasm \
  --wasm-execution=compiled \
  --database=rocksdb \
  --pruning=1000

Interlay

interbtc-parachain \
  --base-path=${PWD}/data \
  --chain=interlay \
  --execution=wasm \
  --wasm-execution=compiled \
  --unsafe-ws-external \
  --rpc-methods=unsafe \
  --pruning=archive \
  -- \
  --rpc-cors=all \
  --no-telemetry \
  --execution=wasm \
  --wasm-execution=compiled \
  --database=rocksdb \
  --pruning=1000

Registering

To contribute to the decentralization of the network, users may register their full-node as a collator candidate.

1. Stake vote-escrowed tokens

See: Staking

Note the account that you used to stake.

2. Generate a session key

Connect to your local node and use the author_rotateKeys RPC request to create new keys in your node's keystore:

Rotate Keys

3. Submit the session key

Use the setKeys extrinsic (example) to associate your collator node with the controller account (that you used to stake):

Set Keys

In this example we used the URI //Alice which is a well-known testing account ONLY - do not use this in production. Generate a secure (sr25519) secret seed using a tool such as subkey or polkadot-js instead.

4. Register the collator

Submit the registerAsCandidate extrinsic (example) with the staked account to start collating:

Register

Upgrading

In most cases, breaking changes to on-chain logic will be handled via the forkless runtime upgrades. However, this will not cover updates to the RPC tooling which will require that you terminate, download and restart your node.