- Install Docker for Mac or Docker for Linux version
20.10.10
or newer - Be happy :)
A highly configurable Radix client image is implemented in Dockerfile. Configuration is done by means of environment variables passed to Docker containers at startup.
Different network setups are implemented in docker-compose files. (*.yml).
Ready to use configuration files are provided for 1-5 nodes: 1, 2, 3, 4 and 5 nodes. If configuration with other number of nodes is necessary, it can be generated using configuration generator.
Description below refers single node configuration. In order to run other configurations just replace docker/node-1.yml
with relative path to necessary configuration file.
In order to generate .yml
file for necessary number of nodes, just run following command
from docker/script
subdirectory:
$ ./generate-yml.sh <number of nodes>
Script will generate configuration file named node-<number of nodes>.yml
in the same directory
where other node-X.yml
files reside.
The Dockerfile depends on the radixdlt_*_all.deb
package which is built with:
$ ./gradlew deb4docker
$ docker-compose -f docker/node-1.yml up -d --build
To see the individual radixdlt
containers:
$ docker ps
$ docker-compose -f docker/node-1.yml down
docker-compose -f docker/node-1.yml logs -f
$ docker stats docker_explorer_1
$ docker exec -it docker_explorer_1 bash
$ docker exec docker_explorer_1 curl -s http://explorer:8080/api/system
The API port is not exported by default, so we go through one of the containers:
$ docker exec docker_explorer_1 curl -s 'http://validator:8080/api/atoms/spamathon?iterations=100000&rate=1000'
VisualVM is your friend.
The JMX
ports are exposed to ports 9010-90xx
on the docker host. Use docker ps
to find the specific JMX port you want to connect VisualVM to.
(The JMX host is thus localhost
).
Heapdumps don't work from VisualVM currently - the alternate is to use jmap, for example:
$ docker exec docker_explorer_1 jmap -dump:live,format=b,file=/tmp/radixdlt.hprof 1
$ docker cp docker_explorer_1:/tmp/radixdlt.hprof .
Ephemeral networks are supported by using the -p
argument with docker-compose
.
The Dockerfile depends on the radixdlt_*_all.deb
package which is built with:
$ ./gradlew deb4docker
Create an ephemeral network called test$BUILD_NUMBER
, in example test123
.
$ docker-compose -p test$BUILD_NUMBER -f docker/jenkins-network.yml up -d --build
$ docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' test${BUILD_NUMBER}_core0_1
$ for i in 0 1 2 3 4 5; do docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' test${BUILD_NUMBER}_core${i}_1; done
$ docker-compose -p test$BUILD_NUMBER -f docker/node-1.yml down