substrate-api-sidecar is deprecated in favor of polkadot-rest-api.
polkadot-rest-api is a ground-up Rust rewrite built on subxt, with 1:1 API compatibility (endpoints are served under /v1/, e.g. /v1/blocks/head), stable memory under sustained load, significantly lower latency and higher throughput, and native SCALE decoding via parity-scale-codec.
Migrate today:
- Docker:
docker pull paritytech/polkadot-rest-api:v0.1.0 - Crate:
polkadot-rest-api@0.1.0 - Migration guide: MIGRATION.md
- Documentation: https://paritytech.github.io/polkadot-rest-api/
- Questions/issues: https://github.com/paritytech/polkadot-rest-api/issues
With each release, the maintainers publish a docker image to dockerhub at parity/substrate-api-sidecar
docker pull docker.io/parity/substrate-api-sidecar:latestThe specific image tag matches the release version.
yarn build:docker# For default use run:
docker run --rm -it --read-only -p 8080:8080 substrate-api-sidecar
# Or if you want to use environment variables set in `.env.docker`, run:
docker run --rm -it --read-only --env-file .env.docker -p 8080:8080 substrate-api-sidecarNOTE: While you could omit the --read-only flag, it is strongly recommended for containers used in production.
then you can test with:
curl -s http://0.0.0.0:8080/blocks/head | jqN.B. The docker flow presented here is just a sample to help get started. Modifications may be necessary for secure usage.
Starting with v6.0.0 of docker/build-push-action package, Docker-build summaries are generated and exported by default.
Currently in Sidecar we do not have a major need to keep records of Docker builds, so we have disabled this feature by setting the DOCKER_BUILD_RECORD_UPLOAD and DOCKER_BUILD_SUMMARY environment variables to false.
If this is needed in the future maybe for debugging reasons, we can adjust these variables accordingly.