Docker image to run a full Solarcoin node
50K+
The image is set up so that by default it runs the solarcoind command with a data directory /solarcoin. On the first run a solarcoin.conf file is created with a random rpcpassword.
The simplest way to run solarcoind in a container is the following:
$ docker run --detach --name solarcoin-node pmiklos/solarcoind
To stop the container run the command below:
$ docker stop solarcoin-node
You can start it again with
$ docker start solarcoin-node
And delete it with
$ docker rm solarcoin-node
Although you can use the commands above run solarcoind in a new contrainer, the wallet and the solarcoin database would be created in an unnamed volume automatically by docker. A better approach is to create a named volume first and mount it to the /solarcoin directory when creating the container.
$ docker volume create solarcoin-data
Then start a new container with the volume attached:
$ docker run --detach --name solarcoin-node --volume solarcoin-data:/solarcoin pmiklos/solarcoind
Print out the configuration file:
$ docker run -it --rm -v solarcoin-data:/solarcoin pmiklos/solarcoind cat solarcoin.conf
or if you have a running container:
$ docker exec solarcoin-node cat solarcoin.conf
The docker image creates the a solarcoin.conf file with an RPC server enabled (listen=1) on the default port (18181), however, it is not accessible outside the docker container unless you publish it on a port when creating the container. To do so, use the following command:
$ docker run --detach --name solarcoin-node --volume solarcoin-data:/solarcoin --publish 18181:18181 pmiklos/solarcoind
Accessing the JSON RPC interface (the rpc password is visible in the solarcoind.conf, see above):
$ curl -v --user solarcoinrpc --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getinfo", "params": [] }' -H 'content-type: text/plain;' localhost:18181
Note that by default the allowed rpc IP address range is set to 172.* which is the docker networking ip range. It is not recommended to enable RPC other than localhost access because the username and password is sent in a http clear text.
Content type
Image
Digest
sha256:9b16f5a54…
Size
269.8 MB
Last updated
over 3 years ago
docker pull pmiklos/solarcoind