Setting up a Shardnet Node for NEAR STAKEWARS!

Firstly you will need a server! You can use 8 cpu 16 RAM on Hetzner.

Registration form here!

Update Ubuntu and download all the needed packages, install python

sudo apt install -y git binutils-dev libcurl4-openssl-dev zlib1g-dev libdw-dev libiberty-dev cmake gcc g++ python docker protobuf-compiler libssl-dev pkg-config clang llvm cargo clang build-essential makesudo apt install python3-pip 
USER_BASE_BIN=$(python3 -m site --user-base)/bin export PATH="$USER_BASE_BIN:$PATH"

Install Node JS and NPM

Install NEAR CLI

Set up the environment. Be aware that you should input these commands anytime you open a new session! Otherwise testnet environment will be used!

Install cargo and rust

Now download and build binary. Please check the commit to be exactly this since it is the only one that should be used right now!

#check the version
~/nearcore/target/release/neard --version

Initialize the working directory, delete old files and download new config file and new genesis.json. Since the network was hard forked recently, there is no need to download the snapshot.

Now you will need to create a wallet https://wallet.shardnet.near.org/
WARNING! If you had a wallet previously to the hard fork, you may need to recreate it! Forget the old mnemonic and do everything from scratch.

After that, write in the CLI

See the authorisation link and copy it into the browser window where you wallet is opened. After connecting a wallet, right the wallet name (<accountId>.shardnet.near) in the CLI and confirm.

Copy your wallet json and make some changes

Change the account ID and Private Key parameter accordingly, then exit nano editor.

Create a service file (one command)

Now start the service and see logs, that everything works fine. You should see it downloading headers firstly and the blocks. Waiting for full sync.

Now let’s deploy a contract of our staking pool with 30 NEAR staked!

Change <pool id>, <accountId>, <public key>, <accountId> parameters here!

My example for this

If everything is fine, you should see yourself in near proposals command. Let’s look at the seat price in the bottom of near proposals command. And then we will need to stake. Remember to set environmentals for shardnet!

Change parametres for staking accordingly!

In the few epochs, you will be able to see yourself in the explorer and by typing

Finally, we can set the ping (every 5 minutes)

export NEAR_ENV=shardnet
near call 777stakes.factory.shardnet.near ping '{}' --accountId 777stakes.shardnet.near --gas=300000000000000
exit nanochmod +x ping.sh

Set up cron job for every 5 minutes! You can make sure script is working in the explorer!

Now all set! Good luck!

--

--

Professional validator, taking part in major testnets and running mainnets.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Ivan Staker

Professional validator, taking part in major testnets and running mainnets.