If you're building dapps or products on a Substrate-based chain like Polkadot, Kusama or a custom Substrate implementation, you probably want the ability to run a node-as-a-back-end. After all, it's always better to rely on your own infrastructure than on a third-party-hosted one in this brave new decentralized world.
Follow instructions as outlined here - note that Windows users will have their work cut out for them. It's better to instead use a virtual machine.
Test if the installation was successful by running
λ cargo --version cargo 1.41.0 (626f0f40e 2019-12-03)
Clone and Build
The paritytech/polkadot repo's master branch contains the latest Kusama code.
git clone https://github.com/paritytech/polkadot kusama cd kusama ./scripts/init.sh cargo build --release
Alternatively, check out a specific tagged release:
git clone https://github.com/paritytech/polkadot kusama cd kusama git checkout tags/v0.7.20 ./scripts/init.sh cargo build --release
The built binary will be in the
target/release folder, called
./target/release/polkadot --name "My node's name"
--help flag to find out which flags you can use when running the node. For example, if connecting to your node remotely, you'll probably want to use
The syncing process will take a while depending on your bandwidth, processing power, disk speed and RAM. On a $10 DigitalOcean droplet, the process can complete in some 36 hours.
Congratulations, you're now syncing with Kusama. Keep in mind that the process is identical when using any other Substrate chain.
Running an Archive Node
When running as a simple sync node (above), only the state of the past 256 blocks will be kept. When validating, it defaults to archive mode (keeps all state - much more resource intensive). To keep the full state - so you can do historical lookups, for example - use the
./target/release/polkadot --name "My node's name" --pruning archive