0

I can find no documentation, nor even the original docker image file, for the cardano node docker images. We are trying to direct our node to connect to pre-production. Presumably there is a value for the NETWORK environment variable which corresponds to that.

Does anyone know where to fine an enumeration of all valid values for the NETWORK var?

For reference, I'm referring to this image: https://hub.docker.com/r/inputoutput/cardano-node

4 Answers 4

2

In my experience IOG's bash scripts, used for running cardano-node, are poorly documented and have poor error handling. I suggest running cardano-node directly with the relevant config files:

/usr/local/bin/cardano-node run --config $CARDANO_CONFIG --topology $CARDANO_TOPOLOGY --database-path $CARDANO_DATABASE_PATH --socket-path $CARDANO_NODE_SOCKET_PATH --host-addr 0.0.0.0 --port 3001

The relevant config files can be found here: https://book.world.dev.cardano.org/environments.html

Of course you would have to change the entrypoint of the docker image. For that I suggest creating a new Dockerfile that wraps inputoutput/cardano-node:latest:

# syntax=docker/dockerfile:1
FROM inputoutput/cardano-node:latest

RUN mkdir -p /data/preprod
RUN mkdir -p /ipc
 
COPY ./config.json /data/preprod/config.json
COPY ./topology.json /data/preprod/topology.json
COPY ./byron-genesis.json /data/preprod/byron-genesis.json
COPY ./shelley-genesis.json /data/preprod/shelley-genesis.json
COPY ./alonzo-genesis.json /data/preprod/alonzo-genesis.json

COPY ./entrypoint /usr/local/bin/entrypoint
RUN chmod +x /usr/local/bin/entrypoint
ENTRYPOINT ["bash", "/usr/local/bin/entrypoint"]

The entrypoint script should contain the first command I mentioned:

#!/bin/bash

export CARDANO_CONFIG=/data/preprod/config.json
export CARDANO_TOPOLOGY=/data/preprod/topology.json
export CARDANO_DATABASE_PATH=/data/preprod/db
export CARDANO_NODE_SOCKET_PATH=/ipc/node.socket

exec /usr/local/bin/cardano-node run --config $CARDANO_CONFIG --topology $CARDANO_TOPOLOGY --database-path $CARDANO_DATABASE_PATH --socket-path $CARDANO_NODE_SOCKET_PATH --host-addr 0.0.0.0 --port 3001

Finally build your image and run it:

docker build -t cardano-preprodnet .
docker run -d -v cardano-node-data:/data cardano-preprodnet

A github repo that does precisely what I described above can be found here: https://github.com/Hyperion-BT/cardano-node-wrappers (disclaimer: I am the creator)

1

I was able to verify and having using docker image cardano-node:1.35.3-configs you can use environment variable NETWORK=prepord

docker run -e NETWORK=preprod inputoutput/cardano-node:1.35.3-configs

0

I have seen invocations of this this -new docker image with environment variable NETWORK=preprod set in the #spo-public-testnet channel on IOGs discord. However I do not have any more documentation and would like to know more about it as well.

0

Check this out:

https://forum.cardano.org/t/how-i-run-cardano-node-in-docker/108328

That should give you idea how to run official IOHK docker images

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.