A JavaScript version of a Polkadot/Substrate network client. It allows operation in full and light nodes fullfilling all functions of chain operation, however does not include the ability to author blocks (i.e. run as a validator on the network).
This is the current status of the client -
- It can sync and operate on Polkadot POC-3 networks, and has been tested against Alexander (Polkadot), Dried Danta (Substrate) as well as Edgeware networks.
- It currently does not include much (if any) of the RPC interfaces - so it is not (currently) able to support eg. the apps UI connecting to it
- It does not (currently) do any state and trie pruning, so the resulting backing database growth is not controlled
- As of 0.19.1 the backing database has been swapped to LmDB, this interface is much faster than the previous implementation, however uses more disk space (follow-up from the previous point). Investigations are still ongoing as to the best fit for the backend DB engine.
It is split up into a number of internal packages -
- client The main JavaScript client
- client-chains Chain definitions
- client-db Database interface
- client-p2p Peer-to-peer server
- client-rpc RPC server
- client-runtime Basic Wasm runtime wrapper
- client-telemetry Substrate telemetry interface
- client-types Specific codec types for client interfaces
- client-wasm Wasm interface wrapper
Start the node with yarn run start <options>
, e.g. yarn run start --chain dried-danta
. You can use --help
to get a list of the available options.
A docker image is built from the supplied Dockerfile
, which includes the latest version as supported and deployed to the registry. To run via docker, the following commands can be used. (Split into lines for readability) -
docker run -d \
--name dd \
-p 60666:60666 \
-v ~/db:/data \
jacogr/polkadot-js-client:latest \
--chain alexander \
--db-path /data \
--db-type file \
--telemetry-name "some-cool-name-here"
Some additional expansion to the above -
- docker
-d
runs the container as a daemon (skip as required) - docker
--name
specifies the name of the container indocker container ls
- docker
-p
maps the p2p port externally (ensure the firewall is open on this) - docker
-v
uses the local host path~/db
as the data path, mapping it to the container itself. - For
--chain
eitheralexander
ordried-danta
are built-in options. --db-type
can be eitherfile
(default, experimental) orlmdb
(experimental, more memory intensive).- Images are deployed to dockerhub, and we try to keep them current.
You can build your own container via the ./docker.sh
script included which will use the latest available repo version to base an image on.
- Bootstrap the dependencies,
yarn
- Make any changes in the relevant package, on master merges new versions will be published automatically