How to set up a Docker deployment
This guide will cover how to use Docker to deploy and run the Mintlayer node-daemon
and wallet-cli
.
Prerequisites #
You need to have Docker installed on your system. For Docker installation guide, please visit official Docker documentation.
Mintlayer Node-Daemon #
First, let’s pull the docker image for node-daemon
:
docker pull mintlayer/node-daemon:latest
Create a network for the containers to communicate:
docker network create mintlayer-net
To run the node-daemon
detached and on the testnet network:
docker run -d -p 3030:3030 -p 13031:13031 --network=mintlayer-net --name mintlayer_node_daemon -v ~/.mintlayer:/root/.mintlayer mintlayer/node-daemon:latest node-daemon testnet --http-rpc-addr 0.0.0.0:3030
The -v
option is used to mount a local directory (in this case ~/.mintlayer
) as a volume in the Docker container.
If you want to display logs you can pass the -e RUST_LOG=info
argument, such as:
docker run -p 3030:3030 -p 13031:13031 -v ~/.mintlayer:/root/.mintlayer -e RUST_LOG=info mintlayer/node-daemon:latest node-daemon testnet
Mintlayer Wallet-CLI #
Pull the docker image for wallet-cli
:
docker pull mintlayer/wallet-cli:latest
Before running wallet-cli
, ensure that the node-daemon
container is running, as it generates the .cookie
file required by wallet-cli, then find the IP address of the node:
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $(docker ps -aqf "name=mintlayer_node_daemon")
this will display the IP address of your node in the mintlayer-net
To run wallet-cli
with the RPC cookie file:
docker run -it --network=mintlayer-net -v ~/.mintlayer:/root/.mintlayer mintlayer/wallet-cli:latest wallet-cli --rpc-cookie-file /root/.mintlayer/<NETWORK>/.cookie --rpc-address <IP_ADDRESS>:3030
replace <NETWORK>
with mainnet
or testnet
depending on what network you’re running and <IP_ADDRESS>
with the result of the command above.
This command mounts the same ~/.mintlayer
directory as a volume in the wallet-cli
container and uses the --rpc-cookie-file
option to specify the path to the cookie file.