Skip to content

Instantly share code, notes, and snippets.

@ilya-korotya
Created December 9, 2021 10:02
Show Gist options
  • Save ilya-korotya/c611c3dc151eaf51a6cde7d27d802875 to your computer and use it in GitHub Desktop.
Save ilya-korotya/c611c3dc151eaf51a6cde7d27d802875 to your computer and use it in GitHub Desktop.
Docker for init private cardano network
FROM ubuntu:20.04
WORKDIR /cardano/private_network
RUN apt-get update && apt-get -y install wget
# source file here https://hydra.iohk.io/build/8110920
# TODO (illia-korotia): compare hash for pin version of tar.gz
RUN wget https://hydra.iohk.io/build/8110920/download/1/cardano-node-1.31.0-linux.tar.gz
# install required bin files
RUN tar -xvf cardano-node-1.31.0-linux.tar.gz -C /bin/
# create genesis keys for two nodes
RUN cardano-cli shelley genesis create --testnet-magic 42 --genesis-dir example/
RUN cardano-cli shelley genesis key-gen-genesis \
--verification-key-file example/genesis-keys/genesis1.vkey \
--signing-key-file example/genesis-keys/genesis1.skey
RUN cardano-cli shelley genesis key-gen-genesis \
--verification-key-file example/genesis-keys/genesis2.vkey \
--signing-key-file example/genesis-keys/genesis2.skey
# create delegate genesis keys for two nodes
RUN cardano-cli shelley genesis key-gen-delegate \
--verification-key-file example/delegate-keys/delegate1.vkey \
--signing-key-file example/delegate-keys/delegate1.skey \
--operational-certificate-issue-counter example/delegate-keys/delegate-opcert1.counter
RUN cardano-cli shelley genesis key-gen-delegate \
--verification-key-file example/delegate-keys/delegate2.vkey \
--signing-key-file example/delegate-keys/delegate2.skey \
--operational-certificate-issue-counter example/delegate-keys/delegate-opcert2.counter
# init first two utxo for init nodes
RUN cardano-cli shelley genesis key-gen-utxo \
--verification-key-file example/utxo-keys/utxo1.vkey \
--signing-key-file example/utxo-keys/utxo1.skey
RUN cardano-cli shelley genesis key-gen-utxo \
--verification-key-file example/utxo-keys/utxo2.vkey \
--signing-key-file example/utxo-keys/utxo2.skey
# create to VRF keys
RUN cardano-cli shelley node key-gen-VRF \
--verification-key-file example/delegate-keys/delegate1.vrf.vkey \
--signing-key-file example/delegate-keys/delegate1.vrf.skey
RUN cardano-cli shelley node key-gen-VRF \
--verification-key-file example/delegate-keys/delegate2.vrf.vkey \
--signing-key-file example/delegate-keys/delegate2.vrf.skey
# Recreate genesis file for new set up
RUN cardano-cli shelley genesis create --testnet-magic 42 --genesis-dir example/
# Add currency to network
RUN cardano-cli shelley genesis create \
--testnet-magic 42 \
--genesis-dir example/ \
--supply 1000000
# Create KES keys for nodes
RUN mkdir example/node1 && mkdir example/node2
RUN cardano-cli shelley node key-gen-KES \
--verification-key-file example/node1/kes.vkey \
--signing-key-file example/node1/kes.skey
RUN cardano-cli shelley node key-gen-KES \
--verification-key-file example/node2/kes.vkey \
--signing-key-file example/node2/kes.skey
# Create VRF keys for nodex
# Skip already created
# Create cert for each node
RUN cardano-cli shelley node issue-op-cert \
--kes-verification-key-file example/node1/kes.vkey \
--cold-signing-key-file example/delegate-keys/delegate1.skey \
--operational-certificate-issue-counter example/delegate-keys/delegate-opcert1.counter \
--kes-period 0 \
--out-file example/node1/cert
RUN cardano-cli shelley node issue-op-cert \
--kes-verification-key-file example/node2/kes.vkey \
--cold-signing-key-file example/delegate-keys/delegate2.skey \
--operational-certificate-issue-counter example/delegate-keys/delegate-opcert2.counter \
--kes-period 0 \
--out-file example/node2/cert
ENTRYPOINT ["tail", "-f", "/dev/null"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment