Build and run Parity anywhere with Docker:
Docker containers for Parity are available via Docker Hub:
$ docker search parity/parity
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
parity/parity Parity is Ethcore's initial fully-featured... 0
parity/rust Rust stable, beta and nightly for GitLab C... 0 [OK]
parity/snapcraft Docker image for build snap application (U... 0 [OK]
parity/rust-arm RUST for GitLab CI runner (ARM architecture) 0 [OK]To get a list of available versions, use curl and jq:
$ curl -sS 'https://registry.hub.docker.com/v2/repositories/parity/parity/tags/' | jq '."results"[]["name"]' | sort
"nightly"
"v1.6.8"
"v1.6.9"
"v1.6.10"
"v1.7.0"To get the latest beta release, run:
$ docker pull parity/parity:v1.7.0To run Parity with an interactive pseudo-tty shell, run:
$ docker run -ti parity/parity:v1.7.0Parity can be configured using either the CLI options or a config file. Should the CLI flags and the config file disagree about a setting, the CLI takes precedence. You can list all CLI options by running:
$ docker run parity/parity:v1.7.0 --helpFor Docker specific options, please refer to the Docker documentation, or run docker --help or docker run --help.
To publish Parity's ports to the host machine, use the -p option:
$ docker run -ti -p 8180:8180 -p 8545:8545 -p 8546:8546 -p 30303:30303 -p 30303:30303/udp parity/parity:v1.7.0 --ui-interface all --jsonrpc-interface allFor example, this will expose the User Interface, the JSONRPC-API, and the listen port to the host. Now you can browse to http://localhost:8180 from the Docker host computer to access the Parity Wallet.
To enable external discovery where desired (for example for PoA sealing nodes), specify the external IP by appending the flag --nat extip:133.3.3.37, where 133.3.3.37 is to be replaced by your actual external IP of the host.
To pass further operating options to Parity, simply append them to the docker run command:
$ docker run -ti parity/parity:v1.7.0 --no-ui --no-dapps --no-discoveryIn this case, it disables the Wallet, the DApps Server, and discovery.
For more complex node configurations, a TOML config file can be created and attached to the docker container.
$ mkdir -p ~/.local/share/io.parity.ethereum/docker/
$ touch ~/.local/share/io.parity.ethereum/docker/config.tomlYou can use the Config File Generator to configure your Parity node and save it on your host's disk, i.e., at ~/.local/share/io.parity.ethereum/docker/config.toml. To mount the configuration, use the docker run -v option:
$ docker run -ti -v ~/.local/share/io.parity.ethereum/docker/:/root/.local/share/io.parity.ethereum/ parity/parity:v1.7.0 --config /root/.local/share/io.parity.ethereum/config.tomlThis will mount ~/.local/share/io.parity.ethereum/docker/ of the host machine at /root/.local/share/io.parity.ethereum/ inside the docker container. Therefore, the config file will be available via --config /root/.local/share/io.parity.ethereum/config.toml.
In case you need to persist the blockchain files, keys etc., you should run the image with the --base-path option and then mount it, e.g.:
$ docker run -ti -v ~/.local/share/io.parity.ethereum/docker/:/root/.local/share/io.parity.ethereum/ parity/parity:v1.7.0 --base-path /root/.local/share/io.parity.ethereum/
This will expose the whole data dir to the host machine at ~/.local/share/io.parity.ethereum/docker/.
To run a detached Parity instance, use docker run -d:
$ docker run -d parity/parity:v1.7.0
245f312f3f39ad0a518091b1ee4cdc0c1f6d74fb9609395ed3fdcf43acae4b62It will run Parity in background. docker ps shows the instance:
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
245f312f3f39 parity/parity:v1.7.0 "/parity/parity" 7 seconds ago Up 6 seconds 8080/tcp, 8180/tcp, 8545/tcp epic_pikeTo attach the container, use docker attach:
$ docker attach --sig-proxy=false 245f312f3f39Disabling the signature proxy allows to detach again with CTRL+C.
A Parity deployment script generator is available at paritytech/parity-deploy. It uses docker and docker-compose. On Ubuntu systems these will automatically be installed if not already present on the system.
Currently these scripts supports two types of chains, either instant sealing for development and authority round for proof of authority with multiple validators.
Some examples of using the script are:
-
A single node instant seal node, accessible via
127.0.0.1:8180:$ ./parity-deploy.sh --name testchain --config instantseal
-
A three node proof of authority chain (using the Aura consensus algorithm) with one client accessible via
127.0.0.1:8180:$ ./parity-deploy.sh --name testchain --config aura --nodes 3
Once the configuration is created you just need to run the docker-compose command to launch the machine or machines. This can be done via:
$ docker-compose up -dYou will then be able to see the logs by running:
$ docker-compose logs -f In these logs you should see a token being generated to login to parity. Alternatively you can run the command:
$ docker-compose logs | grep tokenOnce you are logged into the web interface if you go to Add Accounts, then select the option recovery phrase and enter the account recovery phrase as password. You now have an account with lots of ether to send around.
You can also include extra nodes (e.g. ethstats monitoring) by including the docker-compose configuration in include/docker-compose.yml. To add Ethstats monitoring you would need to include this in the file:
monitor:
image: buythewhale/ethstats_monitor
volumes:
- ./monitor/app.json:/home/ethnetintel/eth-net-intelligence-api/app.json:ro
dashboard:
image: buythewhale/ethstats
volumes:
- ./dashboard/ws_secret.json:/eth-netstats/ws_secret.json:ro
ports:
- 3001:3000
- Running a Parity Ethereum node in Docker and connect safely.
- How to quickly upgrade an Ethereum Parity node using Docker.
- Docker compose network with 3 authorities and netstats dashboard.
- Docker compose for running integration tests.
- Building Parity using Docker.
- Docker build for ARM64.
- Parity on Docker Hub.
- View the Dockerfile here.