Substrate RPC client in Go. It provides APIs and types around Polkadot and any Substrate-based chain RPC calls. This client is modelled after polkadot-js/api.
This package is feature complete, but it is relatively new and might still contain bugs. We advice to use it with caution in production. It comes without any warranties, please refer to LICENCE for details.
Please refer to https://godoc.org/github.com/ComposableFi/go-substrate-rpc-client
- Install dependencies by running
make
- Build the project with
go build
- Lint
make lint
(you can usemake lint-fix
to automatically fix issues) - Run
make run-substrate-docker
to run the Substrate docker container
We run our tests against a Substrate Docker image. You can choose to run the tests within a tests-dedicated Docker container or without a container.
-
make test-dockerized
Run tests within a docker container of its own against the Substrate docker container. -
make test
Run the tests locally against the Substrate docker container. Note that it expects the Substrate docker container to be up and running to execute the whole test suite properly.
Visit https://polkadot.js.org/apps for inspection
Note: To use a custom Substrate endpoint, first set the enviromment variable before running the tests:
export RPC_URL="http://example.com:9934"
After adding support for new methods, update the RPC mocks.
- Install mockery
- Run
go generate ./...