Connecting a local node to polkadot.js

Crypto new | Brightlystake
3 min readMay 25, 2021

--

Like us many of you must be excited about the POLIS testnet from https://parastate.io which intends to bring evm compatibilty on any popular programming language and run them on POLKADOT.

EVM capatibility on polkadot

In case you are not aware of the POLIS testnet you can still appy for for the ambasaddor program here.

As part of SPATANS week 2 task many of you might need some help to connect to the local node of parastate from polkadot.js.org.Here is a guide showing how to do that

Enable ssh tunneling to the server

The first step is to enable ssh tunnel from the local host to the remote server where your parastate node has been hosted . The below command enable ssh tunnel to remote host xx.xx.xx.xx on port 9944 which is needed for polakdot.js.org endpoint

ssh -N -L 9944:127.0.0.1:9944 -i C:\Users\sshkey\privatekey.ppk root@xx.xx.xx.xx

In case you are not using ssh key and would like to connect using traditional method by supplying password , use the below option

ssh -N -L 9944:127.0.0.1:9944 root@xx.xx.xx.xx

Enter the password when prompted and the result will be similar to what you see below

You will just have empty hanging window . Don’t panic you are all good.

Restart parastate node with RPC options

In order to connect to ws endpoint from local node you need to restart the node with some rpc options.

Stop the running node.

Restart the node with command similar to below

cargo run — release — bin frontier-template-node — \
— execution=Native \
— base-path ./data \
— chain ./specs/2021–04–22-spec-raw.json \
— port 30333 \
— rpc-port 9933 \
— ws-port 9944 \
— validator \
— telemetry-url ‘wss://telemetry.polkadot.io/submit/ 0’ \
— name ‘cn_crypto_new’ \
— bootnodes /ip4/13.67.57.72/tcp/30333/p2p/12D3KooWNwpkJk3f4fUEc9cjSzLC5xE3opf25pjt7izfNGc1v5Tu

After the node is restarted verify that the node is in sync and is visible in telemetry. It is recommended to read abou the options that you are adding and revert back once you are done.

Connect to node

Once the node is in sync you can connect to local node through https://polkadot.js.org/apps/

Click on the top left corner with the drop down

Select Development and select the local node option as highlighted above.

Once it is selected the page will reintialize and connect to your server through the tuneling and must look like

Now you are connected to parastate node that you are running .

Applying to be validator

Follow the instructions at https://github.com/ParaState/frontier/wiki/ParaState-Testnet-Node-Setup-Guideline to apply to become a validator in Parastate testnet.

Cheers,

BRIGHTLYSTAKE.com

--

--