├── .dockerignore ├── .gitignore ├── .gitmodules ├── Dockerfile.addresses ├── Dockerfile.bech32 ├── Dockerfile.cncli ├── Dockerfile.mithril-client ├── Dockerfile.mithril-signer ├── Dockerfile.node ├── Dockerfile.pool ├── README.md ├── build.sh ├── build_arm.sh ├── cfg-templates ├── main │ ├── VARS │ ├── alonzo-genesis.json │ ├── byron-genesis.json │ ├── config.json │ ├── conway-genesis.json │ ├── db-sync-config.json │ ├── mithril_config.json │ ├── rest-config.json │ ├── shelley-genesis.json │ ├── topology-relay-p2p.json │ ├── topology-relay.json │ └── topology.json ├── preview │ ├── VARS │ ├── alonzo-genesis.json │ ├── byron-genesis.json │ ├── config-bp.json │ ├── config.json │ ├── conway-genesis.json │ ├── db-sync-config.json │ ├── shelley-genesis.json │ ├── submit-api-config.json │ └── topology.json └── test │ ├── VARS │ ├── alonzo-genesis.json │ ├── byron-genesis.json │ ├── config.json │ ├── shelley-genesis.json │ ├── topology-relay-p2p.json │ ├── topology-relay.json │ └── topology.json ├── examples ├── main-producing.sh ├── main-registration.sh ├── main-relay1.sh ├── metadata.json └── test │ └── docker-compose.yaml ├── monitoring ├── README.md ├── nginx │ ├── Dockerfile │ ├── README.md │ ├── build.sh │ ├── entrypoint.sh │ └── nginx.tmpl.conf └── prometheus │ ├── Dockerfile │ ├── README.md │ ├── build.sh │ ├── config.tmpl.yml │ ├── config.yml │ ├── entrypoint.sh │ ├── init_config.py │ └── requirements.txt └── scripts ├── cexplorer_pool_stats ├── cold_create ├── cold_create_new ├── cold_register ├── create_stakepool ├── deregister_stake_address ├── download_db_snapshot ├── every_five_days ├── functions ├── check_address_registration ├── check_balance ├── check_kes_status ├── check_pool_registration ├── create_and_register_pool ├── current_epoch ├── ensure_cron_running ├── get_block ├── get_protocol ├── get_public_ip ├── get_slot ├── info_pane ├── init_config ├── node_info ├── run_node ├── run_stakingnode ├── stakepool_info ├── status ├── sync_status ├── validations ├── wait_for_address_registration ├── wait_for_file ├── wait_for_pool_registration ├── wait_for_slot ├── wait_for_socket └── wait_for_sync ├── generate_operational_certificate ├── generate_registration_certificates ├── generate_wallet ├── generate_wallet_old ├── get_topology_str.py ├── guild ├── env └── gLiveView.sh ├── init_config.py ├── init_node_vars ├── leaderlogs ├── leaderlogs_cncli ├── logging_vars ├── mithril ├── generate_mithril_config ├── run_mithril └── verify_signer_registration.sh ├── register_stake_address ├── register_stake_pool ├── request_faucet.sh ├── send_ada ├── send_lovelace_utxo ├── send_slots ├── setup_bashrc ├── start-cardano-node ├── start-stakenode ├── test_run ├── topology_submit ├── topology_update ├── wallet_balance └── withdraw_rewards /.dockerignore: -------------------------------------------------------------------------------- 1 | .git 2 | examples/ 3 | rsync.sh -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | config/ 2 | .DS_Store 3 | /rsync.sh 4 | *.pyc 5 | __pycache__ 6 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "scripts/pooltool.io"] 2 | path = scripts/pooltool.io 3 | url = ../../papacarp/pooltool.io 4 | -------------------------------------------------------------------------------- /Dockerfile.addresses: -------------------------------------------------------------------------------- 1 | FROM haskell:9.8.4 AS build 2 | WORKDIR /build 3 | RUN apt-get update && apt-get install --no-install-recommends -y build-essential git 4 | RUN stack upgrade 5 | 6 | # Install cardano-addresses 7 | ARG VERSION 8 | RUN echo "Building tags/$VERSION..." \ 9 | && git clone https://github.com/IntersectMBO/cardano-addresses \ 10 | && cd cardano-addresses \ 11 | && git fetch --all --recurse-submodules --tags \ 12 | && git tag \ 13 | && git checkout tags/$VERSION \ 14 | && cabal update \ 15 | && cabal build all \ 16 | && cabal build cardano-addresses 17 | RUN cd cardano-addresses \ 18 | && cabal install cardano-addresses \ 19 | && cp -L /root/.local/bin/cardano-address /tmp/cardano-address 20 | 21 | # Run 22 | FROM debian:stable-slim 23 | COPY --from=build /tmp/cardano-address /bin/cardano-address 24 | RUN mkdir /etc/bash_completion.d 25 | RUN cardano-address --bash-completion-script `which cardano-address` > /etc/bash_completion.d/cardano-address 26 | RUN echo "source /etc/bash_completion.d/cardano-address" >> ~/.bashrc 27 | RUN echo "cardano-address --help" >> ~/.bashrc 28 | 29 | ENTRYPOINT ["cardano-address"] -------------------------------------------------------------------------------- /Dockerfile.bech32: -------------------------------------------------------------------------------- 1 | FROM haskell:9.8.2-slim AS build 2 | WORKDIR /build 3 | RUN apt-get update && apt-get install --no-install-recommends -y build-essential git 4 | RUN stack upgrade 5 | 6 | # Install bech32 7 | ARG VERSION 8 | RUN echo "Building tags/v$VERSION..." \ 9 | && git clone https://github.com/IntersectMBO/bech32 \ 10 | && cd bech32 \ 11 | && git fetch --all --recurse-submodules --tags \ 12 | && git tag \ 13 | && git checkout tags/v$VERSION 14 | 15 | RUN stack setup --install-ghc \ 16 | && stack init \ 17 | && stack build \ 18 | && stack install --flag bech32:release 19 | 20 | # Run 21 | FROM frolvlad/alpine-glibc:alpine-3.11_glibc-2.30 22 | RUN apk add --no-cache gmp=6.1.2-r1 bash=5.0.11-r1 bash-completion=2.9-r0 23 | COPY --from=build /root/.local/bin /bin 24 | 25 | ENTRYPOINT ["bech32"] -------------------------------------------------------------------------------- /Dockerfile.cncli: -------------------------------------------------------------------------------- 1 | FROM debian:stable-slim AS build 2 | 3 | # Install build dependencies 4 | RUN apt-get update -y \ 5 | && apt-get install -y automake build-essential pkg-config libffi-dev libgmp-dev libssl-dev libtinfo-dev libsystemd-dev zlib1g-dev make g++ tmux git jq wget libncursesw5 libtool autoconf musl-tools \ 6 | && apt-get install -y libsqlite3-dev m4 ca-certificates gcc libc6-dev curl \ 7 | && apt-get clean 8 | 9 | # Install rust 10 | ENV RUSTUP_HOME=/usr/local/rustup \ 11 | CARGO_HOME=/usr/local/cargo \ 12 | PATH=/usr/local/cargo/bin:$PATH 13 | 14 | RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y 15 | RUN cat /usr/local/cargo/env 16 | RUN rustup install stable \ 17 | && rustup default stable \ 18 | && rustup update \ 19 | && rustup component add clippy rustfmt \ 20 | && rustup target add x86_64-unknown-linux-musl 21 | 22 | 23 | # Install cncli 24 | ARG VERSION 25 | RUN echo "Building tags/v$VERSION..." \ 26 | && git clone --recurse-submodules https://github.com/cardano-community/cncli \ 27 | && cd cncli \ 28 | && git fetch --all --recurse-submodules --tags \ 29 | && git tag \ 30 | && git checkout tags/v$VERSION \ 31 | && cargo install --path . --force \ 32 | && cncli --version 33 | 34 | # Run 35 | FROM arradev/cardano-node:latest AS node 36 | 37 | FROM debian:stable-slim 38 | SHELL ["/bin/bash", "-c"] 39 | 40 | # Install dependencies 41 | RUN apt-get update -y \ 42 | && apt-get install -y openssl \ 43 | && apt-get clean 44 | 45 | # Install compiled files 46 | COPY --from=build /usr/local/cargo/bin/cncli /bin/cncli 47 | 48 | ENTRYPOINT ["cncli"] 49 | -------------------------------------------------------------------------------- /Dockerfile.mithril-client: -------------------------------------------------------------------------------- 1 | FROM rust:slim AS build 2 | 3 | RUN apt-get update -y \ 4 | && apt-get install --no-install-recommends -y libssl-dev make build-essential git m4 jq pkg-config 5 | 6 | ARG VERSION 7 | RUN echo "Building tags/v$VERSION..." \ 8 | && git clone https://github.com/input-output-hk/mithril.git \ 9 | && cd mithril/mithril-client-cli \ 10 | && git fetch --all --tags \ 11 | && git tag \ 12 | && git checkout tags/$VERSION \ 13 | && make build 14 | 15 | # Run 16 | FROM debian:stable-slim 17 | 18 | RUN apt-get update -y \ 19 | && apt-get install --no-install-recommends -y ca-certificates 20 | 21 | COPY --from=build /mithril/mithril-client-cli/mithril-client /bin/mithril-client 22 | 23 | ENTRYPOINT ["mithril-client"] 24 | -------------------------------------------------------------------------------- /Dockerfile.mithril-signer: -------------------------------------------------------------------------------- 1 | FROM rust:slim AS build 2 | 3 | RUN apt-get update -y \ 4 | && apt-get install --no-install-recommends -y libssl-dev make build-essential git m4 jq pkg-config 5 | 6 | ARG VERSION 7 | RUN echo "Building tags/v$VERSION..." \ 8 | && git clone https://github.com/input-output-hk/mithril.git \ 9 | && cd mithril/mithril-signer \ 10 | && git fetch --all --tags \ 11 | && git tag \ 12 | && git checkout tags/$VERSION \ 13 | && make build 14 | 15 | # Run 16 | FROM arradev/cardano-node:latest AS node 17 | FROM debian:stable-slim 18 | 19 | RUN apt-get update -y \ 20 | && apt-get install --no-install-recommends -y ca-certificates jq curl 21 | 22 | ENV NODE_PATH=/config/cardano-node/ \ 23 | RELAY_ENDPOINT=0.0.0.0 24 | EXPOSE 3132 25 | 26 | COPY --from=build /mithril/mithril-signer/mithril-signer /bin/mithril-signer 27 | COPY --from=node /bin/cardano* /bin/ 28 | COPY --from=node /lib/libsodium* /lib/ 29 | COPY --from=node /lib/libsecp256k1* /lib/ 30 | COPY scripts/mithril/* /bin/ 31 | RUN chmod +x /bin/generate_mithril_config /bin/run_mithril /bin/verify_signer_registration.sh 32 | 33 | ENTRYPOINT ["run_mithril"] 34 | -------------------------------------------------------------------------------- /Dockerfile.node: -------------------------------------------------------------------------------- 1 | FROM debian:stable-slim AS build 2 | 3 | # Install build dependencies 4 | RUN apt-get update -y \ 5 | && apt-get install automake build-essential pkg-config libffi-dev libgmp-dev libssl-dev libtinfo-dev libsystemd-dev zlib1g-dev make g++ tmux git jq wget libncursesw5 libtool autoconf liblmdb-dev -y \ 6 | && apt-get install -y libsqlite3-dev m4 ca-certificates gcc libc6-dev curl \ 7 | && apt-get clean 8 | 9 | # Install GHC 10 | ENV CABAL_VERSION=3.12.1.0 \ 11 | GHC_VERSION=9.6.7 \ 12 | PATH="$HOME/.cabal/bin:/root/.ghcup/bin:$PATH" 13 | RUN curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh \ 14 | && ghcup install ghc ${GHC_VERSION} \ 15 | && ghcup install cabal ${CABAL_VERSION} \ 16 | && ghcup set ghc ${GHC_VERSION} \ 17 | && ghcup set cabal ${CABAL_VERSION} 18 | 19 | # Install libsodium 20 | ARG LIBSODIUM_VERSION 21 | RUN git clone https://github.com/intersectmbo/libsodium \ 22 | && cd libsodium \ 23 | && git checkout $LIBSODIUM_VERSION \ 24 | && ./autogen.sh \ 25 | && ./configure \ 26 | && make \ 27 | && make install \ 28 | && cd .. && rm -rf libsodium 29 | ENV LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH" \ 30 | PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH" 31 | 32 | # Install Secp256k1 33 | RUN git clone https://github.com/bitcoin-core/secp256k1 \ 34 | && cd secp256k1 \ 35 | && git checkout ac83be33 \ 36 | && ./autogen.sh \ 37 | && ./configure --enable-module-schnorrsig --enable-experimental \ 38 | && make && make install 39 | 40 | # Install blst 41 | COPY <<"EOT" /usr/local/lib/pkgconfig/libblst.pc 42 | prefix=/usr/local 43 | exec_prefix=\${prefix} 44 | libdir=\${exec_prefix}/lib 45 | includedir=\${prefix}/include 46 | 47 | Name: libblst 48 | Description: Multilingual BLS12-381 signature library 49 | URL: https://github.com/supranational/blst 50 | Version: 0.3.10 51 | Cflags: -I\${includedir} 52 | Libs: -L\${libdir} -lblst 53 | EOT 54 | RUN git clone https://github.com/supranational/blst \ 55 | && cd blst \ 56 | && git checkout v0.3.11 \ 57 | && ./build.sh \ 58 | && cp bindings/blst_aux.h bindings/blst.h bindings/blst.hpp /usr/local/include/ \ 59 | && cp libblst.a /usr/local/lib \ 60 | && chmod u=rw,go=r /usr/local/lib/libblst.a \ 61 | && chmod u=rw,go=r /usr/local/lib/pkgconfig/libblst.pc \ 62 | && chmod u=rw,go=r /usr/local/include/blst.h \ 63 | && chmod u=rw,go=r /usr/local/include/blst.hpp \ 64 | && chmod u=rw,go=r /usr/local/include/blst_aux.h 65 | 66 | # Install cardano-node 67 | ARG VERSION 68 | RUN echo "Building tags/${VERSION}..." \ 69 | && echo tags/${VERSION} > /CARDANO_BRANCH \ 70 | && git clone https://github.com/IntersectMBO/cardano-node \ 71 | && cd cardano-node \ 72 | && git fetch --all --recurse-submodules --tags \ 73 | && git tag | sort -V \ 74 | && git checkout tags/${VERSION} \ 75 | && echo "with-compiler: ghc-${GHC_VERSION}" >> cabal.project.local \ 76 | && echo "package cardano-crypto-praos" >> cabal.project.local \ 77 | && echo " flags: -external-libsodium-vrf" >> cabal.project.local \ 78 | && cabal update \ 79 | && cabal build all \ 80 | && cabal build cardano-cli \ 81 | && mkdir -p /root/.local/bin/ \ 82 | && cp -p "$(./scripts/bin-path.sh cardano-node)" /root/.local/bin/ \ 83 | && cp -p "$(./scripts/bin-path.sh cardano-cli)" /root/.local/bin/ \ 84 | && cd .. && rm -rf cardano-node 85 | 86 | # Run 87 | FROM debian:stable-slim 88 | 89 | COPY --from=build /root/.local/bin/ /bin/ 90 | COPY --from=build /usr/local/lib/ /lib/ 91 | 92 | SHELL ["/bin/bash", "-c"] 93 | 94 | ENTRYPOINT ["cardano-node"] 95 | -------------------------------------------------------------------------------- /Dockerfile.pool: -------------------------------------------------------------------------------- 1 | FROM arradev/cardano-node:latest AS node 2 | FROM arradev/cardano-addresses:latest AS addresses 3 | FROM arradev/bech32:latest AS bech32 4 | FROM arradev/cncli:latest AS cncli 5 | FROM arradev/mithril-client:latest AS mithril-client 6 | FROM debian:stable-slim 7 | LABEL maintainer="droe@pm.me" 8 | 9 | SHELL ["/bin/bash", "-c"] 10 | WORKDIR / 11 | 12 | # Install tools 13 | RUN apt-get update -y \ 14 | && apt-get install -y libssl-dev vim procps dnsutils bc curl nano cron python3 python3-pip tmux jq wget lsof iproute2 \ 15 | && apt-get clean 16 | RUN rm /usr/lib/python3.11/EXTERNALLY-MANAGED && pip3 install pytz 17 | 18 | # Copy compiled binaries 19 | COPY --from=node /bin/cardano* /bin/ 20 | COPY --from=node /lib/libsodium* /lib/ 21 | COPY --from=node /lib/libsecp256k1* /lib/ 22 | COPY --from=cncli /bin/cncli /bin/ 23 | COPY --from=addresses /bin/cardano-address /bin/ 24 | COPY --from=bech32 /bin/bech32 /bin/ 25 | COPY --from=mithril-client /bin/mithril-client /bin/ 26 | 27 | # Expose ports 28 | ## cardano-node, EKG, Prometheus 29 | EXPOSE 3000 12788 12798 30 | 31 | # ENV variables 32 | ENV NODE_PORT="3000" \ 33 | NODE_NAME="node1" \ 34 | NODE_TOPOLOGY="" \ 35 | NODE_RELAY="False" \ 36 | CARDANO_NETWORK="main" \ 37 | EKG_PORT="12788" \ 38 | PROMETHEUS_PORT="12798" \ 39 | RESOLVE_HOSTNAMES="False" \ 40 | REPLACE_EXISTING_CONFIG="False" \ 41 | POOL_TICKER="" \ 42 | POOL_PLEDGE="100000000000" \ 43 | POOL_COST="10000000000" \ 44 | POOL_MARGIN="0.05" \ 45 | AUTO_TOPOLOGY="True" \ 46 | HOSTNAME="" \ 47 | METADATA_URL="" \ 48 | PUBLIC_RELAY_IP="TOPOLOGY" \ 49 | PUBLIC_RELAY_HOSTS="" \ 50 | WAIT_FOR_SYNC="True" \ 51 | PATH="/root/.local/bin/:/scripts/:/scripts/functions/:/cardano-node/scripts/:${PATH}" \ 52 | LD_LIBRARY_PATH="/usr/local/lib" \ 53 | CARDANO_NODE_SOCKET_PATH="DEFAULT" \ 54 | CNCLI_SYNC="True" \ 55 | STATUS_PANEL="False" \ 56 | PT_API_KEY="" \ 57 | PT_SENDTIP="False" \ 58 | PT_SENDSLOTS="False" \ 59 | LANG="C.UTF-8" \ 60 | ENABLEP2P="False" 61 | 62 | # Add config 63 | ADD cfg-templates/ /cfg-templates/ 64 | RUN mkdir -p /config/ 65 | VOLUME /config/ 66 | 67 | # Add scripts 68 | ADD scripts/ /scripts/ 69 | RUN chmod -R +x /scripts/ 70 | 71 | ENTRYPOINT ["/scripts/start-cardano-node"] 72 | -------------------------------------------------------------------------------- /build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | MITHRIL_VERSION="2517.1" 4 | NODE_VERSION="10.3.1" 5 | LIBSODIUM_VERSION="dbb48cc" 6 | ADDRESSES_VERSION="4.0.0" 7 | BECH_VERSION="1.1.7" 8 | CNCLI_VERSION="6.5.1" 9 | POOL_VERSION="10.3.1" 10 | 11 | docker build -f Dockerfile.node \ 12 | --build-arg VERSION=${NODE_VERSION} \ 13 | --tag arradev/cardano-node:${NODE_VERSION} \ 14 | --tag arradev/cardano-node:latest . 15 | 16 | docker build -f Dockerfile.mithril-client \ 17 | --build-arg VERSION=${MITHRIL_VERSION} \ 18 | --tag arradev/mithril-client:${MITHRIL_VERSION} \ 19 | --tag arradev/mithril-client:latest . 20 | 21 | docker build -f Dockerfile.mithril-signer \ 22 | --build-arg VERSION=${MITHRIL_VERSION} \ 23 | --tag arradev/mithril-signer:${MITHRIL_VERSION} \ 24 | --tag arradev/mithril-signer:latest . 25 | 26 | docker build -f Dockerfile.addresses \ 27 | --build-arg VERSION=${ADDRESSES_VERSION} \ 28 | --tag arradev/cardano-addresses:${ADDRESSES_VERSION} \ 29 | --tag arradev/cardano-addresses:latest . 30 | 31 | docker build -f Dockerfile.bech32 \ 32 | --build-arg VERSION=${BECH_VERSION} \ 33 | --tag arradev/bech32:${BECH_VERSION} \ 34 | --tag arradev/bech32:latest . 35 | 36 | docker build -f Dockerfile.cncli \ 37 | --build-arg VERSION=${CNCLI_VERSION} \ 38 | --tag arradev/cncli:${CNCLI_VERSION} \ 39 | --tag arradev/cncli:latest . 40 | 41 | docker build -f Dockerfile.pool \ 42 | --build-arg NODE_VERSION=${NODE_VERSION} \ 43 | --tag arradev/cardano-pool:${POOL_VERSION} \ 44 | --tag arradev/cardano-pool:latest . -------------------------------------------------------------------------------- /build_arm.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | NODE_VERSION="8.7.2" 4 | LIBSODIUM_VERSION="dbb48cc" 5 | ADDRESSES_VERSION="3.12.0" 6 | BECH_VERSION="1.1.4" 7 | CNCLI_VERSION="5.3.2" 8 | POOL_VERSION="8.7.2" 9 | 10 | docker buildx build --platform linux/arm64 -f Dockerfile.node \ 11 | --build-arg VERSION=${NODE_VERSION} \ 12 | --tag arradev/cardano-node:${NODE_VERSION} \ 13 | --tag arradev/cardano-node:latest . 14 | 15 | docker buildx build --platform linux/arm64 -f Dockerfile.addresses \ 16 | --build-arg VERSION=${ADDRESSES_VERSION} \ 17 | --tag arradev/cardano-addresses:${ADDRESSES_VERSION} \ 18 | --tag arradev/cardano-addresses:latest . 19 | 20 | docker buildx build --platform linux/arm64 -f Dockerfile.bech32 \ 21 | --build-arg VERSION=${BECH_VERSION} \ 22 | --tag arradev/bech32:${BECH_VERSION} \ 23 | --tag arradev/bech32:latest . 24 | 25 | docker buildx build --platform linux/arm64 -f Dockerfile.cncli \ 26 | --build-arg VERSION=${CNCLI_VERSION} \ 27 | --tag arradev/cncli:${CNCLI_VERSION} \ 28 | --tag arradev/cncli:latest . 29 | 30 | docker buildx build --platform linux/arm64 -f Dockerfile.pool \ 31 | --build-arg NODE_VERSION=${NODE_VERSION} \ 32 | --tag arradev/cardano-pool:${POOL_VERSION} \ 33 | --tag arradev/cardano-pool:latest . 34 | 35 | 36 | -------------------------------------------------------------------------------- /cfg-templates/main/VARS: -------------------------------------------------------------------------------- 1 | export NETWORK_ARGUMENT="--mainnet" 2 | export NETWORK_TAG=1 3 | export HARDFORK_EPOCH=208 4 | -------------------------------------------------------------------------------- /cfg-templates/main/alonzo-genesis.json: -------------------------------------------------------------------------------- 1 | { 2 | "lovelacePerUTxOWord": 34482, 3 | "executionPrices": { 4 | "prSteps": 5 | { 6 | "numerator" : 721, 7 | "denominator" : 10000000 8 | }, 9 | "prMem": 10 | { 11 | "numerator" : 577, 12 | "denominator" : 10000 13 | } 14 | }, 15 | "maxTxExUnits": { 16 | "exUnitsMem": 10000000, 17 | "exUnitsSteps": 10000000000 18 | }, 19 | "maxBlockExUnits": { 20 | "exUnitsMem": 50000000, 21 | "exUnitsSteps": 40000000000 22 | }, 23 | "maxValueSize": 5000, 24 | "collateralPercentage": 150, 25 | "maxCollateralInputs": 3, 26 | "costModels": { 27 | "PlutusV1": { 28 | "sha2_256-memory-arguments": 4, 29 | "equalsString-cpu-arguments-constant": 1000, 30 | "cekDelayCost-exBudgetMemory": 100, 31 | "lessThanEqualsByteString-cpu-arguments-intercept": 103599, 32 | "divideInteger-memory-arguments-minimum": 1, 33 | "appendByteString-cpu-arguments-slope": 621, 34 | "blake2b-cpu-arguments-slope": 29175, 35 | "iData-cpu-arguments": 150000, 36 | "encodeUtf8-cpu-arguments-slope": 1000, 37 | "unBData-cpu-arguments": 150000, 38 | "multiplyInteger-cpu-arguments-intercept": 61516, 39 | "cekConstCost-exBudgetMemory": 100, 40 | "nullList-cpu-arguments": 150000, 41 | "equalsString-cpu-arguments-intercept": 150000, 42 | "trace-cpu-arguments": 150000, 43 | "mkNilData-memory-arguments": 32, 44 | "lengthOfByteString-cpu-arguments": 150000, 45 | "cekBuiltinCost-exBudgetCPU": 29773, 46 | "bData-cpu-arguments": 150000, 47 | "subtractInteger-cpu-arguments-slope": 0, 48 | "unIData-cpu-arguments": 150000, 49 | "consByteString-memory-arguments-intercept": 0, 50 | "divideInteger-memory-arguments-slope": 1, 51 | "divideInteger-cpu-arguments-model-arguments-slope": 118, 52 | "listData-cpu-arguments": 150000, 53 | "headList-cpu-arguments": 150000, 54 | "chooseData-memory-arguments": 32, 55 | "equalsInteger-cpu-arguments-intercept": 136542, 56 | "sha3_256-cpu-arguments-slope": 82363, 57 | "sliceByteString-cpu-arguments-slope": 5000, 58 | "unMapData-cpu-arguments": 150000, 59 | "lessThanInteger-cpu-arguments-intercept": 179690, 60 | "mkCons-cpu-arguments": 150000, 61 | "appendString-memory-arguments-intercept": 0, 62 | "modInteger-cpu-arguments-model-arguments-slope": 118, 63 | "ifThenElse-cpu-arguments": 1, 64 | "mkNilPairData-cpu-arguments": 150000, 65 | "lessThanEqualsInteger-cpu-arguments-intercept": 145276, 66 | "addInteger-memory-arguments-slope": 1, 67 | "chooseList-memory-arguments": 32, 68 | "constrData-memory-arguments": 32, 69 | "decodeUtf8-cpu-arguments-intercept": 150000, 70 | "equalsData-memory-arguments": 1, 71 | "subtractInteger-memory-arguments-slope": 1, 72 | "appendByteString-memory-arguments-intercept": 0, 73 | "lengthOfByteString-memory-arguments": 4, 74 | "headList-memory-arguments": 32, 75 | "listData-memory-arguments": 32, 76 | "consByteString-cpu-arguments-intercept": 150000, 77 | "unIData-memory-arguments": 32, 78 | "remainderInteger-memory-arguments-minimum": 1, 79 | "bData-memory-arguments": 32, 80 | "lessThanByteString-cpu-arguments-slope": 248, 81 | "encodeUtf8-memory-arguments-intercept": 0, 82 | "cekStartupCost-exBudgetCPU": 100, 83 | "multiplyInteger-memory-arguments-intercept": 0, 84 | "unListData-memory-arguments": 32, 85 | "remainderInteger-cpu-arguments-model-arguments-slope": 118, 86 | "cekVarCost-exBudgetCPU": 29773, 87 | "remainderInteger-memory-arguments-slope": 1, 88 | "cekForceCost-exBudgetCPU": 29773, 89 | "sha2_256-cpu-arguments-slope": 29175, 90 | "equalsInteger-memory-arguments": 1, 91 | "indexByteString-memory-arguments": 1, 92 | "addInteger-memory-arguments-intercept": 1, 93 | "chooseUnit-cpu-arguments": 150000, 94 | "sndPair-cpu-arguments": 150000, 95 | "cekLamCost-exBudgetCPU": 29773, 96 | "fstPair-cpu-arguments": 150000, 97 | "quotientInteger-memory-arguments-minimum": 1, 98 | "decodeUtf8-cpu-arguments-slope": 1000, 99 | "lessThanInteger-memory-arguments": 1, 100 | "lessThanEqualsInteger-cpu-arguments-slope": 1366, 101 | "fstPair-memory-arguments": 32, 102 | "modInteger-memory-arguments-intercept": 0, 103 | "unConstrData-cpu-arguments": 150000, 104 | "lessThanEqualsInteger-memory-arguments": 1, 105 | "chooseUnit-memory-arguments": 32, 106 | "sndPair-memory-arguments": 32, 107 | "addInteger-cpu-arguments-intercept": 197209, 108 | "decodeUtf8-memory-arguments-slope": 8, 109 | "equalsData-cpu-arguments-intercept": 150000, 110 | "mapData-cpu-arguments": 150000, 111 | "mkPairData-cpu-arguments": 150000, 112 | "quotientInteger-cpu-arguments-constant": 148000, 113 | "consByteString-memory-arguments-slope": 1, 114 | "cekVarCost-exBudgetMemory": 100, 115 | "indexByteString-cpu-arguments": 150000, 116 | "unListData-cpu-arguments": 150000, 117 | "equalsInteger-cpu-arguments-slope": 1326, 118 | "cekStartupCost-exBudgetMemory": 100, 119 | "subtractInteger-cpu-arguments-intercept": 197209, 120 | "divideInteger-cpu-arguments-model-arguments-intercept": 425507, 121 | "divideInteger-memory-arguments-intercept": 0, 122 | "cekForceCost-exBudgetMemory": 100, 123 | "blake2b-cpu-arguments-intercept": 2477736, 124 | "remainderInteger-cpu-arguments-constant": 148000, 125 | "tailList-cpu-arguments": 150000, 126 | "encodeUtf8-cpu-arguments-intercept": 150000, 127 | "equalsString-cpu-arguments-slope": 1000, 128 | "lessThanByteString-memory-arguments": 1, 129 | "multiplyInteger-cpu-arguments-slope": 11218, 130 | "appendByteString-cpu-arguments-intercept": 396231, 131 | "lessThanEqualsByteString-cpu-arguments-slope": 248, 132 | "modInteger-memory-arguments-slope": 1, 133 | "addInteger-cpu-arguments-slope": 0, 134 | "equalsData-cpu-arguments-slope": 10000, 135 | "decodeUtf8-memory-arguments-intercept": 0, 136 | "chooseList-cpu-arguments": 150000, 137 | "constrData-cpu-arguments": 150000, 138 | "equalsByteString-memory-arguments": 1, 139 | "cekApplyCost-exBudgetCPU": 29773, 140 | "quotientInteger-memory-arguments-slope": 1, 141 | "verifySignature-cpu-arguments-intercept": 3345831, 142 | "unMapData-memory-arguments": 32, 143 | "mkCons-memory-arguments": 32, 144 | "sliceByteString-memory-arguments-slope": 1, 145 | "sha3_256-memory-arguments": 4, 146 | "ifThenElse-memory-arguments": 1, 147 | "mkNilPairData-memory-arguments": 32, 148 | "equalsByteString-cpu-arguments-slope": 247, 149 | "appendString-cpu-arguments-intercept": 150000, 150 | "quotientInteger-cpu-arguments-model-arguments-slope": 118, 151 | "cekApplyCost-exBudgetMemory": 100, 152 | "equalsString-memory-arguments": 1, 153 | "multiplyInteger-memory-arguments-slope": 1, 154 | "cekBuiltinCost-exBudgetMemory": 100, 155 | "remainderInteger-memory-arguments-intercept": 0, 156 | "sha2_256-cpu-arguments-intercept": 2477736, 157 | "remainderInteger-cpu-arguments-model-arguments-intercept": 425507, 158 | "lessThanEqualsByteString-memory-arguments": 1, 159 | "tailList-memory-arguments": 32, 160 | "mkNilData-cpu-arguments": 150000, 161 | "chooseData-cpu-arguments": 150000, 162 | "unBData-memory-arguments": 32, 163 | "blake2b-memory-arguments": 4, 164 | "iData-memory-arguments": 32, 165 | "nullList-memory-arguments": 32, 166 | "cekDelayCost-exBudgetCPU": 29773, 167 | "subtractInteger-memory-arguments-intercept": 1, 168 | "lessThanByteString-cpu-arguments-intercept": 103599, 169 | "consByteString-cpu-arguments-slope": 1000, 170 | "appendByteString-memory-arguments-slope": 1, 171 | "trace-memory-arguments": 32, 172 | "divideInteger-cpu-arguments-constant": 148000, 173 | "cekConstCost-exBudgetCPU": 29773, 174 | "encodeUtf8-memory-arguments-slope": 8, 175 | "quotientInteger-cpu-arguments-model-arguments-intercept": 425507, 176 | "mapData-memory-arguments": 32, 177 | "appendString-cpu-arguments-slope": 1000, 178 | "modInteger-cpu-arguments-constant": 148000, 179 | "verifySignature-cpu-arguments-slope": 1, 180 | "unConstrData-memory-arguments": 32, 181 | "quotientInteger-memory-arguments-intercept": 0, 182 | "equalsByteString-cpu-arguments-constant": 150000, 183 | "sliceByteString-memory-arguments-intercept": 0, 184 | "mkPairData-memory-arguments": 32, 185 | "equalsByteString-cpu-arguments-intercept": 112536, 186 | "appendString-memory-arguments-slope": 1, 187 | "lessThanInteger-cpu-arguments-slope": 497, 188 | "modInteger-cpu-arguments-model-arguments-intercept": 425507, 189 | "modInteger-memory-arguments-minimum": 1, 190 | "sha3_256-cpu-arguments-intercept": 0, 191 | "verifySignature-memory-arguments": 1, 192 | "cekLamCost-exBudgetMemory": 100, 193 | "sliceByteString-cpu-arguments-intercept": 150000 194 | } 195 | } 196 | } 197 | -------------------------------------------------------------------------------- /cfg-templates/main/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "AlonzoGenesisFile": "alonzo-genesis.json", 3 | "AlonzoGenesisHash": "7e94a15f55d1e82d10f09203fa1d40f8eede58fd8066542cf6566008068ed874", 4 | "ByronGenesisFile": "byron-genesis.json", 5 | "ByronGenesisHash": "5f20df933584822601f9e3f8c024eb5eb252fe8cefb24d1317dc3d432e940ebb", 6 | "ConwayGenesisFile": "conway-genesis.json", 7 | "ConwayGenesisHash": "15a199f895e461ec0ffc6dd4e4028af28a492ab4e806d39cb674c88f7643ef62", 8 | "EnableP2P": false, 9 | "LastKnownBlockVersion-Alt": 0, 10 | "LastKnownBlockVersion-Major": 3, 11 | "LastKnownBlockVersion-Minor": 0, 12 | "MaxKnownMajorProtocolVersion": 2, 13 | "MinNodeVersion": "8.12.0", 14 | "PeerSharing": false, 15 | "Protocol": "Cardano", 16 | "RequiresNetworkMagic": "RequiresNoMagic", 17 | "ShelleyGenesisFile": "shelley-genesis.json", 18 | "ShelleyGenesisHash": "1a3be38bcbb7911969283716ad7aa550250226b76a61fc51cc9a9a35d9276d81", 19 | "TargetNumberOfActivePeers": 20, 20 | "TargetNumberOfEstablishedPeers": 50, 21 | "TargetNumberOfKnownPeers": 150, 22 | "TargetNumberOfRootPeers": 60, 23 | "TraceAcceptPolicy": true, 24 | "TraceBlockFetchClient": false, 25 | "TraceBlockFetchDecisions": true, 26 | "TraceBlockFetchProtocol": false, 27 | "TraceBlockFetchProtocolSerialised": false, 28 | "TraceBlockFetchServer": false, 29 | "TraceChainDb": true, 30 | "TraceChainSyncBlockServer": false, 31 | "TraceChainSyncClient": false, 32 | "TraceChainSyncHeaderServer": false, 33 | "TraceChainSyncProtocol": false, 34 | "TraceConnectionManager": true, 35 | "TraceDNSResolver": true, 36 | "TraceDNSSubscription": true, 37 | "TraceDiffusionInitialization": true, 38 | "TraceErrorPolicy": true, 39 | "TraceForge": true, 40 | "TraceHandshake": true, 41 | "TraceInboundGovernor": true, 42 | "TraceIpSubscription": true, 43 | "TraceLedgerPeers": true, 44 | "TraceLocalChainSyncProtocol": false, 45 | "TraceLocalConnectionManager": true, 46 | "TraceLocalErrorPolicy": true, 47 | "TraceLocalHandshake": true, 48 | "TraceLocalRootPeers": true, 49 | "TraceLocalTxSubmissionProtocol": false, 50 | "TraceLocalTxSubmissionServer": false, 51 | "TraceMempool": true, 52 | "TraceMux": false, 53 | "TracePeerSelection": true, 54 | "TracePeerSelectionActions": true, 55 | "TracePublicRootPeers": true, 56 | "TraceServer": true, 57 | "TraceTxInbound": false, 58 | "TraceTxOutbound": false, 59 | "TraceTxSubmissionProtocol": false, 60 | "TracingVerbosity": "NormalVerbosity", 61 | "TurnOnLogMetrics": true, 62 | "TurnOnLogging": true, 63 | "defaultBackends": [ 64 | "KatipBK" 65 | ], 66 | "defaultScribes": [ 67 | [ 68 | "StdoutSK", 69 | "stdout" 70 | ] 71 | ], 72 | "hasEKG": 12788, 73 | "hasPrometheus": [ 74 | "127.0.0.1", 75 | 12798 76 | ], 77 | "minSeverity": "Info", 78 | "options": { 79 | "mapBackends": { 80 | "cardano.node.metrics": [ 81 | "EKGViewBK" 82 | ], 83 | "cardano.node.resources": [ 84 | "EKGViewBK" 85 | ] 86 | }, 87 | "mapSubtrace": { 88 | "cardano.node.metrics": { 89 | "subtrace": "Neutral" 90 | } 91 | } 92 | }, 93 | "rotation": { 94 | "rpKeepFilesNum": 10, 95 | "rpLogLimitBytes": 5000000, 96 | "rpMaxAgeHours": 24 97 | }, 98 | "setupBackends": [ 99 | "KatipBK" 100 | ], 101 | "setupScribes": [ 102 | { 103 | "scFormat": "ScText", 104 | "scKind": "StdoutSK", 105 | "scName": "stdout", 106 | "scRotation": null 107 | } 108 | ] 109 | } -------------------------------------------------------------------------------- /cfg-templates/main/conway-genesis.json: -------------------------------------------------------------------------------- 1 | { 2 | "poolVotingThresholds": { 3 | "committeeNormal": 0.51, 4 | "committeeNoConfidence": 0.51, 5 | "hardForkInitiation": 0.51, 6 | "motionNoConfidence": 0.51, 7 | "ppSecurityGroup": 0.51 8 | }, 9 | "dRepVotingThresholds": { 10 | "motionNoConfidence": 0.67, 11 | "committeeNormal": 0.67, 12 | "committeeNoConfidence": 0.6, 13 | "updateToConstitution": 0.75, 14 | "hardForkInitiation": 0.6, 15 | "ppNetworkGroup": 0.67, 16 | "ppEconomicGroup": 0.67, 17 | "ppTechnicalGroup": 0.67, 18 | "ppGovGroup": 0.75, 19 | "treasuryWithdrawal": 0.67 20 | }, 21 | "committeeMinSize": 7, 22 | "committeeMaxTermLength": 146, 23 | "govActionLifetime": 6, 24 | "govActionDeposit": 100000000000, 25 | "dRepDeposit": 500000000, 26 | "dRepActivity": 20, 27 | "minFeeRefScriptCostPerByte": 15, 28 | "plutusV3CostModel": [ 29 | 100788, 30 | 420, 31 | 1, 32 | 1, 33 | 1000, 34 | 173, 35 | 0, 36 | 1, 37 | 1000, 38 | 59957, 39 | 4, 40 | 1, 41 | 11183, 42 | 32, 43 | 201305, 44 | 8356, 45 | 4, 46 | 16000, 47 | 100, 48 | 16000, 49 | 100, 50 | 16000, 51 | 100, 52 | 16000, 53 | 100, 54 | 16000, 55 | 100, 56 | 16000, 57 | 100, 58 | 100, 59 | 100, 60 | 16000, 61 | 100, 62 | 94375, 63 | 32, 64 | 132994, 65 | 32, 66 | 61462, 67 | 4, 68 | 72010, 69 | 178, 70 | 0, 71 | 1, 72 | 22151, 73 | 32, 74 | 91189, 75 | 769, 76 | 4, 77 | 2, 78 | 85848, 79 | 123203, 80 | 7305, 81 | -900, 82 | 1716, 83 | 549, 84 | 57, 85 | 85848, 86 | 0, 87 | 1, 88 | 1, 89 | 1000, 90 | 42921, 91 | 4, 92 | 2, 93 | 24548, 94 | 29498, 95 | 38, 96 | 1, 97 | 898148, 98 | 27279, 99 | 1, 100 | 51775, 101 | 558, 102 | 1, 103 | 39184, 104 | 1000, 105 | 60594, 106 | 1, 107 | 141895, 108 | 32, 109 | 83150, 110 | 32, 111 | 15299, 112 | 32, 113 | 76049, 114 | 1, 115 | 13169, 116 | 4, 117 | 22100, 118 | 10, 119 | 28999, 120 | 74, 121 | 1, 122 | 28999, 123 | 74, 124 | 1, 125 | 43285, 126 | 552, 127 | 1, 128 | 44749, 129 | 541, 130 | 1, 131 | 33852, 132 | 32, 133 | 68246, 134 | 32, 135 | 72362, 136 | 32, 137 | 7243, 138 | 32, 139 | 7391, 140 | 32, 141 | 11546, 142 | 32, 143 | 85848, 144 | 123203, 145 | 7305, 146 | -900, 147 | 1716, 148 | 549, 149 | 57, 150 | 85848, 151 | 0, 152 | 1, 153 | 90434, 154 | 519, 155 | 0, 156 | 1, 157 | 74433, 158 | 32, 159 | 85848, 160 | 123203, 161 | 7305, 162 | -900, 163 | 1716, 164 | 549, 165 | 57, 166 | 85848, 167 | 0, 168 | 1, 169 | 1, 170 | 85848, 171 | 123203, 172 | 7305, 173 | -900, 174 | 1716, 175 | 549, 176 | 57, 177 | 85848, 178 | 0, 179 | 1, 180 | 955506, 181 | 213312, 182 | 0, 183 | 2, 184 | 270652, 185 | 22588, 186 | 4, 187 | 1457325, 188 | 64566, 189 | 4, 190 | 20467, 191 | 1, 192 | 4, 193 | 0, 194 | 141992, 195 | 32, 196 | 100788, 197 | 420, 198 | 1, 199 | 1, 200 | 81663, 201 | 32, 202 | 59498, 203 | 32, 204 | 20142, 205 | 32, 206 | 24588, 207 | 32, 208 | 20744, 209 | 32, 210 | 25933, 211 | 32, 212 | 24623, 213 | 32, 214 | 43053543, 215 | 10, 216 | 53384111, 217 | 14333, 218 | 10, 219 | 43574283, 220 | 26308, 221 | 10, 222 | 16000, 223 | 100, 224 | 16000, 225 | 100, 226 | 962335, 227 | 18, 228 | 2780678, 229 | 6, 230 | 442008, 231 | 1, 232 | 52538055, 233 | 3756, 234 | 18, 235 | 267929, 236 | 18, 237 | 76433006, 238 | 8868, 239 | 18, 240 | 52948122, 241 | 18, 242 | 1995836, 243 | 36, 244 | 3227919, 245 | 12, 246 | 901022, 247 | 1, 248 | 166917843, 249 | 4307, 250 | 36, 251 | 284546, 252 | 36, 253 | 158221314, 254 | 26549, 255 | 36, 256 | 74698472, 257 | 36, 258 | 333849714, 259 | 1, 260 | 254006273, 261 | 72, 262 | 2174038, 263 | 72, 264 | 2261318, 265 | 64571, 266 | 4, 267 | 207616, 268 | 8310, 269 | 4, 270 | 1293828, 271 | 28716, 272 | 63, 273 | 0, 274 | 1, 275 | 1006041, 276 | 43623, 277 | 251, 278 | 0, 279 | 1 280 | ], 281 | "constitution": { 282 | "anchor": { 283 | "dataHash": "ca41a91f399259bcefe57f9858e91f6d00e1a38d6d9c63d4052914ea7bd70cb2", 284 | "url": "ipfs://bafkreifnwj6zpu3ixa4siz2lndqybyc5wnnt3jkwyutci4e2tmbnj3xrdm" 285 | }, 286 | "script": "fa24fb305126805cf2164c161d852a0e7330cf988f1fe558cf7d4a64" 287 | }, 288 | "committee": { 289 | "members": { 290 | "scriptHash-df0e83bde65416dade5b1f97e7f115cc1ff999550ad968850783fe50": 580, 291 | "scriptHash-b6012034ba0a7e4afbbf2c7a1432f8824aee5299a48e38e41a952686": 580, 292 | "scriptHash-ce8b37a72b178a37bbd3236daa7b2c158c9d3604e7aa667e6c6004b7": 580, 293 | "scriptHash-f0dc2c00d92a45521267be2d5de1c485f6f9d14466d7e16062897cf7": 580, 294 | "scriptHash-349e55f83e9af24813e6cb368df6a80d38951b2a334dfcdf26815558": 580, 295 | "scriptHash-84aebcfd3e00d0f87af918fc4b5e00135f407e379893df7e7d392c6a": 580, 296 | "scriptHash-e8165b3328027ee0d74b1f07298cb092fd99aa7697a1436f5997f625": 580 297 | }, 298 | "threshold": { 299 | "numerator": 2, 300 | "denominator": 3 301 | } 302 | } 303 | } 304 | -------------------------------------------------------------------------------- /cfg-templates/main/db-sync-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "ByronGenesisFile": "/nix/store/3678ccikas3q16jcqcghwviqsd5k9wjx-mainnet-byron-genesis.json", 3 | "ByronGenesisHash": "5f20df933584822601f9e3f8c024eb5eb252fe8cefb24d1317dc3d432e940ebb", 4 | "EnableLogMetrics": false, 5 | "EnableLogging": true, 6 | "NetworkName": "mainnet", 7 | "Protocol": "Cardano", 8 | "RequiresNetworkMagic": "RequiresNoMagic", 9 | "ShelleyGenesisFile": "/nix/store/hxgam7f415s8b0j6c3qwakgkzd0pr5h4-mainnet-shelley-genesis.json", 10 | "ShelleyGenesisHash": "1a3be38bcbb7911969283716ad7aa550250226b76a61fc51cc9a9a35d9276d81", 11 | "defaultBackends": [ 12 | "KatipBK" 13 | ], 14 | "defaultScribes": [ 15 | [ 16 | "StdoutSK", 17 | "stdout" 18 | ] 19 | ], 20 | "hasPrometheus": [ 21 | "127.0.0.1", 22 | 12698 23 | ], 24 | "minSeverity": "Info", 25 | "options": { 26 | "cfokey": { 27 | "value": "Release-1.0.0" 28 | }, 29 | "mapBackends": {}, 30 | "mapSeverity": { 31 | "db-sync-node": "Info", 32 | "db-sync-node.Mux": "Error", 33 | "db-sync-node.Subscription": "Error" 34 | }, 35 | "mapSubtrace": { 36 | "#ekgview": { 37 | "contents": [ 38 | [ 39 | { 40 | "contents": "cardano.epoch-validation.benchmark", 41 | "tag": "Contains" 42 | }, 43 | [ 44 | { 45 | "contents": ".monoclock.basic.", 46 | "tag": "Contains" 47 | } 48 | ] 49 | ], 50 | [ 51 | { 52 | "contents": "cardano.epoch-validation.benchmark", 53 | "tag": "Contains" 54 | }, 55 | [ 56 | { 57 | "contents": "diff.RTS.cpuNs.timed.", 58 | "tag": "Contains" 59 | } 60 | ] 61 | ], 62 | [ 63 | { 64 | "contents": "#ekgview.#aggregation.cardano.epoch-validation.benchmark", 65 | "tag": "StartsWith" 66 | }, 67 | [ 68 | { 69 | "contents": "diff.RTS.gcNum.timed.", 70 | "tag": "Contains" 71 | } 72 | ] 73 | ] 74 | ], 75 | "subtrace": "FilterTrace" 76 | }, 77 | "#messagecounters.aggregation": { 78 | "subtrace": "NoTrace" 79 | }, 80 | "#messagecounters.ekgview": { 81 | "subtrace": "NoTrace" 82 | }, 83 | "#messagecounters.katip": { 84 | "subtrace": "NoTrace" 85 | }, 86 | "#messagecounters.monitoring": { 87 | "subtrace": "NoTrace" 88 | }, 89 | "#messagecounters.switchboard": { 90 | "subtrace": "NoTrace" 91 | }, 92 | "benchmark": { 93 | "contents": [ 94 | "GhcRtsStats", 95 | "MonotonicClock" 96 | ], 97 | "subtrace": "ObservableTrace" 98 | }, 99 | "cardano.epoch-validation.utxo-stats": { 100 | "subtrace": "NoTrace" 101 | } 102 | } 103 | }, 104 | "rotation": { 105 | "rpKeepFilesNum": 10, 106 | "rpLogLimitBytes": 5000000, 107 | "rpMaxAgeHours": 24 108 | }, 109 | "setupBackends": [ 110 | "AggregationBK", 111 | "KatipBK" 112 | ], 113 | "setupScribes": [ 114 | { 115 | "scFormat": "ScText", 116 | "scKind": "StdoutSK", 117 | "scName": "stdout", 118 | "scRotation": null 119 | } 120 | ] 121 | } 122 | -------------------------------------------------------------------------------- /cfg-templates/main/mithril_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "NETWORK": "mainnet", 3 | "GENESIS_VERIFICATION_KEY": "5b3139312c36362c3134302c3138352c3133382c31312c3233372c3230372c3235302c3134342c32372c322c3138382c33302c31322c38312c3135352c3230342c31302c3137392c37352c32332c3133382c3139362c3231372c352c31342c32302c35372c37392c33392c3137365d", 4 | "AGGREGATOR_ENDPOINT": "https://aggregator.release-mainnet.api.mithril.network/aggregator" 5 | } 6 | -------------------------------------------------------------------------------- /cfg-templates/main/rest-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "EnableLogMetrics": false, 3 | "EnableLogging": true, 4 | "defaultBackends": [ 5 | "KatipBK" 6 | ], 7 | "defaultScribes": [ 8 | [ 9 | "StdoutSK", 10 | "stdout" 11 | ] 12 | ], 13 | "hasPrometheus": [ 14 | "127.0.0.1", 15 | 12698 16 | ], 17 | "minSeverity": "Info", 18 | "options": { 19 | "cfokey": { 20 | "value": "Release-1.0.0" 21 | }, 22 | "mapBackends": {}, 23 | "mapSeverity": { 24 | "db-sync-node": "Info", 25 | "db-sync-node.Mux": "Error", 26 | "db-sync-node.Subscription": "Error" 27 | }, 28 | "mapSubtrace": { 29 | "#ekgview": { 30 | "contents": [ 31 | [ 32 | { 33 | "contents": "cardano.epoch-validation.benchmark", 34 | "tag": "Contains" 35 | }, 36 | [ 37 | { 38 | "contents": ".monoclock.basic.", 39 | "tag": "Contains" 40 | } 41 | ] 42 | ], 43 | [ 44 | { 45 | "contents": "cardano.epoch-validation.benchmark", 46 | "tag": "Contains" 47 | }, 48 | [ 49 | { 50 | "contents": "diff.RTS.cpuNs.timed.", 51 | "tag": "Contains" 52 | } 53 | ] 54 | ], 55 | [ 56 | { 57 | "contents": "#ekgview.#aggregation.cardano.epoch-validation.benchmark", 58 | "tag": "StartsWith" 59 | }, 60 | [ 61 | { 62 | "contents": "diff.RTS.gcNum.timed.", 63 | "tag": "Contains" 64 | } 65 | ] 66 | ] 67 | ], 68 | "subtrace": "FilterTrace" 69 | }, 70 | "#messagecounters.aggregation": { 71 | "subtrace": "NoTrace" 72 | }, 73 | "#messagecounters.ekgview": { 74 | "subtrace": "NoTrace" 75 | }, 76 | "#messagecounters.katip": { 77 | "subtrace": "NoTrace" 78 | }, 79 | "#messagecounters.monitoring": { 80 | "subtrace": "NoTrace" 81 | }, 82 | "#messagecounters.switchboard": { 83 | "subtrace": "NoTrace" 84 | }, 85 | "benchmark": { 86 | "contents": [ 87 | "GhcRtsStats", 88 | "MonotonicClock" 89 | ], 90 | "subtrace": "ObservableTrace" 91 | }, 92 | "cardano.epoch-validation.utxo-stats": { 93 | "subtrace": "NoTrace" 94 | } 95 | } 96 | }, 97 | "rotation": { 98 | "rpKeepFilesNum": 10, 99 | "rpLogLimitBytes": 5000000, 100 | "rpMaxAgeHours": 24 101 | }, 102 | "setupBackends": [ 103 | "AggregationBK", 104 | "KatipBK" 105 | ], 106 | "setupScribes": [ 107 | { 108 | "scFormat": "ScText", 109 | "scKind": "StdoutSK", 110 | "scName": "stdout", 111 | "scRotation": null 112 | } 113 | ] 114 | } 115 | -------------------------------------------------------------------------------- /cfg-templates/main/shelley-genesis.json: -------------------------------------------------------------------------------- 1 | { 2 | "activeSlotsCoeff": 0.05, 3 | "protocolParams": { 4 | "protocolVersion": { 5 | "minor": 0, 6 | "major": 2 7 | }, 8 | "decentralisationParam": 1, 9 | "eMax": 18, 10 | "extraEntropy": { 11 | "tag": "NeutralNonce" 12 | }, 13 | "maxTxSize": 16384, 14 | "maxBlockBodySize": 65536, 15 | "maxBlockHeaderSize": 1100, 16 | "minFeeA": 44, 17 | "minFeeB": 155381, 18 | "minUTxOValue": 1000000, 19 | "poolDeposit": 500000000, 20 | "minPoolCost": 340000000, 21 | "keyDeposit": 2000000, 22 | "nOpt": 150, 23 | "rho": 0.003, 24 | "tau": 0.20, 25 | "a0": 0.3 26 | }, 27 | "genDelegs": { 28 | "ad5463153dc3d24b9ff133e46136028bdc1edbb897f5a7cf1b37950c": { 29 | "delegate": "d9e5c76ad5ee778960804094a389f0b546b5c2b140a62f8ec43ea54d", 30 | "vrf": "64fa87e8b29a5b7bfbd6795677e3e878c505bc4a3649485d366b50abadec92d7" 31 | }, 32 | "b9547b8a57656539a8d9bc42c008e38d9c8bd9c8adbb1e73ad529497": { 33 | "delegate": "855d6fc1e54274e331e34478eeac8d060b0b90c1f9e8a2b01167c048", 34 | "vrf": "66d5167a1f426bd1adcc8bbf4b88c280d38c148d135cb41e3f5a39f948ad7fcc" 35 | }, 36 | "60baee25cbc90047e83fd01e1e57dc0b06d3d0cb150d0ab40bbfead1": { 37 | "delegate": "7f72a1826ae3b279782ab2bc582d0d2958de65bd86b2c4f82d8ba956", 38 | "vrf": "c0546d9aa5740afd569d3c2d9c412595cd60822bb6d9a4e8ce6c43d12bd0f674" 39 | }, 40 | "f7b341c14cd58fca4195a9b278cce1ef402dc0e06deb77e543cd1757": { 41 | "delegate": "69ae12f9e45c0c9122356c8e624b1fbbed6c22a2e3b4358cf0cb5011", 42 | "vrf": "6394a632af51a32768a6f12dac3485d9c0712d0b54e3f389f355385762a478f2" 43 | }, 44 | "162f94554ac8c225383a2248c245659eda870eaa82d0ef25fc7dcd82": { 45 | "delegate": "4485708022839a7b9b8b639a939c85ec0ed6999b5b6dc651b03c43f6", 46 | "vrf": "aba81e764b71006c515986bf7b37a72fbb5554f78e6775f08e384dbd572a4b32" 47 | }, 48 | "2075a095b3c844a29c24317a94a643ab8e22d54a3a3a72a420260af6": { 49 | "delegate": "6535db26347283990a252313a7903a45e3526ec25ddba381c071b25b", 50 | "vrf": "fcaca997b8105bd860876348fc2c6e68b13607f9bbd23515cd2193b555d267af" 51 | }, 52 | "268cfc0b89e910ead22e0ade91493d8212f53f3e2164b2e4bef0819b": { 53 | "delegate": "1d4f2e1fda43070d71bb22a5522f86943c7c18aeb4fa47a362c27e23", 54 | "vrf": "63ef48bc5355f3e7973100c371d6a095251c80ceb40559f4750aa7014a6fb6db" 55 | } 56 | }, 57 | "updateQuorum": 5, 58 | "networkId": "Mainnet", 59 | "initialFunds": {}, 60 | "maxLovelaceSupply": 45000000000000000, 61 | "networkMagic": 764824073, 62 | "epochLength": 432000, 63 | "systemStart": "2017-09-23T21:44:51Z", 64 | "slotsPerKESPeriod": 129600, 65 | "slotLength": 1, 66 | "maxKESEvolutions": 62, 67 | "securityParam": 2160 68 | } 69 | -------------------------------------------------------------------------------- /cfg-templates/main/topology-relay-p2p.json: -------------------------------------------------------------------------------- 1 | { 2 | "bootstrapPeers": [ 3 | { 4 | "address": "backbone.cardano.iog.io", 5 | "port": 3001 6 | }, 7 | { 8 | "address": "backbone.mainnet.emurgornd.com", 9 | "port": 3001 10 | }, 11 | { 12 | "address": "backbone.mainnet.cardanofoundation.org", 13 | "port": 3001 14 | } 15 | ], 16 | "localRoots": [], 17 | "publicRoots": [ 18 | { 19 | "accessPoints": [], 20 | "advertise": false 21 | } 22 | ], 23 | "useLedgerAfterSlot": 128908821 24 | } -------------------------------------------------------------------------------- /cfg-templates/main/topology-relay.json: -------------------------------------------------------------------------------- 1 | { 2 | "Producers": [ 3 | { 4 | "addr": "relays-new.cardano-mainnet.iohk.io", 5 | "port": 3001, 6 | "valency": 2 7 | } 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /cfg-templates/main/topology.json: -------------------------------------------------------------------------------- 1 | { 2 | "Producers": [] 3 | } 4 | -------------------------------------------------------------------------------- /cfg-templates/preview/VARS: -------------------------------------------------------------------------------- 1 | export NETWORK_ARGUMENT="--testnet-magic 2" 2 | export NETWORK_TAG=0 3 | export HARDFORK_EPOCH=1 -------------------------------------------------------------------------------- /cfg-templates/preview/alonzo-genesis.json: -------------------------------------------------------------------------------- 1 | { 2 | "lovelacePerUTxOWord": 34482, 3 | "executionPrices": { 4 | "prSteps": 5 | { 6 | "numerator" : 721, 7 | "denominator" : 10000000 8 | }, 9 | "prMem": 10 | { 11 | "numerator" : 577, 12 | "denominator" : 10000 13 | } 14 | }, 15 | "maxTxExUnits": { 16 | "exUnitsMem": 10000000, 17 | "exUnitsSteps": 10000000000 18 | }, 19 | "maxBlockExUnits": { 20 | "exUnitsMem": 50000000, 21 | "exUnitsSteps": 40000000000 22 | }, 23 | "maxValueSize": 5000, 24 | "collateralPercentage": 150, 25 | "maxCollateralInputs": 3, 26 | "costModels": { 27 | "PlutusV1": { 28 | "sha2_256-memory-arguments": 4, 29 | "equalsString-cpu-arguments-constant": 1000, 30 | "cekDelayCost-exBudgetMemory": 100, 31 | "lessThanEqualsByteString-cpu-arguments-intercept": 103599, 32 | "divideInteger-memory-arguments-minimum": 1, 33 | "appendByteString-cpu-arguments-slope": 621, 34 | "blake2b-cpu-arguments-slope": 29175, 35 | "iData-cpu-arguments": 150000, 36 | "encodeUtf8-cpu-arguments-slope": 1000, 37 | "unBData-cpu-arguments": 150000, 38 | "multiplyInteger-cpu-arguments-intercept": 61516, 39 | "cekConstCost-exBudgetMemory": 100, 40 | "nullList-cpu-arguments": 150000, 41 | "equalsString-cpu-arguments-intercept": 150000, 42 | "trace-cpu-arguments": 150000, 43 | "mkNilData-memory-arguments": 32, 44 | "lengthOfByteString-cpu-arguments": 150000, 45 | "cekBuiltinCost-exBudgetCPU": 29773, 46 | "bData-cpu-arguments": 150000, 47 | "subtractInteger-cpu-arguments-slope": 0, 48 | "unIData-cpu-arguments": 150000, 49 | "consByteString-memory-arguments-intercept": 0, 50 | "divideInteger-memory-arguments-slope": 1, 51 | "divideInteger-cpu-arguments-model-arguments-slope": 118, 52 | "listData-cpu-arguments": 150000, 53 | "headList-cpu-arguments": 150000, 54 | "chooseData-memory-arguments": 32, 55 | "equalsInteger-cpu-arguments-intercept": 136542, 56 | "sha3_256-cpu-arguments-slope": 82363, 57 | "sliceByteString-cpu-arguments-slope": 5000, 58 | "unMapData-cpu-arguments": 150000, 59 | "lessThanInteger-cpu-arguments-intercept": 179690, 60 | "mkCons-cpu-arguments": 150000, 61 | "appendString-memory-arguments-intercept": 0, 62 | "modInteger-cpu-arguments-model-arguments-slope": 118, 63 | "ifThenElse-cpu-arguments": 1, 64 | "mkNilPairData-cpu-arguments": 150000, 65 | "lessThanEqualsInteger-cpu-arguments-intercept": 145276, 66 | "addInteger-memory-arguments-slope": 1, 67 | "chooseList-memory-arguments": 32, 68 | "constrData-memory-arguments": 32, 69 | "decodeUtf8-cpu-arguments-intercept": 150000, 70 | "equalsData-memory-arguments": 1, 71 | "subtractInteger-memory-arguments-slope": 1, 72 | "appendByteString-memory-arguments-intercept": 0, 73 | "lengthOfByteString-memory-arguments": 4, 74 | "headList-memory-arguments": 32, 75 | "listData-memory-arguments": 32, 76 | "consByteString-cpu-arguments-intercept": 150000, 77 | "unIData-memory-arguments": 32, 78 | "remainderInteger-memory-arguments-minimum": 1, 79 | "bData-memory-arguments": 32, 80 | "lessThanByteString-cpu-arguments-slope": 248, 81 | "encodeUtf8-memory-arguments-intercept": 0, 82 | "cekStartupCost-exBudgetCPU": 100, 83 | "multiplyInteger-memory-arguments-intercept": 0, 84 | "unListData-memory-arguments": 32, 85 | "remainderInteger-cpu-arguments-model-arguments-slope": 118, 86 | "cekVarCost-exBudgetCPU": 29773, 87 | "remainderInteger-memory-arguments-slope": 1, 88 | "cekForceCost-exBudgetCPU": 29773, 89 | "sha2_256-cpu-arguments-slope": 29175, 90 | "equalsInteger-memory-arguments": 1, 91 | "indexByteString-memory-arguments": 1, 92 | "addInteger-memory-arguments-intercept": 1, 93 | "chooseUnit-cpu-arguments": 150000, 94 | "sndPair-cpu-arguments": 150000, 95 | "cekLamCost-exBudgetCPU": 29773, 96 | "fstPair-cpu-arguments": 150000, 97 | "quotientInteger-memory-arguments-minimum": 1, 98 | "decodeUtf8-cpu-arguments-slope": 1000, 99 | "lessThanInteger-memory-arguments": 1, 100 | "lessThanEqualsInteger-cpu-arguments-slope": 1366, 101 | "fstPair-memory-arguments": 32, 102 | "modInteger-memory-arguments-intercept": 0, 103 | "unConstrData-cpu-arguments": 150000, 104 | "lessThanEqualsInteger-memory-arguments": 1, 105 | "chooseUnit-memory-arguments": 32, 106 | "sndPair-memory-arguments": 32, 107 | "addInteger-cpu-arguments-intercept": 197209, 108 | "decodeUtf8-memory-arguments-slope": 8, 109 | "equalsData-cpu-arguments-intercept": 150000, 110 | "mapData-cpu-arguments": 150000, 111 | "mkPairData-cpu-arguments": 150000, 112 | "quotientInteger-cpu-arguments-constant": 148000, 113 | "consByteString-memory-arguments-slope": 1, 114 | "cekVarCost-exBudgetMemory": 100, 115 | "indexByteString-cpu-arguments": 150000, 116 | "unListData-cpu-arguments": 150000, 117 | "equalsInteger-cpu-arguments-slope": 1326, 118 | "cekStartupCost-exBudgetMemory": 100, 119 | "subtractInteger-cpu-arguments-intercept": 197209, 120 | "divideInteger-cpu-arguments-model-arguments-intercept": 425507, 121 | "divideInteger-memory-arguments-intercept": 0, 122 | "cekForceCost-exBudgetMemory": 100, 123 | "blake2b-cpu-arguments-intercept": 2477736, 124 | "remainderInteger-cpu-arguments-constant": 148000, 125 | "tailList-cpu-arguments": 150000, 126 | "encodeUtf8-cpu-arguments-intercept": 150000, 127 | "equalsString-cpu-arguments-slope": 1000, 128 | "lessThanByteString-memory-arguments": 1, 129 | "multiplyInteger-cpu-arguments-slope": 11218, 130 | "appendByteString-cpu-arguments-intercept": 396231, 131 | "lessThanEqualsByteString-cpu-arguments-slope": 248, 132 | "modInteger-memory-arguments-slope": 1, 133 | "addInteger-cpu-arguments-slope": 0, 134 | "equalsData-cpu-arguments-slope": 10000, 135 | "decodeUtf8-memory-arguments-intercept": 0, 136 | "chooseList-cpu-arguments": 150000, 137 | "constrData-cpu-arguments": 150000, 138 | "equalsByteString-memory-arguments": 1, 139 | "cekApplyCost-exBudgetCPU": 29773, 140 | "quotientInteger-memory-arguments-slope": 1, 141 | "verifySignature-cpu-arguments-intercept": 3345831, 142 | "unMapData-memory-arguments": 32, 143 | "mkCons-memory-arguments": 32, 144 | "sliceByteString-memory-arguments-slope": 1, 145 | "sha3_256-memory-arguments": 4, 146 | "ifThenElse-memory-arguments": 1, 147 | "mkNilPairData-memory-arguments": 32, 148 | "equalsByteString-cpu-arguments-slope": 247, 149 | "appendString-cpu-arguments-intercept": 150000, 150 | "quotientInteger-cpu-arguments-model-arguments-slope": 118, 151 | "cekApplyCost-exBudgetMemory": 100, 152 | "equalsString-memory-arguments": 1, 153 | "multiplyInteger-memory-arguments-slope": 1, 154 | "cekBuiltinCost-exBudgetMemory": 100, 155 | "remainderInteger-memory-arguments-intercept": 0, 156 | "sha2_256-cpu-arguments-intercept": 2477736, 157 | "remainderInteger-cpu-arguments-model-arguments-intercept": 425507, 158 | "lessThanEqualsByteString-memory-arguments": 1, 159 | "tailList-memory-arguments": 32, 160 | "mkNilData-cpu-arguments": 150000, 161 | "chooseData-cpu-arguments": 150000, 162 | "unBData-memory-arguments": 32, 163 | "blake2b-memory-arguments": 4, 164 | "iData-memory-arguments": 32, 165 | "nullList-memory-arguments": 32, 166 | "cekDelayCost-exBudgetCPU": 29773, 167 | "subtractInteger-memory-arguments-intercept": 1, 168 | "lessThanByteString-cpu-arguments-intercept": 103599, 169 | "consByteString-cpu-arguments-slope": 1000, 170 | "appendByteString-memory-arguments-slope": 1, 171 | "trace-memory-arguments": 32, 172 | "divideInteger-cpu-arguments-constant": 148000, 173 | "cekConstCost-exBudgetCPU": 29773, 174 | "encodeUtf8-memory-arguments-slope": 8, 175 | "quotientInteger-cpu-arguments-model-arguments-intercept": 425507, 176 | "mapData-memory-arguments": 32, 177 | "appendString-cpu-arguments-slope": 1000, 178 | "modInteger-cpu-arguments-constant": 148000, 179 | "verifySignature-cpu-arguments-slope": 1, 180 | "unConstrData-memory-arguments": 32, 181 | "quotientInteger-memory-arguments-intercept": 0, 182 | "equalsByteString-cpu-arguments-constant": 150000, 183 | "sliceByteString-memory-arguments-intercept": 0, 184 | "mkPairData-memory-arguments": 32, 185 | "equalsByteString-cpu-arguments-intercept": 112536, 186 | "appendString-memory-arguments-slope": 1, 187 | "lessThanInteger-cpu-arguments-slope": 497, 188 | "modInteger-cpu-arguments-model-arguments-intercept": 425507, 189 | "modInteger-memory-arguments-minimum": 1, 190 | "sha3_256-cpu-arguments-intercept": 0, 191 | "verifySignature-memory-arguments": 1, 192 | "cekLamCost-exBudgetMemory": 100, 193 | "sliceByteString-cpu-arguments-intercept": 150000 194 | } 195 | } 196 | } 197 | -------------------------------------------------------------------------------- /cfg-templates/preview/byron-genesis.json: -------------------------------------------------------------------------------- 1 | { "bootStakeholders": 2 | { "021e737009040bf7f1e7b1bcc148f29d748d4a6b561902c95e4a9f36": 1 3 | , "0bc82ced9544980b9ffe7f64b1538bbda6804a5cc32c8035485e184b": 1 4 | , "18ed9844deef98cf9ba8b39791dede0538d2d2fa79bf67ef37dcc826": 1 5 | , "66cfa84ad0ee5ca8586244c8393007cf3d9622d77cfa03fd4f35065b": 1 6 | , "76c4d6c68c0ef81ae364411a84e52ce66089ed006ca29adfc0227901": 1 7 | , "8cc6b89fec65cc83d34b7bab2e6494db631d8476a86625767dd0c2a0": 1 8 | , "e90060fdc085ac9f63cdb3b32ba1d84e0f7eb98561687b213b4c8770": 1 9 | } 10 | , "heavyDelegation": 11 | { "021e737009040bf7f1e7b1bcc148f29d748d4a6b561902c95e4a9f36": 12 | { "omega": 0 13 | , "issuerPk": 14 | "6hSFCotivD08t02n43RMiaF9LzwtYVrFMu/WX6ShfEsxfdXFL5Y6c+DwHSZOCywU0RJz5er2icIO03UytC9NTg==" 15 | , "delegatePk": 16 | "JEnSVQTPGriTx1+lAMkKhCNsMBDNPGw+NiEvNPh4ui6IdvxrO+WkQPTy5U865XB4VFvi/zb7d+H1bilnztQNBg==" 17 | , "cert": 18 | "558952d17442e8cc73f0c7dd606e329b38ed2ec0c1f83fe2567d28b21ef2223d2d23640cd0531f75832b50e519631c48643fcfaa7168851645dce07b90d87f0e" 19 | } 20 | , "0bc82ced9544980b9ffe7f64b1538bbda6804a5cc32c8035485e184b": 21 | { "omega": 0 22 | , "issuerPk": 23 | "MJ7IskKU8GKk0Eeg3zhfSOK1DDVXOMHD2V/zhEpODUtL9YB0Y7sXnbZfg3+Df05hskP5Jz+dZvdC6DH/dP9jmQ==" 24 | , "delegatePk": 25 | "hwO7NJL7LfAk5e/QG61FKcdORoK60tvprE3063Muh4EQKrWA6l7t23B2GziK8D0hRO0j5W1Gzpn8WW69XLIlKA==" 26 | , "cert": 27 | "2bccf50d0c3cbb03dd29cfba817e8ba615db3d7722b41b264ad08722e548cfe83d069b29d13e490823d7519ecdd9940ea49573f6027056c4bd58da1adf75020e" 28 | } 29 | , "18ed9844deef98cf9ba8b39791dede0538d2d2fa79bf67ef37dcc826": 30 | { "omega": 0 31 | , "issuerPk": 32 | "pXbW4Jak8maeuWiosvrurykKnqDSHswUjroonSDS3fTnWS+BKe+vjT4zZJNKhQ33KbagiHVJ5CJUNggfsCtG2g==" 33 | , "delegatePk": 34 | "rbJAZp3kWCUvp8dnLR6qsgpGU+qKAFow4NHYKWiKCkfm1qFCFONob50N1IbNWCGWAhg38ZPTvBazTasjsfj6yQ==" 35 | , "cert": 36 | "89e1638e31fd3d402cecb897ba773d8c2c11c2d3cff2462b266e21461539b1a4fe8fb528e159b9af473799b51e49aa5b5816a88f10c484aa7cef7ad12850830a" 37 | } 38 | , "66cfa84ad0ee5ca8586244c8393007cf3d9622d77cfa03fd4f35065b": 39 | { "omega": 0 40 | , "issuerPk": 41 | "/LGZjmmcAMRisP7Rf454GM2QUKgj2aAyqE+iQo2PIEhcistFOlT+idtbLTceZAnQcwwPJDtTcNi+EnPQyscZOg==" 42 | , "delegatePk": 43 | "rinFUiKKCPPFY0ULEKn1SPRgLVmOS3jdTXDtrxK6VI1I11G3uBS1Olxi0mQSN3kf+B3hm/xHkuUDVNaSXNiBeQ==" 44 | , "cert": 45 | "3e7f30bb68c5bc4d23c2a730ac154a188a1fd45aac3f438efd380303171443d2ca4f50e5a1ff66b40ae3da64697f2599956ae06c21b73fa828b8c0dc9fb27302" 46 | } 47 | , "76c4d6c68c0ef81ae364411a84e52ce66089ed006ca29adfc0227901": 48 | { "omega": 0 49 | , "issuerPk": 50 | "9EE85tTLdSSR4T1Xoy6n9wr6jlbavCdfp9oQKusskO3DSSyNqRYS7QzYQ96j/WnphUey63082YkKijMfF9A4eA==" 51 | , "delegatePk": 52 | "dvyHDkXg8LFtb0K6Sitl8OGSEZPvfCVQYLDR6Au6t6/ROvlerMKQ8uri4fG7hQQzbHKtdKWgv94t+zuFJTQ1fw==" 53 | , "cert": 54 | "5ec0ed46ae7e575bdb089f1bceca3b2689b13a7162fe08578fe60ba64607fffaa507412a97652c3c81cc0ef93ff404cf809a628ae19faba1a035fca0505c1d04" 55 | } 56 | , "8cc6b89fec65cc83d34b7bab2e6494db631d8476a86625767dd0c2a0": 57 | { "omega": 0 58 | , "issuerPk": 59 | "Hr5S5PAxf9HSB4FzmtZzaFcXrNrctrI5XUrDrnCkOUTX6rhbtOMkXU3sWVDOvU6LNSSr3/Ws2+iCYZIr7LmTWg==" 60 | , "delegatePk": 61 | "FaLH2b5H/XS31YRnm98N6fP4Etx6m+GbniVAXMwOp8KhYXPKBJBsX/EjIy3pSkvRBhGCjsycB0yrDxWMi5ZsIQ==" 62 | , "cert": 63 | "10f06304cceb42071605ebba67b308c7568e5e6fe0d773c58f7e8c13bc8d8a340f70a4fd5e1b4a1c1db1de5c7646802bbc929d6c82d7adb8a77cb6ad77eac50a" 64 | } 65 | , "e90060fdc085ac9f63cdb3b32ba1d84e0f7eb98561687b213b4c8770": 66 | { "omega": 0 67 | , "issuerPk": 68 | "B2R+VXzy3c8bxncdOpQ2Z/tblxRNQO8AXQ0OsJDQvZYnLeGQcLD78kyYLpi3nfuS4SfnLar23NV4yiEVwaw+Yw==" 69 | , "delegatePk": 70 | "nACHGIBacymrKwn07iW/a5ZKJCPZ2cKQqeXw3ivR7WOYVUuufWhZlCoUTZ7rtBqoDaexblUQwkC7hA7AmNA3FA==" 71 | , "cert": 72 | "b5440daa05f7fae557df46e4f1b7c5802b86f465daad1137e315abf6e72f1c877207276abb8dcba86e18e42d39b34c2f0fa82ba2919944cdc8e2e5264baa450b" 73 | } 74 | } 75 | , "startTime": 1666656000 76 | , "nonAvvmBalances": 77 | { "FHnt4NL7yPXjpZtYj1YUiX9QYYUZGXDT9gA2PJXQFkTSMx3EgawXK5BUrCHdhe2": 78 | "0" 79 | , "FHnt4NL7yPXk7D87qAWEmfnL7wSQ9AzBU2mjZt3eM48NSCbygxgzAU6vCGiRZEW": 80 | "0" 81 | , "FHnt4NL7yPXpazQsTdJ3Gp1twQUo4N5rrgGbRNSzchjchPiApc1k4CvqDMcdd7H": 82 | "0" 83 | , "FHnt4NL7yPXtNo1wLCLZyGTMfAvB14h8onafiYkM7B69ZwvGgXeUyQWfi7FPrif": 84 | "0" 85 | , "FHnt4NL7yPXtmi4mAjD43V3NB3shDs1gCuHNcMLPsRWjaw1b2yRV2xad8S8V6aq": 86 | "0" 87 | , "FHnt4NL7yPXvDWHa8bVs73UEUdJd64VxWXSFNqetECtYfTd9TtJguJ14Lu3feth": 88 | "30000000000000000" 89 | , "FHnt4NL7yPXvNSRpCYydjRr7koQCrsTtkovk5uYMimgqMJX2DyrEEBqiXaTd8rG": 90 | "0" 91 | , "FHnt4NL7yPY9rTvdsCeyRnsbzp4bN7XdmAZeU5PzA1qR2asYmN6CsdxJw4YoDjG": 92 | "0" 93 | } 94 | , "blockVersionData": 95 | { "scriptVersion": 0 96 | , "slotDuration": "20000" 97 | , "maxBlockSize": "2000000" 98 | , "maxHeaderSize": "2000000" 99 | , "maxTxSize": "4096" 100 | , "maxProposalSize": "700" 101 | , "mpcThd": "20000000000000" 102 | , "heavyDelThd": "300000000000" 103 | , "updateVoteThd": "1000000000000" 104 | , "updateProposalThd": "100000000000000" 105 | , "updateImplicit": "10000" 106 | , "softforkRule": 107 | { "initThd": "900000000000000" 108 | , "minThd": "600000000000000" 109 | , "thdDecrement": "50000000000000" 110 | } 111 | , "txFeePolicy": 112 | { "summand": "155381000000000" , "multiplier": "43946000000" } 113 | , "unlockStakeEpoch": "18446744073709551615" 114 | } 115 | , "protocolConsts": { "k": 432 , "protocolMagic": 2 } 116 | , "avvmDistr": {} 117 | } 118 | -------------------------------------------------------------------------------- /cfg-templates/preview/config-bp.json: -------------------------------------------------------------------------------- 1 | { 2 | "AlonzoGenesisFile": "alonzo-genesis.json", 3 | "AlonzoGenesisHash": "7e94a15f55d1e82d10f09203fa1d40f8eede58fd8066542cf6566008068ed874", 4 | "ByronGenesisFile": "byron-genesis.json", 5 | "ByronGenesisHash": "83de1d7302569ad56cf9139a41e2e11346d4cb4a31c00142557b6ab3fa550761", 6 | "ConwayGenesisFile": "conway-genesis.json", 7 | "ConwayGenesisHash": "9cc5084f02e27210eacba47af0872e3dba8946ad9460b6072d793e1d2f3987ef", 8 | "EnableP2P": true, 9 | "ExperimentalHardForksEnabled": false, 10 | "ExperimentalProtocolsEnabled": false, 11 | "LastKnownBlockVersion-Alt": 0, 12 | "LastKnownBlockVersion-Major": 3, 13 | "LastKnownBlockVersion-Minor": 1, 14 | "MinNodeVersion": "8.12.0", 15 | "PeerSharing": false, 16 | "Protocol": "Cardano", 17 | "RequiresNetworkMagic": "RequiresMagic", 18 | "ShelleyGenesisFile": "shelley-genesis.json", 19 | "ShelleyGenesisHash": "363498d1024f84bb39d3fa9593ce391483cb40d479b87233f868d6e57c3a400d", 20 | "TargetNumberOfActivePeers": 20, 21 | "TargetNumberOfEstablishedPeers": 50, 22 | "TargetNumberOfKnownPeers": 100, 23 | "TargetNumberOfRootPeers": 100, 24 | "TestAllegraHardForkAtEpoch": 0, 25 | "TestAlonzoHardForkAtEpoch": 0, 26 | "TestMaryHardForkAtEpoch": 0, 27 | "TestShelleyHardForkAtEpoch": 0, 28 | "TraceAcceptPolicy": true, 29 | "TraceBlockFetchClient": false, 30 | "TraceBlockFetchDecisions": false, 31 | "TraceBlockFetchProtocol": false, 32 | "TraceBlockFetchProtocolSerialised": false, 33 | "TraceBlockFetchServer": false, 34 | "TraceChainDb": true, 35 | "TraceChainSyncBlockServer": false, 36 | "TraceChainSyncClient": false, 37 | "TraceChainSyncHeaderServer": false, 38 | "TraceChainSyncProtocol": false, 39 | "TraceConnectionManager": true, 40 | "TraceDNSResolver": true, 41 | "TraceDNSSubscription": true, 42 | "TraceDiffusionInitialization": true, 43 | "TraceErrorPolicy": true, 44 | "TraceForge": true, 45 | "TraceHandshake": true, 46 | "TraceInboundGovernor": true, 47 | "TraceIpSubscription": true, 48 | "TraceLedgerPeers": true, 49 | "TraceLocalChainSyncProtocol": false, 50 | "TraceLocalConnectionManager": true, 51 | "TraceLocalErrorPolicy": true, 52 | "TraceLocalHandshake": true, 53 | "TraceLocalRootPeers": true, 54 | "TraceLocalTxSubmissionProtocol": false, 55 | "TraceLocalTxSubmissionServer": false, 56 | "TraceMempool": true, 57 | "TraceMux": false, 58 | "TracePeerSelection": true, 59 | "TracePeerSelectionActions": true, 60 | "TracePublicRootPeers": true, 61 | "TraceServer": true, 62 | "TraceTxInbound": false, 63 | "TraceTxOutbound": false, 64 | "TraceTxSubmissionProtocol": false, 65 | "TracingVerbosity": "NormalVerbosity", 66 | "TurnOnLogMetrics": true, 67 | "TurnOnLogging": true, 68 | "defaultBackends": [ 69 | "KatipBK" 70 | ], 71 | "defaultScribes": [ 72 | [ 73 | "StdoutSK", 74 | "stdout" 75 | ] 76 | ], 77 | "hasEKG": 12788, 78 | "hasPrometheus": [ 79 | "127.0.0.1", 80 | 12798 81 | ], 82 | "minSeverity": "Info", 83 | "options": { 84 | "mapBackends": { 85 | "cardano.node.metrics": [ 86 | "EKGViewBK" 87 | ], 88 | "cardano.node.resources": [ 89 | "EKGViewBK" 90 | ] 91 | }, 92 | "mapSubtrace": { 93 | "cardano.node.metrics": { 94 | "subtrace": "Neutral" 95 | } 96 | } 97 | }, 98 | "rotation": { 99 | "rpKeepFilesNum": 10, 100 | "rpLogLimitBytes": 5000000, 101 | "rpMaxAgeHours": 24 102 | }, 103 | "setupBackends": [ 104 | "KatipBK" 105 | ], 106 | "setupScribes": [ 107 | { 108 | "scFormat": "ScText", 109 | "scKind": "StdoutSK", 110 | "scName": "stdout", 111 | "scRotation": null 112 | } 113 | ] 114 | } 115 | -------------------------------------------------------------------------------- /cfg-templates/preview/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "AlonzoGenesisFile": "alonzo-genesis.json", 3 | "AlonzoGenesisHash": "7e94a15f55d1e82d10f09203fa1d40f8eede58fd8066542cf6566008068ed874", 4 | "ByronGenesisFile": "byron-genesis.json", 5 | "ByronGenesisHash": "83de1d7302569ad56cf9139a41e2e11346d4cb4a31c00142557b6ab3fa550761", 6 | "ConwayGenesisFile": "conway-genesis.json", 7 | "ConwayGenesisHash": "9cc5084f02e27210eacba47af0872e3dba8946ad9460b6072d793e1d2f3987ef", 8 | "EnableP2P": true, 9 | "ExperimentalHardForksEnabled": false, 10 | "ExperimentalProtocolsEnabled": false, 11 | "LastKnownBlockVersion-Alt": 0, 12 | "LastKnownBlockVersion-Major": 3, 13 | "LastKnownBlockVersion-Minor": 1, 14 | "MinNodeVersion": "8.12.0", 15 | "PeerSharing": true, 16 | "Protocol": "Cardano", 17 | "RequiresNetworkMagic": "RequiresMagic", 18 | "ShelleyGenesisFile": "shelley-genesis.json", 19 | "ShelleyGenesisHash": "363498d1024f84bb39d3fa9593ce391483cb40d479b87233f868d6e57c3a400d", 20 | "TargetNumberOfActivePeers": 20, 21 | "TargetNumberOfEstablishedPeers": 50, 22 | "TargetNumberOfKnownPeers": 150, 23 | "TargetNumberOfRootPeers": 60, 24 | "TestAllegraHardForkAtEpoch": 0, 25 | "TestAlonzoHardForkAtEpoch": 0, 26 | "TestMaryHardForkAtEpoch": 0, 27 | "TestShelleyHardForkAtEpoch": 0, 28 | "TraceAcceptPolicy": true, 29 | "TraceBlockFetchClient": false, 30 | "TraceBlockFetchDecisions": false, 31 | "TraceBlockFetchProtocol": false, 32 | "TraceBlockFetchProtocolSerialised": false, 33 | "TraceBlockFetchServer": false, 34 | "TraceChainDb": true, 35 | "TraceChainSyncBlockServer": false, 36 | "TraceChainSyncClient": false, 37 | "TraceChainSyncHeaderServer": false, 38 | "TraceChainSyncProtocol": false, 39 | "TraceConnectionManager": true, 40 | "TraceDNSResolver": true, 41 | "TraceDNSSubscription": true, 42 | "TraceDiffusionInitialization": true, 43 | "TraceErrorPolicy": true, 44 | "TraceForge": true, 45 | "TraceHandshake": true, 46 | "TraceInboundGovernor": true, 47 | "TraceIpSubscription": true, 48 | "TraceLedgerPeers": true, 49 | "TraceLocalChainSyncProtocol": false, 50 | "TraceLocalConnectionManager": true, 51 | "TraceLocalErrorPolicy": true, 52 | "TraceLocalHandshake": true, 53 | "TraceLocalRootPeers": true, 54 | "TraceLocalTxSubmissionProtocol": false, 55 | "TraceLocalTxSubmissionServer": false, 56 | "TraceMempool": true, 57 | "TraceMux": false, 58 | "TracePeerSelection": true, 59 | "TracePeerSelectionActions": true, 60 | "TracePublicRootPeers": true, 61 | "TraceServer": true, 62 | "TraceTxInbound": false, 63 | "TraceTxOutbound": false, 64 | "TraceTxSubmissionProtocol": false, 65 | "TracingVerbosity": "NormalVerbosity", 66 | "TurnOnLogMetrics": true, 67 | "TurnOnLogging": true, 68 | "defaultBackends": [ 69 | "KatipBK" 70 | ], 71 | "defaultScribes": [ 72 | [ 73 | "StdoutSK", 74 | "stdout" 75 | ] 76 | ], 77 | "hasEKG": 12788, 78 | "hasPrometheus": [ 79 | "127.0.0.1", 80 | 12798 81 | ], 82 | "minSeverity": "Info", 83 | "options": { 84 | "mapBackends": { 85 | "cardano.node.metrics": [ 86 | "EKGViewBK" 87 | ], 88 | "cardano.node.resources": [ 89 | "EKGViewBK" 90 | ] 91 | }, 92 | "mapSubtrace": { 93 | "cardano.node.metrics": { 94 | "subtrace": "Neutral" 95 | } 96 | } 97 | }, 98 | "rotation": { 99 | "rpKeepFilesNum": 10, 100 | "rpLogLimitBytes": 5000000, 101 | "rpMaxAgeHours": 24 102 | }, 103 | "setupBackends": [ 104 | "KatipBK" 105 | ], 106 | "setupScribes": [ 107 | { 108 | "scFormat": "ScText", 109 | "scKind": "StdoutSK", 110 | "scName": "stdout", 111 | "scRotation": null 112 | } 113 | ] 114 | } 115 | -------------------------------------------------------------------------------- /cfg-templates/preview/conway-genesis.json: -------------------------------------------------------------------------------- 1 | { 2 | "poolVotingThresholds": { 3 | "committeeNormal": 0.51, 4 | "committeeNoConfidence": 0.51, 5 | "hardForkInitiation": 0.51, 6 | "motionNoConfidence": 0.51, 7 | "ppSecurityGroup": 0.51 8 | }, 9 | "dRepVotingThresholds": { 10 | "motionNoConfidence": 0.67, 11 | "committeeNormal": 0.67, 12 | "committeeNoConfidence": 0.6, 13 | "updateToConstitution": 0.75, 14 | "hardForkInitiation": 0.6, 15 | "ppNetworkGroup": 0.67, 16 | "ppEconomicGroup": 0.67, 17 | "ppTechnicalGroup": 0.67, 18 | "ppGovGroup": 0.75, 19 | "treasuryWithdrawal": 0.67 20 | }, 21 | "committeeMinSize": 0, 22 | "committeeMaxTermLength": 365, 23 | "govActionLifetime": 30, 24 | "govActionDeposit": 100000000000, 25 | "dRepDeposit": 500000000, 26 | "dRepActivity": 20, 27 | "minFeeRefScriptCostPerByte": 15, 28 | "plutusV3CostModel": [ 29 | 100788, 30 | 420, 31 | 1, 32 | 1, 33 | 1000, 34 | 173, 35 | 0, 36 | 1, 37 | 1000, 38 | 59957, 39 | 4, 40 | 1, 41 | 11183, 42 | 32, 43 | 201305, 44 | 8356, 45 | 4, 46 | 16000, 47 | 100, 48 | 16000, 49 | 100, 50 | 16000, 51 | 100, 52 | 16000, 53 | 100, 54 | 16000, 55 | 100, 56 | 16000, 57 | 100, 58 | 100, 59 | 100, 60 | 16000, 61 | 100, 62 | 94375, 63 | 32, 64 | 132994, 65 | 32, 66 | 61462, 67 | 4, 68 | 72010, 69 | 178, 70 | 0, 71 | 1, 72 | 22151, 73 | 32, 74 | 91189, 75 | 769, 76 | 4, 77 | 2, 78 | 85848, 79 | 123203, 80 | 7305, 81 | -900, 82 | 1716, 83 | 549, 84 | 57, 85 | 85848, 86 | 0, 87 | 1, 88 | 1, 89 | 1000, 90 | 42921, 91 | 4, 92 | 2, 93 | 24548, 94 | 29498, 95 | 38, 96 | 1, 97 | 898148, 98 | 27279, 99 | 1, 100 | 51775, 101 | 558, 102 | 1, 103 | 39184, 104 | 1000, 105 | 60594, 106 | 1, 107 | 141895, 108 | 32, 109 | 83150, 110 | 32, 111 | 15299, 112 | 32, 113 | 76049, 114 | 1, 115 | 13169, 116 | 4, 117 | 22100, 118 | 10, 119 | 28999, 120 | 74, 121 | 1, 122 | 28999, 123 | 74, 124 | 1, 125 | 43285, 126 | 552, 127 | 1, 128 | 44749, 129 | 541, 130 | 1, 131 | 33852, 132 | 32, 133 | 68246, 134 | 32, 135 | 72362, 136 | 32, 137 | 7243, 138 | 32, 139 | 7391, 140 | 32, 141 | 11546, 142 | 32, 143 | 85848, 144 | 123203, 145 | 7305, 146 | -900, 147 | 1716, 148 | 549, 149 | 57, 150 | 85848, 151 | 0, 152 | 1, 153 | 90434, 154 | 519, 155 | 0, 156 | 1, 157 | 74433, 158 | 32, 159 | 85848, 160 | 123203, 161 | 7305, 162 | -900, 163 | 1716, 164 | 549, 165 | 57, 166 | 85848, 167 | 0, 168 | 1, 169 | 1, 170 | 85848, 171 | 123203, 172 | 7305, 173 | -900, 174 | 1716, 175 | 549, 176 | 57, 177 | 85848, 178 | 0, 179 | 1, 180 | 955506, 181 | 213312, 182 | 0, 183 | 2, 184 | 270652, 185 | 22588, 186 | 4, 187 | 1457325, 188 | 64566, 189 | 4, 190 | 20467, 191 | 1, 192 | 4, 193 | 0, 194 | 141992, 195 | 32, 196 | 100788, 197 | 420, 198 | 1, 199 | 1, 200 | 81663, 201 | 32, 202 | 59498, 203 | 32, 204 | 20142, 205 | 32, 206 | 24588, 207 | 32, 208 | 20744, 209 | 32, 210 | 25933, 211 | 32, 212 | 24623, 213 | 32, 214 | 43053543, 215 | 10, 216 | 53384111, 217 | 14333, 218 | 10, 219 | 43574283, 220 | 26308, 221 | 10, 222 | 16000, 223 | 100, 224 | 16000, 225 | 100, 226 | 962335, 227 | 18, 228 | 2780678, 229 | 6, 230 | 442008, 231 | 1, 232 | 52538055, 233 | 3756, 234 | 18, 235 | 267929, 236 | 18, 237 | 76433006, 238 | 8868, 239 | 18, 240 | 52948122, 241 | 18, 242 | 1995836, 243 | 36, 244 | 3227919, 245 | 12, 246 | 901022, 247 | 1, 248 | 166917843, 249 | 4307, 250 | 36, 251 | 284546, 252 | 36, 253 | 158221314, 254 | 26549, 255 | 36, 256 | 74698472, 257 | 36, 258 | 333849714, 259 | 1, 260 | 254006273, 261 | 72, 262 | 2174038, 263 | 72, 264 | 2261318, 265 | 64571, 266 | 4, 267 | 207616, 268 | 8310, 269 | 4, 270 | 1293828, 271 | 28716, 272 | 63, 273 | 0, 274 | 1, 275 | 1006041, 276 | 43623, 277 | 251, 278 | 0, 279 | 1 280 | ], 281 | "constitution": { 282 | "anchor": { 283 | "dataHash": "ca41a91f399259bcefe57f9858e91f6d00e1a38d6d9c63d4052914ea7bd70cb2", 284 | "url": "ipfs://bafkreifnwj6zpu3ixa4siz2lndqybyc5wnnt3jkwyutci4e2tmbnj3xrdm" 285 | }, 286 | "script": "fa24fb305126805cf2164c161d852a0e7330cf988f1fe558cf7d4a64" 287 | }, 288 | "committee": { 289 | "members": { 290 | "scriptHash-ff9babf23fef3f54ec29132c07a8e23807d7b395b143ecd8ff79f4c7": 1000 291 | }, 292 | "threshold": { 293 | "numerator": 2, 294 | "denominator": 3 295 | } 296 | } 297 | } 298 | -------------------------------------------------------------------------------- /cfg-templates/preview/db-sync-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "EnableFutureGenesis": true, 3 | "EnableLogMetrics": false, 4 | "EnableLogging": true, 5 | "NetworkName": "preview", 6 | "NodeConfigFile": "config.json", 7 | "PrometheusPort": 8080, 8 | "RequiresNetworkMagic": "RequiresMagic", 9 | "defaultBackends": [ 10 | "KatipBK" 11 | ], 12 | "defaultScribes": [ 13 | [ 14 | "StdoutSK", 15 | "stdout" 16 | ] 17 | ], 18 | "minSeverity": "Info", 19 | "options": { 20 | "cfokey": { 21 | "value": "Release-1.0.0" 22 | }, 23 | "mapBackends": {}, 24 | "mapSeverity": { 25 | "db-sync-node": "Info", 26 | "db-sync-node.Mux": "Error", 27 | "db-sync-node.Subscription": "Error" 28 | }, 29 | "mapSubtrace": { 30 | "#ekgview": { 31 | "contents": [ 32 | [ 33 | { 34 | "contents": "cardano.epoch-validation.benchmark", 35 | "tag": "Contains" 36 | }, 37 | [ 38 | { 39 | "contents": ".monoclock.basic.", 40 | "tag": "Contains" 41 | } 42 | ] 43 | ], 44 | [ 45 | { 46 | "contents": "cardano.epoch-validation.benchmark", 47 | "tag": "Contains" 48 | }, 49 | [ 50 | { 51 | "contents": "diff.RTS.cpuNs.timed.", 52 | "tag": "Contains" 53 | } 54 | ] 55 | ], 56 | [ 57 | { 58 | "contents": "#ekgview.#aggregation.cardano.epoch-validation.benchmark", 59 | "tag": "StartsWith" 60 | }, 61 | [ 62 | { 63 | "contents": "diff.RTS.gcNum.timed.", 64 | "tag": "Contains" 65 | } 66 | ] 67 | ] 68 | ], 69 | "subtrace": "FilterTrace" 70 | }, 71 | "#messagecounters.aggregation": { 72 | "subtrace": "NoTrace" 73 | }, 74 | "#messagecounters.ekgview": { 75 | "subtrace": "NoTrace" 76 | }, 77 | "#messagecounters.katip": { 78 | "subtrace": "NoTrace" 79 | }, 80 | "#messagecounters.monitoring": { 81 | "subtrace": "NoTrace" 82 | }, 83 | "#messagecounters.switchboard": { 84 | "subtrace": "NoTrace" 85 | }, 86 | "benchmark": { 87 | "contents": [ 88 | "GhcRtsStats", 89 | "MonotonicClock" 90 | ], 91 | "subtrace": "ObservableTrace" 92 | }, 93 | "cardano.epoch-validation.utxo-stats": { 94 | "subtrace": "NoTrace" 95 | } 96 | } 97 | }, 98 | "rotation": { 99 | "rpKeepFilesNum": 10, 100 | "rpLogLimitBytes": 5000000, 101 | "rpMaxAgeHours": 24 102 | }, 103 | "setupBackends": [ 104 | "AggregationBK", 105 | "KatipBK" 106 | ], 107 | "setupScribes": [ 108 | { 109 | "scFormat": "ScText", 110 | "scKind": "StdoutSK", 111 | "scName": "stdout", 112 | "scRotation": null 113 | } 114 | ] 115 | } 116 | -------------------------------------------------------------------------------- /cfg-templates/preview/shelley-genesis.json: -------------------------------------------------------------------------------- 1 | { 2 | "activeSlotsCoeff": 0.05, 3 | "epochLength": 86400, 4 | "genDelegs": { 5 | "12b0f443d02861948a0fce9541916b014e8402984c7b83ad70a834ce": { 6 | "delegate": "7c54a168c731f2f44ced620f3cca7c2bd90731cab223d5167aa994e6", 7 | "vrf": "62d546a35e1be66a2b06e29558ef33f4222f1c466adbb59b52d800964d4e60ec" 8 | }, 9 | "3df542796a64e399b60c74acfbdb5afa1e114532fa36b46d6368ef3a": { 10 | "delegate": "c44bc2f3cc7e98c0f227aa399e4035c33c0d775a0985875fff488e20", 11 | "vrf": "4f9d334decadff6eba258b2df8ae1f02580a2628bce47ae7d957e1acd3f42a3c" 12 | }, 13 | "93fd5083ff20e7ab5570948831730073143bea5a5d5539852ed45889": { 14 | "delegate": "82a02922f10105566b70366b07c758c8134fa91b3d8ae697dfa5e8e0", 15 | "vrf": "8a57e94a9b4c65ec575f35d41edb1df399fa30fdf10775389f5d1ef670ca3f9f" 16 | }, 17 | "a86cab3ea72eabb2e8aafbbf4abbd2ba5bdfd04eea26a39b126a78e4": { 18 | "delegate": "10257f6d3bae913514bdc96c9170b3166bf6838cca95736b0e418426", 19 | "vrf": "1b54aad6b013145a0fc74bb5c2aa368ebaf3999e88637d78e09706d0cc29874a" 20 | }, 21 | "b799804a28885bd49c0e1b99d8b3b26de0fac17a5cf651ecf0c872f0": { 22 | "delegate": "ebe606e22d932d51be2c1ce87e7d7e4c9a7d1f7df4a5535c29e23d22", 23 | "vrf": "b3fc06a1f8ee69ff23185d9af453503be8b15b2652e1f9fb7c3ded6797a2d6f9" 24 | }, 25 | "d125812d6ab973a2c152a0525b7fd32d36ff13555a427966a9cac9b1": { 26 | "delegate": "e302198135fb5b00bfe0b9b5623426f7cf03179ab7ba75f945d5b79b", 27 | "vrf": "b45ca2ed95f92248fa0322ce1fc9f815a5a5aa2f21f1adc2c42c4dccfc7ba631" 28 | }, 29 | "ef27651990a26449a40767d5e06cdef1670a3f3ff4b951d385b51787": { 30 | "delegate": "0e0b11e80d958732e587585d30978d683a061831d1b753878f549d05", 31 | "vrf": "b860ec844f6cd476c4fabb4aa1ca72d5c74d82f3835aed3c9515a35b6e048719" 32 | } 33 | }, 34 | "initialFunds": {}, 35 | "maxKESEvolutions": 62, 36 | "maxLovelaceSupply": 45000000000000000, 37 | "networkId": "Testnet", 38 | "networkMagic": 2, 39 | "protocolParams": { 40 | "protocolVersion": { 41 | "minor": 0, 42 | "major": 6 43 | }, 44 | "decentralisationParam": 1, 45 | "eMax": 18, 46 | "extraEntropy": { 47 | "tag": "NeutralNonce" 48 | }, 49 | "maxTxSize": 16384, 50 | "maxBlockBodySize": 65536, 51 | "maxBlockHeaderSize": 1100, 52 | "minFeeA": 44, 53 | "minFeeB": 155381, 54 | "minUTxOValue": 1000000, 55 | "poolDeposit": 500000000, 56 | "minPoolCost": 340000000, 57 | "keyDeposit": 2000000, 58 | "nOpt": 150, 59 | "rho": 0.003, 60 | "tau": 0.20, 61 | "a0": 0.3 62 | }, 63 | "securityParam": 432, 64 | "slotLength": 1, 65 | "slotsPerKESPeriod": 129600, 66 | "systemStart": "2022-10-25T00:00:00Z", 67 | "updateQuorum": 5 68 | } 69 | -------------------------------------------------------------------------------- /cfg-templates/preview/submit-api-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "EnableLogMetrics": false, 3 | "EnableLogging": true, 4 | "GenesisHash": "83de1d7302569ad56cf9139a41e2e11346d4cb4a31c00142557b6ab3fa550761", 5 | "PrometheusPort": 8080, 6 | "RequiresNetworkMagic": "RequiresMagic", 7 | "defaultBackends": [ 8 | "KatipBK" 9 | ], 10 | "defaultScribes": [ 11 | [ 12 | "StdoutSK", 13 | "stdout" 14 | ] 15 | ], 16 | "minSeverity": "Info", 17 | "options": { 18 | "cfokey": { 19 | "value": "Release-1.0.0" 20 | }, 21 | "mapBackends": {}, 22 | "mapSeverity": { 23 | "db-sync-node": "Info", 24 | "db-sync-node.Mux": "Error", 25 | "db-sync-node.Subscription": "Error" 26 | }, 27 | "mapSubtrace": { 28 | "#ekgview": { 29 | "contents": [ 30 | [ 31 | { 32 | "contents": "cardano.epoch-validation.benchmark", 33 | "tag": "Contains" 34 | }, 35 | [ 36 | { 37 | "contents": ".monoclock.basic.", 38 | "tag": "Contains" 39 | } 40 | ] 41 | ], 42 | [ 43 | { 44 | "contents": "cardano.epoch-validation.benchmark", 45 | "tag": "Contains" 46 | }, 47 | [ 48 | { 49 | "contents": "diff.RTS.cpuNs.timed.", 50 | "tag": "Contains" 51 | } 52 | ] 53 | ], 54 | [ 55 | { 56 | "contents": "#ekgview.#aggregation.cardano.epoch-validation.benchmark", 57 | "tag": "StartsWith" 58 | }, 59 | [ 60 | { 61 | "contents": "diff.RTS.gcNum.timed.", 62 | "tag": "Contains" 63 | } 64 | ] 65 | ] 66 | ], 67 | "subtrace": "FilterTrace" 68 | }, 69 | "#messagecounters.aggregation": { 70 | "subtrace": "NoTrace" 71 | }, 72 | "#messagecounters.ekgview": { 73 | "subtrace": "NoTrace" 74 | }, 75 | "#messagecounters.katip": { 76 | "subtrace": "NoTrace" 77 | }, 78 | "#messagecounters.monitoring": { 79 | "subtrace": "NoTrace" 80 | }, 81 | "#messagecounters.switchboard": { 82 | "subtrace": "NoTrace" 83 | }, 84 | "benchmark": { 85 | "contents": [ 86 | "GhcRtsStats", 87 | "MonotonicClock" 88 | ], 89 | "subtrace": "ObservableTrace" 90 | }, 91 | "cardano.epoch-validation.utxo-stats": { 92 | "subtrace": "NoTrace" 93 | } 94 | } 95 | }, 96 | "rotation": { 97 | "rpKeepFilesNum": 10, 98 | "rpLogLimitBytes": 5000000, 99 | "rpMaxAgeHours": 24 100 | }, 101 | "setupBackends": [ 102 | "AggregationBK", 103 | "KatipBK" 104 | ], 105 | "setupScribes": [ 106 | { 107 | "scFormat": "ScText", 108 | "scKind": "StdoutSK", 109 | "scName": "stdout", 110 | "scRotation": null 111 | } 112 | ] 113 | } 114 | -------------------------------------------------------------------------------- /cfg-templates/preview/topology.json: -------------------------------------------------------------------------------- 1 | { 2 | "bootstrapPeers": [ 3 | { 4 | "address": "preview-node.play.dev.cardano.org", 5 | "port": 3001 6 | } 7 | ], 8 | "localRoots": [ 9 | { 10 | "accessPoints": [], 11 | "advertise": false, 12 | "trustable": false, 13 | "valency": 1 14 | } 15 | ], 16 | "publicRoots": [ 17 | { 18 | "accessPoints": [], 19 | "advertise": false 20 | } 21 | ], 22 | "useLedgerAfterSlot": 53827185 23 | } 24 | -------------------------------------------------------------------------------- /cfg-templates/test/VARS: -------------------------------------------------------------------------------- 1 | export NETWORK_ARGUMENT="--testnet-magic 1097911063" 2 | export NETWORK_TAG=0 3 | export HARDFORK_EPOCH=1 4 | -------------------------------------------------------------------------------- /cfg-templates/test/alonzo-genesis.json: -------------------------------------------------------------------------------- 1 | { 2 | "lovelacePerUTxOWord": 34482, 3 | "executionPrices": { 4 | "prSteps": 5 | { 6 | "numerator" : 721, 7 | "denominator" : 10000000 8 | }, 9 | "prMem": 10 | { 11 | "numerator" : 577, 12 | "denominator" : 10000 13 | } 14 | }, 15 | "maxTxExUnits": { 16 | "exUnitsMem": 10000000, 17 | "exUnitsSteps": 10000000000 18 | }, 19 | "maxBlockExUnits": { 20 | "exUnitsMem": 50000000, 21 | "exUnitsSteps": 40000000000 22 | }, 23 | "maxValueSize": 5000, 24 | "collateralPercentage": 150, 25 | "maxCollateralInputs": 3, 26 | "costModels": { 27 | "PlutusV1": { 28 | "sha2_256-memory-arguments": 4, 29 | "equalsString-cpu-arguments-constant": 1000, 30 | "cekDelayCost-exBudgetMemory": 100, 31 | "lessThanEqualsByteString-cpu-arguments-intercept": 103599, 32 | "divideInteger-memory-arguments-minimum": 1, 33 | "appendByteString-cpu-arguments-slope": 621, 34 | "blake2b-cpu-arguments-slope": 29175, 35 | "iData-cpu-arguments": 150000, 36 | "encodeUtf8-cpu-arguments-slope": 1000, 37 | "unBData-cpu-arguments": 150000, 38 | "multiplyInteger-cpu-arguments-intercept": 61516, 39 | "cekConstCost-exBudgetMemory": 100, 40 | "nullList-cpu-arguments": 150000, 41 | "equalsString-cpu-arguments-intercept": 150000, 42 | "trace-cpu-arguments": 150000, 43 | "mkNilData-memory-arguments": 32, 44 | "lengthOfByteString-cpu-arguments": 150000, 45 | "cekBuiltinCost-exBudgetCPU": 29773, 46 | "bData-cpu-arguments": 150000, 47 | "subtractInteger-cpu-arguments-slope": 0, 48 | "unIData-cpu-arguments": 150000, 49 | "consByteString-memory-arguments-intercept": 0, 50 | "divideInteger-memory-arguments-slope": 1, 51 | "divideInteger-cpu-arguments-model-arguments-slope": 118, 52 | "listData-cpu-arguments": 150000, 53 | "headList-cpu-arguments": 150000, 54 | "chooseData-memory-arguments": 32, 55 | "equalsInteger-cpu-arguments-intercept": 136542, 56 | "sha3_256-cpu-arguments-slope": 82363, 57 | "sliceByteString-cpu-arguments-slope": 5000, 58 | "unMapData-cpu-arguments": 150000, 59 | "lessThanInteger-cpu-arguments-intercept": 179690, 60 | "mkCons-cpu-arguments": 150000, 61 | "appendString-memory-arguments-intercept": 0, 62 | "modInteger-cpu-arguments-model-arguments-slope": 118, 63 | "ifThenElse-cpu-arguments": 1, 64 | "mkNilPairData-cpu-arguments": 150000, 65 | "lessThanEqualsInteger-cpu-arguments-intercept": 145276, 66 | "addInteger-memory-arguments-slope": 1, 67 | "chooseList-memory-arguments": 32, 68 | "constrData-memory-arguments": 32, 69 | "decodeUtf8-cpu-arguments-intercept": 150000, 70 | "equalsData-memory-arguments": 1, 71 | "subtractInteger-memory-arguments-slope": 1, 72 | "appendByteString-memory-arguments-intercept": 0, 73 | "lengthOfByteString-memory-arguments": 4, 74 | "headList-memory-arguments": 32, 75 | "listData-memory-arguments": 32, 76 | "consByteString-cpu-arguments-intercept": 150000, 77 | "unIData-memory-arguments": 32, 78 | "remainderInteger-memory-arguments-minimum": 1, 79 | "bData-memory-arguments": 32, 80 | "lessThanByteString-cpu-arguments-slope": 248, 81 | "encodeUtf8-memory-arguments-intercept": 0, 82 | "cekStartupCost-exBudgetCPU": 100, 83 | "multiplyInteger-memory-arguments-intercept": 0, 84 | "unListData-memory-arguments": 32, 85 | "remainderInteger-cpu-arguments-model-arguments-slope": 118, 86 | "cekVarCost-exBudgetCPU": 29773, 87 | "remainderInteger-memory-arguments-slope": 1, 88 | "cekForceCost-exBudgetCPU": 29773, 89 | "sha2_256-cpu-arguments-slope": 29175, 90 | "equalsInteger-memory-arguments": 1, 91 | "indexByteString-memory-arguments": 1, 92 | "addInteger-memory-arguments-intercept": 1, 93 | "chooseUnit-cpu-arguments": 150000, 94 | "sndPair-cpu-arguments": 150000, 95 | "cekLamCost-exBudgetCPU": 29773, 96 | "fstPair-cpu-arguments": 150000, 97 | "quotientInteger-memory-arguments-minimum": 1, 98 | "decodeUtf8-cpu-arguments-slope": 1000, 99 | "lessThanInteger-memory-arguments": 1, 100 | "lessThanEqualsInteger-cpu-arguments-slope": 1366, 101 | "fstPair-memory-arguments": 32, 102 | "modInteger-memory-arguments-intercept": 0, 103 | "unConstrData-cpu-arguments": 150000, 104 | "lessThanEqualsInteger-memory-arguments": 1, 105 | "chooseUnit-memory-arguments": 32, 106 | "sndPair-memory-arguments": 32, 107 | "addInteger-cpu-arguments-intercept": 197209, 108 | "decodeUtf8-memory-arguments-slope": 8, 109 | "equalsData-cpu-arguments-intercept": 150000, 110 | "mapData-cpu-arguments": 150000, 111 | "mkPairData-cpu-arguments": 150000, 112 | "quotientInteger-cpu-arguments-constant": 148000, 113 | "consByteString-memory-arguments-slope": 1, 114 | "cekVarCost-exBudgetMemory": 100, 115 | "indexByteString-cpu-arguments": 150000, 116 | "unListData-cpu-arguments": 150000, 117 | "equalsInteger-cpu-arguments-slope": 1326, 118 | "cekStartupCost-exBudgetMemory": 100, 119 | "subtractInteger-cpu-arguments-intercept": 197209, 120 | "divideInteger-cpu-arguments-model-arguments-intercept": 425507, 121 | "divideInteger-memory-arguments-intercept": 0, 122 | "cekForceCost-exBudgetMemory": 100, 123 | "blake2b-cpu-arguments-intercept": 2477736, 124 | "remainderInteger-cpu-arguments-constant": 148000, 125 | "tailList-cpu-arguments": 150000, 126 | "encodeUtf8-cpu-arguments-intercept": 150000, 127 | "equalsString-cpu-arguments-slope": 1000, 128 | "lessThanByteString-memory-arguments": 1, 129 | "multiplyInteger-cpu-arguments-slope": 11218, 130 | "appendByteString-cpu-arguments-intercept": 396231, 131 | "lessThanEqualsByteString-cpu-arguments-slope": 248, 132 | "modInteger-memory-arguments-slope": 1, 133 | "addInteger-cpu-arguments-slope": 0, 134 | "equalsData-cpu-arguments-slope": 10000, 135 | "decodeUtf8-memory-arguments-intercept": 0, 136 | "chooseList-cpu-arguments": 150000, 137 | "constrData-cpu-arguments": 150000, 138 | "equalsByteString-memory-arguments": 1, 139 | "cekApplyCost-exBudgetCPU": 29773, 140 | "quotientInteger-memory-arguments-slope": 1, 141 | "verifySignature-cpu-arguments-intercept": 3345831, 142 | "unMapData-memory-arguments": 32, 143 | "mkCons-memory-arguments": 32, 144 | "sliceByteString-memory-arguments-slope": 1, 145 | "sha3_256-memory-arguments": 4, 146 | "ifThenElse-memory-arguments": 1, 147 | "mkNilPairData-memory-arguments": 32, 148 | "equalsByteString-cpu-arguments-slope": 247, 149 | "appendString-cpu-arguments-intercept": 150000, 150 | "quotientInteger-cpu-arguments-model-arguments-slope": 118, 151 | "cekApplyCost-exBudgetMemory": 100, 152 | "equalsString-memory-arguments": 1, 153 | "multiplyInteger-memory-arguments-slope": 1, 154 | "cekBuiltinCost-exBudgetMemory": 100, 155 | "remainderInteger-memory-arguments-intercept": 0, 156 | "sha2_256-cpu-arguments-intercept": 2477736, 157 | "remainderInteger-cpu-arguments-model-arguments-intercept": 425507, 158 | "lessThanEqualsByteString-memory-arguments": 1, 159 | "tailList-memory-arguments": 32, 160 | "mkNilData-cpu-arguments": 150000, 161 | "chooseData-cpu-arguments": 150000, 162 | "unBData-memory-arguments": 32, 163 | "blake2b-memory-arguments": 4, 164 | "iData-memory-arguments": 32, 165 | "nullList-memory-arguments": 32, 166 | "cekDelayCost-exBudgetCPU": 29773, 167 | "subtractInteger-memory-arguments-intercept": 1, 168 | "lessThanByteString-cpu-arguments-intercept": 103599, 169 | "consByteString-cpu-arguments-slope": 1000, 170 | "appendByteString-memory-arguments-slope": 1, 171 | "trace-memory-arguments": 32, 172 | "divideInteger-cpu-arguments-constant": 148000, 173 | "cekConstCost-exBudgetCPU": 29773, 174 | "encodeUtf8-memory-arguments-slope": 8, 175 | "quotientInteger-cpu-arguments-model-arguments-intercept": 425507, 176 | "mapData-memory-arguments": 32, 177 | "appendString-cpu-arguments-slope": 1000, 178 | "modInteger-cpu-arguments-constant": 148000, 179 | "verifySignature-cpu-arguments-slope": 1, 180 | "unConstrData-memory-arguments": 32, 181 | "quotientInteger-memory-arguments-intercept": 0, 182 | "equalsByteString-cpu-arguments-constant": 150000, 183 | "sliceByteString-memory-arguments-intercept": 0, 184 | "mkPairData-memory-arguments": 32, 185 | "equalsByteString-cpu-arguments-intercept": 112536, 186 | "appendString-memory-arguments-slope": 1, 187 | "lessThanInteger-cpu-arguments-slope": 497, 188 | "modInteger-cpu-arguments-model-arguments-intercept": 425507, 189 | "modInteger-memory-arguments-minimum": 1, 190 | "sha3_256-cpu-arguments-intercept": 0, 191 | "verifySignature-memory-arguments": 1, 192 | "cekLamCost-exBudgetMemory": 100, 193 | "sliceByteString-cpu-arguments-intercept": 150000 194 | } 195 | } 196 | } 197 | -------------------------------------------------------------------------------- /cfg-templates/test/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "AlonzoGenesisFile": "testnet-alonzo-genesis.json", 3 | "AlonzoGenesisHash": "7e94a15f55d1e82d10f09203fa1d40f8eede58fd8066542cf6566008068ed874", 4 | "ApplicationName": "cardano-sl", 5 | "ApplicationVersion": 0, 6 | "ByronGenesisFile": "testnet-byron-genesis.json", 7 | "ByronGenesisHash": "96fceff972c2c06bd3bb5243c39215333be6d56aaf4823073dca31afe5038471", 8 | "LastKnownBlockVersion-Alt": 0, 9 | "LastKnownBlockVersion-Major": 3, 10 | "LastKnownBlockVersion-Minor": 0, 11 | "MaxKnownMajorProtocolVersion": 2, 12 | "Protocol": "Cardano", 13 | "RequiresNetworkMagic": "RequiresMagic", 14 | "ShelleyGenesisFile": "testnet-shelley-genesis.json", 15 | "ShelleyGenesisHash": "849a1764f152e1b09c89c0dfdbcbdd38d711d1fec2db5dfa0f87cf2737a0eaf4", 16 | "TraceBlockFetchClient": false, 17 | "TraceBlockFetchDecisions": false, 18 | "TraceBlockFetchProtocol": false, 19 | "TraceBlockFetchProtocolSerialised": false, 20 | "TraceBlockFetchServer": false, 21 | "TraceChainDb": true, 22 | "TraceChainSyncBlockServer": false, 23 | "TraceChainSyncClient": false, 24 | "TraceChainSyncHeaderServer": false, 25 | "TraceChainSyncProtocol": false, 26 | "TraceConnectionManager": true, 27 | "TraceDNSResolver": true, 28 | "TraceDNSSubscription": true, 29 | "TraceDiffusionInitialization": true, 30 | "TraceErrorPolicy": true, 31 | "TraceForge": true, 32 | "TraceHandshake": false, 33 | "TraceInboundGovernor": true, 34 | "TraceIpSubscription": true, 35 | "TraceLedgerPeers": true, 36 | "TraceLocalChainSyncProtocol": false, 37 | "TraceLocalErrorPolicy": true, 38 | "TraceLocalHandshake": false, 39 | "TraceLocalRootPeers": true, 40 | "TraceLocalTxSubmissionProtocol": false, 41 | "TraceLocalTxSubmissionServer": false, 42 | "TraceMempool": true, 43 | "TraceMux": false, 44 | "TracePeerSelection": true, 45 | "TracePeerSelectionActions": true, 46 | "TracePublicRootPeers": true, 47 | "TraceServer": true, 48 | "TraceTxInbound": false, 49 | "TraceTxOutbound": false, 50 | "TraceTxSubmissionProtocol": false, 51 | "TracingVerbosity": "NormalVerbosity", 52 | "TurnOnLogMetrics": true, 53 | "TurnOnLogging": true, 54 | "defaultBackends": [ 55 | "KatipBK" 56 | ], 57 | "defaultScribes": [ 58 | [ 59 | "StdoutSK", 60 | "stdout" 61 | ] 62 | ], 63 | "hasEKG": 12788, 64 | "hasPrometheus": [ 65 | "127.0.0.1", 66 | 12798 67 | ], 68 | "minSeverity": "Info", 69 | "options": { 70 | "mapBackends": { 71 | "cardano.node.metrics": [ 72 | "EKGViewBK" 73 | ], 74 | "cardano.node.resources": [ 75 | "EKGViewBK" 76 | ] 77 | }, 78 | "mapSubtrace": { 79 | "cardano.node.metrics": { 80 | "subtrace": "Neutral" 81 | } 82 | } 83 | }, 84 | "rotation": { 85 | "rpKeepFilesNum": 10, 86 | "rpLogLimitBytes": 5000000, 87 | "rpMaxAgeHours": 24 88 | }, 89 | "setupBackends": [ 90 | "KatipBK" 91 | ], 92 | "setupScribes": [ 93 | { 94 | "scFormat": "ScText", 95 | "scKind": "StdoutSK", 96 | "scName": "stdout", 97 | "scRotation": null 98 | } 99 | ] 100 | } 101 | -------------------------------------------------------------------------------- /cfg-templates/test/shelley-genesis.json: -------------------------------------------------------------------------------- 1 | { 2 | "activeSlotsCoeff": 0.05, 3 | "protocolParams": { 4 | "protocolVersion": { 5 | "minor": 0, 6 | "major": 2 7 | }, 8 | "decentralisationParam": 1, 9 | "eMax": 18, 10 | "extraEntropy": { 11 | "tag": "NeutralNonce" 12 | }, 13 | "maxTxSize": 16384, 14 | "maxBlockBodySize": 65536, 15 | "maxBlockHeaderSize": 1100, 16 | "minFeeA": 44, 17 | "minFeeB": 155381, 18 | "minUTxOValue": 1000000, 19 | "poolDeposit": 500000000, 20 | "minPoolCost": 340000000, 21 | "keyDeposit": 2000000, 22 | "nOpt": 150, 23 | "rho": 0.003, 24 | "tau": 0.20, 25 | "a0": 0.3 26 | }, 27 | "genDelegs": { 28 | "2f56e87d67b8e5216582cfeb95dbdc9083110a3ef68faaa51bef3a80": { 29 | "delegate": "bd5933d3c5417f17a64c7214711a26abc3bc03e2c90dc1bb38e0c39f", 30 | "vrf": "9a0b0f537874d089cedfa9e250150405e47ea29acee87c40a223ae0a175d26f8" 31 | }, 32 | "514e81afb082fce01678809eebd90eda4f7918354ec7d0433ad16274": { 33 | "delegate": "eff1b5b26e65b791d6f236c7c0264012bd1696759d22bdb4dd0f6f56", 34 | "vrf": "e6f70fb10c7523aa76648e20d17e65fd9b2ed53960fbd20b308f223b703f2e23" 35 | }, 36 | "2fca486b4d8f1a0432f5bf18ef473ee4294c795a1a32e3132bc6b90f": { 37 | "delegate": "de665a71064706f946030505eae950583f08c316f0f58997961092b1", 38 | "vrf": "c3fde629add60e30142cd7ef3c680610975208b08aee42203a5c40ad5992e8f6" 39 | }, 40 | "4ee98623920698b77c1c7f77288cbdac5f9011ff8970b1f507567d0d": { 41 | "delegate": "bf07107c6f632de95e34af7e009d2aafa19916c7ba89b944fbedcd72", 42 | "vrf": "9d7d12e3d6b02835be3e76cfc6ae93d937035ee0e006d04a0eef9dea19754e21" 43 | }, 44 | "0d06d2547ed371fdf95fb5c4c735eecdd53e6a5bb831561bd0fcfd3d": { 45 | "delegate": "6df3e1b4b8a84c63c805076a85e5aa00924997a4eae85fddf0aee3ca", 46 | "vrf": "0774e5810fe02a014ec97ef424797172f2b8c5dcfb6e4cfc98b411c31d5096d8" 47 | }, 48 | "581e23030b6038bae716e5d64b9e053db10541b12e6b0b4eff485454": { 49 | "delegate": "b0dca078b823cde627da136200d6618c49ad712b77972a1c5e135763", 50 | "vrf": "16a4e883b72ddbd09a4f8a1170fc346ab11e4202f814faa73e9d2433ee03e7b0" 51 | }, 52 | "e5f27655371b54aed91cc916b2569060978be80056768fee2cc5ce1b": { 53 | "delegate": "b3873a254459f506e47b9a252ee7912e538b364447f31576a170db65", 54 | "vrf": "cc5c897fdf5db0017326656fe35aeb20c72b175540793f9b9b8dc9ade001bbc4" 55 | } 56 | }, 57 | "updateQuorum": 5, 58 | "networkId": "Testnet", 59 | "initialFunds": {}, 60 | "maxLovelaceSupply": 45000000000000000, 61 | "networkMagic": 1097911063, 62 | "epochLength": 432000, 63 | "systemStart": "2019-07-24T20:20:16Z", 64 | "slotsPerKESPeriod": 129600, 65 | "slotLength": 1, 66 | "maxKESEvolutions": 62, 67 | "securityParam": 2160 68 | } 69 | -------------------------------------------------------------------------------- /cfg-templates/test/topology-relay-p2p.json: -------------------------------------------------------------------------------- 1 | { 2 | "localRoots": [], 3 | "publicRoots": [ 4 | { "accessPoints": [ 5 | { 6 | "address": "relays-new.cardano-testnet.iohkdev.io", 7 | "port": 3001 8 | } 9 | ], 10 | "advertise": false 11 | } 12 | ], 13 | "useLedgerAfterSlot": 0 14 | } -------------------------------------------------------------------------------- /cfg-templates/test/topology-relay.json: -------------------------------------------------------------------------------- 1 | { 2 | "Producers": [ 3 | { 4 | "addr": "relays-new.cardano-testnet.iohkdev.io", 5 | "port": 3001, 6 | "valency": 2 7 | } 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /cfg-templates/test/topology.json: -------------------------------------------------------------------------------- 1 | { 2 | "Producers": [] 3 | } 4 | -------------------------------------------------------------------------------- /examples/main-producing.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | docker network create -d bridge cardano 4 | docker run -it --rm \ 5 | --network=cardano \ 6 | --name main-producing \ 7 | -p 3000:3000 \ 8 | -p 12798:12798 \ 9 | -e HOST_ADDR="0.0.0.0" \ 10 | -e NODE_PORT="3000" \ 11 | -e NODE_NAME="block-producing" \ 12 | -e NODE_TOPOLOGY=":3000/1" \ 13 | -e CARDANO_NETWORK="main" \ 14 | -e PROMETHEUS_PORT="12798" \ 15 | -v $PWD/config/:/config/ \ 16 | arradev/cardano-pool:latest --start --staking -------------------------------------------------------------------------------- /examples/main-registration.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | docker network create -d bridge cardano 4 | docker run -it --rm \ 5 | --name main-registration \ 6 | --network=cardano \ 7 | -e NODE_PORT="3000" \ 8 | -e NODE_NAME="registration" \ 9 | -e NODE_TOPOLOGY=":3000/1" \ 10 | -e CARDANO_NETWORK="main" \ 11 | -e CREATE_STAKEPOOL="True" \ 12 | -e POOL_PLEDGE="100000000000" \ 13 | -e POOL_COST="340000000" \ 14 | -e POOL_MARGIN="0.05" \ 15 | -e METADATA_URL="" \ 16 | -v $PWD/config/:/config/ \ 17 | arradev/cardano-pool:latest --start --create --staking 18 | -------------------------------------------------------------------------------- /examples/main-relay1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | docker network create -d bridge cardano 4 | docker run -it \ 5 | --restart=unless-stopped \ 6 | --network=cardano \ 7 | --name main-relay1 \ 8 | -p 3000:3000 \ 9 | -p 12798:12798 \ 10 | -e HOST_ADDR="0.0.0.0" \ 11 | -e NODE_PORT="3000" \ 12 | -e NODE_NAME="relay1" \ 13 | -e NODE_TOPOLOGY=":3000/1" \ 14 | -e NODE_RELAY="True" \ 15 | -e CARDANO_NETWORK="main" \ 16 | -e PROMETHEUS_PORT="12798" \ 17 | -v $PWD/config/:/config/ \ 18 | arradev/cardano-pool:latest --start -------------------------------------------------------------------------------- /examples/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Example Pool", 3 | "description": "Cardano stakepool example", 4 | "ticker": "TEST", 5 | "homepage": "https://github.com/abracadaniel/cardano-node-docker" 6 | } -------------------------------------------------------------------------------- /examples/test/docker-compose.yaml: -------------------------------------------------------------------------------- 1 | version: "3.3" 2 | services: 3 | mc4-producing: # block-producing node 4 | image: arradev/cardano-pool:latest 5 | stdin_open: true # docker run -i 6 | tty: true # docker run -t 7 | container_name: test-producing 8 | network_mode: host 9 | volumes: 10 | - $PWD/config/local/:/config 11 | environment: 12 | - HOST_ADDR=0.0.0.0 13 | - NODE_PORT=3000 14 | - NODE_NAME=test-producing 15 | - NODE_TOPOLOGY=127.0.0.1:3001/1 16 | - NODE_RELAY=False 17 | - CARDANO_NETWORK=test 18 | - EKG_PORT=12888 19 | - PROMETHEUS_PORT=12898 20 | - PROMETHEUS_HOST=127.0.0.1 21 | - POOL_PLEDGE=100000000000 22 | - POOL_COST=340000000 23 | - POOL_MARGIN=0.05 24 | - METADATA_URL=https://gist.githubusercontent.com/abracadaniel/58dfa2cfe0f986c7f445deb151ed1b49/raw/4bb8155af7be65d7e9869f0923c7ce778c75368b/metadata.json 25 | - PUBLIC_RELAY_IP=PUBLIC 26 | command: --start --staking --create 27 | restart: unless-stopped 28 | mc4-relay1: # relay node 29 | image: arradev/cardano-pool:latest 30 | stdin_open: true # docker run -i 31 | tty: true # docker run -t 32 | container_name: test-relay1 33 | network_mode: host 34 | volumes: 35 | - $PWD/config/local/:/config 36 | environment: 37 | - HOST_ADDR=0.0.0.0 38 | - NODE_PORT=3001 39 | - NODE_NAME=test-relay1 40 | - NODE_TOPOLOGY=127.0.0.1:3000/1 41 | - NODE_RELAY=True 42 | - CARDANO_NETWORK=test 43 | - EKG_PORT=12889 44 | - PROMETHEUS_PORT=12899 45 | - PROMETHEUS_HOST=127.0.0.1 46 | command: --start 47 | restart: unless-stopped -------------------------------------------------------------------------------- /monitoring/README.md: -------------------------------------------------------------------------------- 1 | # Work in progress 2 | 3 | See 4 | https://docs.cardano.org/projects/cardano-node/en/latest/logging-monitoring/prometheus.html 5 | https://docs.cardano.org/projects/cardano-node/en/latest/logging-monitoring/grafana.html -------------------------------------------------------------------------------- /monitoring/nginx/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nginx:alpine 2 | LABEL maintainer="dro@arrakis.it" 3 | 4 | EXPOSE 9091 5 | 6 | ENV PROMETHEUS_HOST="prometheus" \ 7 | USER="" \ 8 | PASSWORD="" 9 | 10 | RUN apk add --no-cache apache2-utils 11 | RUN mkdir -p /config/ 12 | ADD nginx.tmpl.conf /nginx.tmpl.conf 13 | ADD entrypoint.sh entrypoint.sh 14 | 15 | ENTRYPOINT [ "/entrypoint.sh" ] -------------------------------------------------------------------------------- /monitoring/nginx/README.md: -------------------------------------------------------------------------------- 1 | # prometheus-nginx proxy 2 | 3 | For securing the prometheus endpoint by adding a nginx reverse proxy with basic auth and tls encryption 4 | 5 | See 6 | https://prometheus.io/docs/guides/tls-encryption/ 7 | https://prometheus.io/docs/guides/basic-auth/ -------------------------------------------------------------------------------- /monitoring/nginx/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | docker build -t arrakis/nginx-prometheus . 4 | -------------------------------------------------------------------------------- /monitoring/nginx/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Init config 4 | echo "Generating config" 5 | cp /nginx.tmpl.conf /config/nginx.conf 6 | sed -i "s/\[PROMETHEUS_HOST\]/${PROMETHEUS_HOST}/g" /config/nginx.conf 7 | cat /config/nginx.conf 8 | echo "" 9 | 10 | # Generate password 11 | htpasswd -b -c /config/htpasswd ${USER} ${PASSWORD} 12 | 13 | echo "Starting nginx" 14 | nginx -g "daemon off;" -c /config/nginx.conf -------------------------------------------------------------------------------- /monitoring/nginx/nginx.tmpl.conf: -------------------------------------------------------------------------------- 1 | user nginx; 2 | worker_processes auto; 3 | 4 | error_log /var/log/nginx/error.log warn; 5 | pid /var/run/nginx.pid; 6 | 7 | events { 8 | worker_connections 1024; 9 | } 10 | 11 | http { 12 | include /etc/nginx/mime.types; 13 | default_type application/octet-stream; 14 | 15 | log_format main '$remote_addr - $remote_user [$time_local] "$request" ' 16 | '$status $body_bytes_sent "$http_referer" ' 17 | '"$http_user_agent" "$http_x_forwarded_for"'; 18 | access_log /var/log/nginx/access.log main; 19 | sendfile on; 20 | keepalive_timeout 65; 21 | 22 | server { 23 | listen 9091; 24 | 25 | location / { 26 | auth_basic "Prometheus"; 27 | auth_basic_user_file /config/htpasswd; 28 | 29 | proxy_pass http://[PROMETHEUS_HOST]:9090/; 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /monitoring/prometheus/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM prom/prometheus:latest 2 | LABEL maintainer="dro@arrakis.it" 3 | 4 | EXPOSE 9090 5 | 6 | #alias/host:port 7 | ENV TARGETS="relay1/relay1:12798,producing1/producing1:12798" 8 | 9 | USER root 10 | ADD config.tmpl.yml /config.tmpl.yml 11 | ADD entrypoint.sh /entrypoint.sh 12 | RUN chmod 755 /entrypoint.sh 13 | RUN mkdir /config/ 14 | 15 | ENTRYPOINT ["/entrypoint.sh"] 16 | -------------------------------------------------------------------------------- /monitoring/prometheus/README.md: -------------------------------------------------------------------------------- 1 | # cardano-node prometheus 2 | 3 | To connect to and scrape data from the prometheus services in the cardano-nodes. 4 | 5 | ## Environment Variables 6 | TARGETS="ALIAS1/IP:PORT,ALIAS2/IP:PORT" -------------------------------------------------------------------------------- /monitoring/prometheus/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | docker build -t arrakis/cardano-prometheus . 4 | -------------------------------------------------------------------------------- /monitoring/prometheus/config.tmpl.yml: -------------------------------------------------------------------------------- 1 | global: 2 | scrape_interval: 15s # By default, scrape targets every 15 seconds. 3 | 4 | # Attach these labels to any time series or alerts when communicating with 5 | # external systems (federation, remote storage, Alertmanager). 6 | external_labels: 7 | monitor: 'codelab-monitor' 8 | 9 | # A scrape configuration containing exactly one endpoint to scrape: 10 | # Here it's Prometheus itself. 11 | scrape_configs: 12 | # The job name is added as a label job= to any timeseries scraped from this config. 13 | - job_name: 'prometheus' 14 | 15 | # Override the global default and scrape targets from this job every 5 seconds. 16 | scrape_interval: 5s 17 | 18 | static_configs: 19 | - targets: ['[NODE_HOST]:[NODE_PORT]'] 20 | labels: 21 | alias: '[NODE_ALIAS]' 22 | type: 'cardano-node' -------------------------------------------------------------------------------- /monitoring/prometheus/config.yml: -------------------------------------------------------------------------------- 1 | global: 2 | external_labels: 3 | monitor: codelab-monitor 4 | scrape_interval: 15s 5 | scrape_configs: 6 | - job_name: prometheus 7 | scrape_interval: 5s 8 | static_configs: 9 | - labels: 10 | alias: relay1 11 | type: cardano-node 12 | targets: 13 | - relay1:12798 14 | - labels: 15 | alias: producing1 16 | type: cardano-node 17 | targets: 18 | - producing1:12798 19 | -------------------------------------------------------------------------------- /monitoring/prometheus/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Init config 4 | mkdir -p /config/ 5 | if [ ! -f "/config/config.yml" ]; then 6 | python /init_config.py /config.tmpl.yml /config/config.yml 7 | fi 8 | 9 | prometheus --config.file=/config/config.yml --storage.tsdb.path=/config/data/ -------------------------------------------------------------------------------- /monitoring/prometheus/init_config.py: -------------------------------------------------------------------------------- 1 | import os 2 | import yaml 3 | import sys 4 | 5 | 6 | def parse_targets(targets_str): 7 | if not targets_str: return None 8 | 9 | output = [] 10 | targets = targets_str.split(',') 11 | for target in targets: 12 | alias, host = target.split('/') 13 | addr, port = host.split(':') 14 | 15 | output.append({ 16 | 'targets': ['%s:%s' % (addr, port)], 17 | 'labels': { 18 | 'alias': alias, 19 | 'type': 'cardano-node' 20 | } 21 | }) 22 | return output 23 | 24 | in_file = sys.argv[1] 25 | out_file = sys.argv[2] 26 | targets = parse_targets(os.environ.get('TARGETS')) 27 | if targets: 28 | with open(in_file) as file: 29 | config = yaml.full_load(file) 30 | print(config) 31 | print(targets) 32 | config['scrape_configs'][0]['static_configs'] = targets 33 | 34 | with open(out_file, 'w') as _file: 35 | documents = yaml.dump(config, _file) -------------------------------------------------------------------------------- /monitoring/prometheus/requirements.txt: -------------------------------------------------------------------------------- 1 | pyyaml -------------------------------------------------------------------------------- /scripts/cexplorer_pool_stats: -------------------------------------------------------------------------------- 1 | #!/bin/bash -l 2 | 3 | source /scripts/init_node_vars 4 | 5 | POOL_ID=$(bech32 pool <<< $(cat ${NODE_PATH}/staking/POOL_ID)) 6 | 7 | POOL_STATS_DIR=${NODE_PATH}/pool_stats 8 | mkdir -p $POOL_STATS_DIR 9 | 10 | curl https://js.cexplorer.io/api-static/pool/${POOL_ID}.json 2>/dev/null | jq '.data' | jq 'del(.stats, .url , .img, .updated, .handles, .pool_id, .name, .pool_id_hash)' | tr -d \\\"{},: | awk NF | sed -e 's/^[ \t]*/cexplorer_/' > ${POOL_STATS_DIR}/cexplorer.prom -------------------------------------------------------------------------------- /scripts/cold_create: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source /scripts/init_node_vars 4 | export WAIT_FOR_SYNC=False 5 | 6 | echo "Creating Stake Pool addresses, keys and certificates, to be submitted to the blockchain." 7 | 8 | # If staking/ directory exists create a backup 9 | if [ -d "${NODE_PATH}/staking/" ]; then 10 | TIMESTAMP=$(date +%s) 11 | BACKUPNAME="staking.${TIMESTAMP}.tar.gz" 12 | echo "staking directory already exists." 13 | echo "Backing up to ${BACKUPNAME}." 14 | mkdir -p ${NODE_PATH}/backups/ 15 | tar -zcvf ${NODE_PATH}/backups/${BACKUPNAME} ${NODE_PATH}/staking/ > /dev/null 16 | fi 17 | 18 | # Start creation 19 | generate_wallet owner 20 | register_stake_address owner --cold-create 21 | 22 | tar -zcvf wallets-hot.tar.gz --exclude='*.skey' staking/wallets/ 23 | 24 | ## Generate wallets for multiple owners 25 | if [ -n "$MULTI_OWNERS" ]; then 26 | for i in $(echo ${MULTI_OWNERS} | sed "s/,/ /g") 27 | do 28 | generate_wallet $i 29 | register_stake_address $i --cold-create 30 | done 31 | fi 32 | 33 | generate_operational_certificate 34 | generate_registration_certificates --cold-create 35 | register_stake_pool --cold-create 36 | 37 | echo "Archiving required files" 38 | cd ${NODE_PATH} && tar -zcvf staking-hot.tar.gz --exclude='cold-keys' --exclude='wallets/*/*.skey' staking/ 39 | 40 | echo "Created all addresses, certificates and transactions. Upload the \`staking-hot.tar.gz\` file to your live node, and submit the registration transaction by running with the \`--cold-register\`." 41 | read -------------------------------------------------------------------------------- /scripts/cold_create_new: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source /scripts/init_node_vars 4 | source /scripts/functions/wait_for_file 5 | export WAIT_FOR_SYNC=False 6 | 7 | echo "Creating Stake Pool addresses, keys and certificates, to be submitted to the blockchain." 8 | 9 | # If staking/ directory exists create a backup 10 | if [ -d "${NODE_PATH}/staking/" ]; then 11 | TIMESTAMP=$(date +%s) 12 | BACKUPNAME="staking.${TIMESTAMP}.tar.gz" 13 | echo "staking directory already exists." 14 | echo "Backing up to ${BACKUPNAME}." 15 | mkdir -p ${NODE_PATH}/backups/ 16 | tar -zcvf ${NODE_PATH}/backups/${BACKUPNAME} ${NODE_PATH}/staking/ > /dev/null 17 | fi 18 | 19 | # Step1: Start creation 20 | generate_wallet owner 21 | 22 | ## Generate wallets for multiple owners 23 | if [ -n "$MULTI_OWNERS" ]; then 24 | for i in $(echo ${MULTI_OWNERS} | sed "s/,/ /g"); do 25 | generate_wallet $i 26 | done 27 | fi 28 | 29 | ## Create archive 30 | tar -zcvf ${NODE_PATH}/step1.tar.gz --exclude='*.skey' staking/wallets/ 31 | 32 | echo "Upload step1.tar.gz to your block-producing node to continue." 33 | echo "Waiting for step2.tar.gz from your block-producing node..." 34 | wait_for_file ${NODE_PATH}/step2.tar.gz 35 | 36 | 37 | register_stake_address owner --cold-create 38 | 39 | generate_operational_certificate 40 | generate_registration_certificates --cold-create 41 | register_stake_pool --cold-create 42 | 43 | echo "Archiving required files" 44 | cd ${NODE_PATH} && tar -zcvf staking-hot.tar.gz --exclude='cold-keys' --exclude='wallets/*/*.skey' staking/ 45 | 46 | echo "Created all addresses, certificates and transactions. Upload the \`staking-hot.tar.gz\` file to your live node, and submit the registration transaction by running with the \`--cold-register\`." 47 | read -------------------------------------------------------------------------------- /scripts/cold_register: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source /scripts/init_node_vars 4 | source /scripts/functions/check_address_registration 5 | source /scripts/functions/wait_for_address_registration 6 | source /scripts/functions/wait_for_pool_registration 7 | source /scripts/functions/wait_for_slot 8 | source /scripts/functions/wait_for_sync 9 | 10 | if [ -f "${NODE_PATH}/staking/POOL_VARS" ]; then 11 | source ${NODE_PATH}/staking/POOL_VARS 12 | if [ -n "${REGISTERED_COLD}" ]; then 13 | echo "Registration is already done." 14 | exit 15 | fi 16 | fi 17 | 18 | function submit_stake_addr { 19 | WALLET=$1 20 | cd ${NODE_PATH}/staking/wallets/${WALLET}/ 21 | STAKE_ADDR=$(cat stake.addr) 22 | 23 | echo "Submitting stake address for wallet ${WALLET}" 24 | if [ -n "$(check_address_registration ${STAKE_ADDR})" ]; then 25 | echo "Your stake address for ${WALLET} has already been registered in the blockchain." 26 | return 27 | fi 28 | 29 | OUT=$(cardano-cli shelley transaction submit \ 30 | --tx-file transactions/register_stake_address.signed \ 31 | ${NETWORK_ARGUMENT} 2>&1) 32 | 33 | if [[ $OUT =~ "Error" ]] 34 | then 35 | echo "An error occoured." 36 | echo ${OUT} 37 | read 38 | exit 39 | else 40 | echo "Transaction has been submitted to the blockchain." 41 | echo ${OUT} 42 | 43 | echo "Wait for the blockchain to register the address." 44 | wait_for_address_registration ${STAKE_ADDR} 45 | echo "Your stake address is now registered in the blockchain." 46 | touch transactions/register_stake_address.submitted 47 | fi 48 | } 49 | 50 | # Check for staking-hot.tar.gz 51 | if [ ! -f "${NODE_PATH}/staking-hot.tar.gz" ]; then 52 | echo "Missing required ${NODE_PATH}/staking-hot.tar.gz file. First run with the \`--cold-register\` argument on a secure offline node." 53 | read -n 1 -r -s -p "If you already have generated the file, please place it in its correct place, and press ENTER to continue." 54 | fi 55 | 56 | # Backup staking/ directory 57 | if [ -d "${NODE_PATH}/staking/" ]; then 58 | TIMESTAMP=$(date +%s) 59 | BACKUPNAME="staking.${TIMESTAMP}.tar.gz" 60 | echo "staking directory already exists." 61 | echo "Backing up to ${BACKUPNAME}." 62 | mkdir -p ${NODE_PATH}/backups/ 63 | tar -zcvf ${NODE_PATH}/backups/${BACKUPNAME} ${NODE_PATH}/staking/ > /dev/null 64 | fi 65 | 66 | # Unpack staking-hot.tar.gz 67 | cd ${NODE_PATH} && tar -xvf staking-hot.tar.gz 68 | source ${NODE_PATH}/staking/POOL_VARS 69 | 70 | # Wait for node to sync 71 | if [[ "${WAIT_FOR_SYNC}" == "True" ]]; then 72 | wait_for_sync 99.90 73 | fi 74 | 75 | # Submit the stake address transaction 76 | submit_stake_addr owner 77 | if [ -n "$MULTI_OWNERS" ]; then 78 | for i in $(echo ${MULTI_OWNERS} | sed "s/,/ /g") 79 | do 80 | submit_stake_addr $i 81 | done 82 | fi 83 | 84 | 85 | # Submit the pool transaction 86 | read -n 1 -r -s -p $'Press enter to submit the stake pool registration transaction...\n' 87 | 88 | echo "Submitting transaction" 89 | OUT=$(cardano-cli shelley transaction submit \ 90 | --tx-file cold-registration/register_stake_pool.signed \ 91 | ${NETWORK_ARGUMENT} 2>&1) 92 | 93 | if [[ $OUT =~ "Error" ]] 94 | then 95 | echo "An error occoured." 96 | echo ${OUT} 97 | read 98 | exit 99 | else 100 | echo "Transaction has been submitted to the blockchain." 101 | echo ${OUT} 102 | 103 | echo "Wait for blockchain to register the pool" 104 | wait_for_pool_registration 105 | echo "Your stake pool registration has been sent to the blockchain." 106 | fi 107 | 108 | echo "Press any key to continue." 109 | echo "export REGISTERED_COLD=True" >> ${NODE_PATH}/staking/POOL_VARS 110 | read 111 | -------------------------------------------------------------------------------- /scripts/create_stakepool: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # We run a syncing node which is needed to query the blockchain for creating and registering the keys and certificates. 4 | # Then synchronously we start creating and registering the keys. 5 | mkdir -p ${NODE_PATH}/logs/ 6 | 7 | for i in "$@"; do 8 | case $i in 9 | --cold-create) 10 | COLD_CREATE=1 11 | break 12 | ;; 13 | --cold-register) 14 | COLD_REGISTER=1 15 | break 16 | ;; 17 | *) 18 | break 19 | ;; 20 | esac 21 | done 22 | 23 | if [ -n "$COLD_CREATE" ]; then 24 | cold_create |& tee ${NODE_PATH}/logs/create_stakepool.$(date +%s).log 25 | elif [ -n "$COLD_REGISTER" ]; then 26 | tmux \ 27 | new-session "source /scripts/functions/run_node; run_node" \; \ 28 | split-window "cold_register |& tee ${NODE_PATH}/logs/register_stakepool.$(date +%s).log" \; \ 29 | select-layout even-horizontal 30 | else 31 | tmux \ 32 | new-session "source /scripts/functions/run_node; run_node" \; \ 33 | split-window "source /scripts/functions/create_and_register_pool; create_and_register_pool |& tee ${NODE_PATH}/logs/create_stakepool.$(date +%s).log" \; \ 34 | select-layout even-horizontal 35 | fi -------------------------------------------------------------------------------- /scripts/deregister_stake_address: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # From Documentation 4 | # https://github.com/input-output-hk/cardano-tutorials/blob/master/node-setup/040_transactions.md 5 | # https://github.com/input-output-hk/cardano-tutorials/blob/master/node-setup/050_register_key.md 6 | 7 | # Init functions and vars 8 | 9 | source /scripts/functions/check_balance 10 | source /scripts/functions/check_address_registration 11 | source /scripts/functions/wait_for_address_registration 12 | source /scripts/functions/wait_for_slot 13 | source /scripts/functions/wait_for_sync 14 | source /scripts/init_node_vars 15 | 16 | # Define wallet 17 | WALLET=$1 18 | 19 | if [ -z "$WALLET" ]; then 20 | echo "Wallet is undefined." 21 | exit 22 | fi 23 | 24 | # Enter staking directory 25 | cd ${NODE_PATH}/staking/wallets/${WALLET} 26 | STAKE_ADDR=$(cat ${NODE_PATH}/staking/wallets/${WALLET}/stake.addr) 27 | 28 | echo "" 29 | echo "Submitting staking addresses for $WALLET to the blockchain." 30 | 31 | # Check for required files 32 | if [ ! -f "stake.vkey" ]; then 33 | echo "Missing required wallets/${WALLET}/stake.vkey. You need to run \`generate_wallet ${WALLET}\` to generate this key." 34 | MISSING_FILES=1 35 | fi 36 | 37 | if [ ! -f "stake.skey" ]; then 38 | echo "Missing required wallets/${WALLET}/stake.skey. You need to run \`generate_wallet ${WALLET}\` to generate this key." 39 | MISSING_FILES=1 40 | fi 41 | 42 | if [ ! -f "payment.skey" ]; then 43 | echo "Missing required wallets/${WALLET}/payment.skey. You need to run \`generate_wallet ${WALLET}\` to generate this key." 44 | MISSING_FILES=1 45 | fi 46 | 47 | if [ ! -f "payment.addr" ]; then 48 | echo "Missing required wallets/${WALLET}/payment.addr. You need to run \`generate_wallet ${WALLET}\` to generate this key." 49 | MISSING_FILES=1 50 | fi 51 | 52 | if [ -n "$MISSING_FILES" ]; then 53 | exit 54 | fi 55 | 56 | mkdir -p transactions 57 | 58 | # Wait for node to sync 59 | if [[ "${WAIT_FOR_SYNC}" == "True" ]]; then 60 | wait_for_sync 99.90 61 | fi 62 | 63 | # Generate protocol 64 | cardano-cli query protocol-parameters \ 65 | ${NETWORK_ARGUMENT} \ 66 | --out-file ${NODE_PATH}/staking/protocol.json 67 | 68 | # Get key-deposit 69 | KEY_DEPOSIT=$(jq -r .stakeAddressDeposit ${NODE_PATH}/staking/protocol.json) 70 | 71 | # Find UTXO in address with enough lovelace to do the transaction 72 | ADDRESS=$(cat payment.addr) 73 | check_balance ${KEY_DEPOSIT} 74 | 75 | # Generate deregistration cert 76 | cardano-cli stake-address deregistration-certificate \ 77 | --staking-verification-key-file stake.vkey \ 78 | --out-file destake.cert 79 | 80 | # Draft transaction 81 | cardano-cli transaction build-raw \ 82 | --tx-in "${UTXO}#${TXIX}" \ 83 | --tx-out ${ADDRESS}+0 \ 84 | --ttl 0 \ 85 | --fee 0 \ 86 | --out-file transactions/deregister_stake_address.draft \ 87 | --certificate-file destake.cert 88 | 89 | # Calculate fees 90 | FEE=$(cardano-cli transaction calculate-min-fee \ 91 | --tx-body-file transactions/deregister_stake_address.draft \ 92 | --tx-in-count 1 \ 93 | --tx-out-count 1 \ 94 | --witness-count 1 \ 95 | --byron-witness-count 0 \ 96 | ${NETWORK_ARGUMENT} \ 97 | --protocol-params-file ${NODE_PATH}/staking/protocol.json | tr ' ' '\n' | head -1) 98 | 99 | TOTAL_PRICE=$(expr ${FEE}) 100 | echo "Fee is: ${FEE} Lovelace" 101 | echo "Key-Deposit: ${KEY_DEPOSIT} Lovelace" 102 | echo "Total Price is: ${TOTAL_PRICE}" 103 | 104 | # Find UTXO in address with enough lovelace to do the transaction 105 | check_balance ${TOTAL_PRICE} 106 | SLOT=$(get_slot) 107 | 108 | # Get slot and TTL 109 | TTL=$(expr ${SLOT} + 500) 110 | 111 | # Display transaction info 112 | REMAINING_AFTER_TX=$(expr ${LOVELACE} - ${TOTAL_PRICE} + ${KEY_DEPOSIT}) 113 | echo "Creating transaction" 114 | echo "Lovelace after transaction: ${REMAINING_AFTER_TX}" 115 | echo "Current slot: ${SLOT}" 116 | echo "TTL: ${TTL}" 117 | 118 | # 119 | # Create the transaction 120 | # 121 | cardano-cli transaction build-raw \ 122 | --tx-in "${UTXO}#${TXIX}" \ 123 | --tx-out ${ADDRESS}+${REMAINING_AFTER_TX} \ 124 | --ttl ${TTL} \ 125 | --fee ${FEE} \ 126 | --out-file transactions/deregister_stake_address.raw \ 127 | --certificate-file destake.cert 128 | 129 | # Sign the transaction 130 | cardano-cli transaction sign \ 131 | --tx-body-file transactions/deregister_stake_address.raw \ 132 | --signing-key-file payment.skey \ 133 | --signing-key-file stake.skey \ 134 | ${NETWORK_ARGUMENT} \ 135 | --out-file transactions/deregister_stake_address.signed 136 | 137 | 138 | # Submit the transaction 139 | read -n 1 -r -s -p $'Press enter to submit the stake address certificate...\n' 140 | 141 | OUT=$(cardano-cli transaction submit \ 142 | --tx-file transactions/deregister_stake_address.signed \ 143 | ${NETWORK_ARGUMENT} 2>&1) 144 | 145 | if [[ $OUT =~ "Error" ]] 146 | then 147 | echo "An error occoured." 148 | echo ${OUT} 149 | read 150 | else 151 | echo "Transaction has been submitted to the blockchain." 152 | echo ${OUT} 153 | 154 | echo "Your stake address is now deregistered." 155 | touch transactions/deregister_stake_address.submitted 156 | fi 157 | -------------------------------------------------------------------------------- /scripts/download_db_snapshot: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source /scripts/init_node_vars 4 | 5 | MITHRIL_CONFIG="/cfg-templates/$CARDANO_NETWORK/mithril_config.json" 6 | $( cat "$MITHRIL_CONFIG" | jq -r 'keys[] as $k | "export \($k)=\(.[$k])"' ) 7 | 8 | echo "Bootstrapping with latest Mithril snapshot" 9 | echo `mithril-client snapshot show latest` 10 | 11 | mithril-client snapshot download --download-dir=$NODE_PATH latest 12 | -------------------------------------------------------------------------------- /scripts/every_five_days: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This script can be put in a crontab daily job to ensure it only runs on epoch cutover day. 4 | # e.g. 5 | # 46 13 * * * /home/westbam/haskell/everyFiveDays.sh && /home/westbam/Development/cncli/sendslots.sh 6 | 7 | CARDANO_START=$(date +%s -d "2017-09-23") 8 | CARDANO_START_DAY=$(( $CARDANO_START / 86400 )) 9 | 10 | NOW_TIMESTAMP=$(date +%s) 11 | NOW_DAY=$(( $NOW_TIMESTAMP / 86400 )) 12 | 13 | DAYS_SINCE_CARDANO_START=$(( $NOW_DAY - $CARDANO_START_DAY )) 14 | 15 | RESULT=$(( $DAYS_SINCE_CARDANO_START % 5 )) 16 | echo "Day number: $RESULT" 17 | 18 | if [ "$RESULT" = "0" ]; then 19 | echo "Exit Success" 20 | exit 0 21 | else 22 | echo "Exit failure" 23 | exit 1 24 | fi -------------------------------------------------------------------------------- /scripts/functions/check_address_registration: -------------------------------------------------------------------------------- 1 | function check_address_registration { 2 | source /scripts/init_node_vars 3 | 4 | STAKE_ADDR=$1 5 | if [ ! "$(cardano-cli query stake-address-info --address ${STAKE_ADDR} ${NETWORK_ARGUMENT})" == "[]" ]; then 6 | echo "1" 7 | fi 8 | } 9 | -------------------------------------------------------------------------------- /scripts/functions/check_balance: -------------------------------------------------------------------------------- 1 | function check_balance { 2 | PRICE=$1 3 | MINIMAL_LOVELACE_REMAINING_ON_UTXO=1000000 4 | LOVELACE_FOR_UTXO_TXIX=10000000000000 5 | 6 | if [ -z "$COLD_CREATE" ]; then 7 | while true; do 8 | echo "" 9 | echo "Checking balance for address ${ADDRESS}." 10 | echo "" 11 | 12 | TOTAL_LOVELACE=0 13 | cardano-cli query utxo ${NETWORK_ARGUMENT} --address ${ADDRESS} 14 | 15 | UTXOS=$(cardano-cli query utxo ${NETWORK_ARGUMENT} --address ${ADDRESS} | tail -n +3) 16 | echo "UTXO#TXIX: LOVELACE" 17 | while IFS= read -r line ; do 18 | arr=(${line}) 19 | LOVELACE=${arr[2]} 20 | TOTAL_LOVELACE=$(expr ${TOTAL_LOVELACE} + ${LOVELACE}) 21 | 22 | if [ -n "${LOVELACE}" ]; then 23 | echo "${arr[0]}#${arr[1]}: ${arr[2]}" 24 | REMAINING=$(expr ${LOVELACE} - ${PRICE}) 25 | if [ "$LOVELACE" -ge "$PRICE" ] && [ "$LOVELACE_FOR_UTXO_TXIX" -ge "$LOVELACE" ] && [ "$REMAINING" -ge "$MINIMAL_LOVELACE_REMAINING_ON_UTXO" ]; then 26 | UTXO=${arr[0]} 27 | TXIX=${arr[1]} 28 | LOVELACE_FOR_UTXO_TXIX=$LOVELACE 29 | fi 30 | fi 31 | done <<< "${UTXOS}" 32 | 33 | if [ -n "${UTXO}" ]; then 34 | LOVELACE=$LOVELACE_FOR_UTXO_TXIX 35 | echo "Address is successfully funded." 36 | echo "" 37 | echo "Got UTXO" 38 | echo "UTXO: ${UTXO}#${TXIX}" 39 | echo "Lovelace Holding: ${LOVELACE}" 40 | break 41 | fi 42 | 43 | echo "You need to fund your address with atleast ${PRICE} Lovelace to continue with the transaction." 44 | echo "Your payment address is:" 45 | echo "${ADDRESS}" 46 | echo "" 47 | echo "If you have funded your address, you need to wait for the transaction to be processed and your node to synchronize." 48 | sync_status 49 | echo "" 50 | 51 | sleep 10 52 | done 53 | else 54 | echo "Find UTXO and TXIX containing atleast ${PRICE} Lovelace for address ${ADDRESS} (Wallet ${WALLET})" 55 | echo "Run \`cardano-cli query utxo ${NETWORK_ARGUMENT} --address ${ADDRESS}\`, on online node to find the values." 56 | read -p "Enter the UTXO: " UTXO 57 | read -p "Enter the TXIX: " TXIX 58 | LOVELACE=0 59 | fi 60 | } 61 | 62 | -------------------------------------------------------------------------------- /scripts/functions/check_kes_status: -------------------------------------------------------------------------------- 1 | function check_kes_status { 2 | source /scripts/init_node_vars 3 | source ${NODE_PATH}/staking/pool-keys/KESPERIOD 4 | 5 | if [ -n "$EXPIRESLOT" ]; then 6 | CURRENT_SLOT=$(get_slot) 7 | SLOTS_LEFT=$(expr ${EXPIRESLOT} - ${CURRENT_SLOT}) 8 | 9 | echo ${SLOTS_LEFT} 10 | else 11 | echo 0 12 | fi 13 | } -------------------------------------------------------------------------------- /scripts/functions/check_pool_registration: -------------------------------------------------------------------------------- 1 | function check_pool_registration { 2 | source /scripts/init_node_vars 3 | 4 | POOL_ID=$(cat ${NODE_PATH}/staking/POOL_ID) 5 | cardano-cli query ledger-state ${NETWORK_ARGUMENT} | grep publicKey | grep ${POOL_ID} 6 | } 7 | -------------------------------------------------------------------------------- /scripts/functions/create_and_register_pool: -------------------------------------------------------------------------------- 1 | function create_and_register_pool { 2 | source /scripts/init_node_vars 3 | source /scripts/functions/wait_for_socket 4 | 5 | echo "Creating Stake Pool addresses, keys and certificates, and submits to the blockchain." 6 | 7 | # If staking/ directory exists create a backup 8 | if [ -d "${NODE_PATH}/staking/" ]; then 9 | TIMESTAMP=$(date +%s) 10 | BACKUPNAME="staking.${TIMESTAMP}.tar.gz" 11 | echo "staking directory already exists." 12 | echo "Backing up to ${BACKUPNAME}." 13 | mkdir -p ${NODE_PATH}/backups/ 14 | tar -zcvf ${NODE_PATH}/backups/${BACKUPNAME} ${NODE_PATH}/staking/ > /dev/null 15 | fi 16 | 17 | # Wait for database to load (wait_for_socket in loop) 18 | wait_for_socket 19 | 20 | # Start creation 21 | generate_wallet owner 22 | register_stake_address owner 23 | 24 | ## Generate wallets for multiple owners 25 | if [ -n "$MULTI_OWNERS" ]; then 26 | for i in $(echo ${MULTI_OWNERS} | sed "s/,/ /g") 27 | do 28 | generate_wallet $i 29 | register_stake_address $i 30 | done 31 | fi 32 | 33 | generate_operational_certificate LIVE 34 | generate_registration_certificates 35 | register_stake_pool 36 | 37 | # Stop syncing cardano-node so block-producing node can be started 38 | killall -9 cardano-node 39 | } -------------------------------------------------------------------------------- /scripts/functions/current_epoch: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | GENESIS=${NODE_PATH}/shelley-genesis.json 4 | 5 | startTimeGenesis=$(cat ${GENESIS} | jq -r .systemStart) 6 | startTimeSec=$(date --date=${startTimeGenesis} +%s) #in seconds (UTC) 7 | currentTimeSec=$(date -u +%s) #in seconds (UTC) 8 | epochLength=$(cat ${GENESIS} | jq -r .epochLength) 9 | currentEPOCH=$(( (${currentTimeSec}-${startTimeSec}) / ${epochLength} )) #returns a integer number, we like that 10 | echo ${currentEPOCH} -------------------------------------------------------------------------------- /scripts/functions/ensure_cron_running: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ -z "$(pgrep cron)" ]; then 4 | crontab /crontab 5 | service cron start 6 | else 7 | echo "Cron is running" 8 | fi 9 | -------------------------------------------------------------------------------- /scripts/functions/get_block: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source /scripts/init_node_vars 4 | 5 | BLOCK=$(cardano-cli query tip ${NETWORK_ARGUMENT} | jq -r '.block') 6 | echo "${BLOCK}" 7 | -------------------------------------------------------------------------------- /scripts/functions/get_protocol: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Init vars 4 | source /scripts/init_node_vars 5 | 6 | cardano-cli query protocol-parameters ${NETWORK_ARGUMENT} --out-file protocol.json 7 | -------------------------------------------------------------------------------- /scripts/functions/get_public_ip: -------------------------------------------------------------------------------- 1 | function get_public_ip { 2 | echo $(dig TXT +short o-o.myaddr.l.google.com @ns1.google.com | awk -F'"' '{ print $2}') 3 | } 4 | -------------------------------------------------------------------------------- /scripts/functions/get_slot: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source /scripts/init_node_vars 4 | 5 | SLOT=$(cardano-cli query tip ${NETWORK_ARGUMENT} | jq -r '.slot') 6 | echo "${SLOT}" 7 | -------------------------------------------------------------------------------- /scripts/functions/info_pane: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | function info_pane { 4 | source /scripts/init_node_vars 5 | source /scripts/functions/wait_for_sync 6 | 7 | wait_for_sync 99.98 8 | 9 | while true; do 10 | sync_status 11 | sleep 60 12 | done 13 | } 14 | -------------------------------------------------------------------------------- /scripts/functions/init_config: -------------------------------------------------------------------------------- 1 | function init_config { 2 | python3 /scripts/init_config.py 3 | } -------------------------------------------------------------------------------- /scripts/functions/node_info: -------------------------------------------------------------------------------- 1 | function node_info { 2 | STAKEPOOL=$1 3 | if [ -n "$STAKEPOOL" ]; then 4 | POOL_ID=$(cat ${NODE_PATH}/staking/POOL_ID) 5 | source ${NODE_PATH}/staking/POOL_VARS 6 | source /scripts/functions/stakepool_info 7 | 8 | echo "Pool ID: ${POOL_ID}" 9 | stakepool_info 10 | fi 11 | echo "Node name: ${NODE_NAME}" 12 | echo "Network: ${CARDANO_NETWORK}" 13 | echo "Host Address: ${HOST_ADDR}" 14 | echo "Public IP: ${PUBLIC_IP}" 15 | echo "Node Port: ${NODE_PORT}" 16 | echo "Node path: ${NODE_PATH}" 17 | echo "EKG Port: ${EKG_PORT}" 18 | echo "Prometheus Port: ${PROMETHEUS_PORT}" 19 | echo "CNCLI: ${CNCLI_SYNC}" 20 | 21 | } -------------------------------------------------------------------------------- /scripts/functions/run_node: -------------------------------------------------------------------------------- 1 | function run_node { 2 | source /scripts/init_node_vars 3 | source /scripts/functions/node_info 4 | 5 | # Running in loop allows for restarting without restarting the container 6 | while true; do 7 | echo "Starting cardano-node" 8 | node_info 9 | echo ${TOPOLOGY_PATH} 10 | cardano-node run \ 11 | --topology ${TOPOLOGY_PATH} \ 12 | --database-path ${NODE_PATH}/db \ 13 | --socket-path ${CARDANO_NODE_SOCKET_PATH} \ 14 | --host-addr ${HOST_ADDR} \ 15 | --port ${NODE_PORT} \ 16 | --config ${NODE_PATH}/config.json 17 | done 18 | } -------------------------------------------------------------------------------- /scripts/functions/run_stakingnode: -------------------------------------------------------------------------------- 1 | function run_stakingnode { 2 | source /scripts/init_node_vars 3 | source /scripts/functions/node_info 4 | 5 | echo "Starting cardano-node as a staking node." 6 | node_info 1 7 | 8 | # CNCLI sync 9 | if [[ $CNCLI_SYNC = "True" ]]; then 10 | echo "Starting cncli" 11 | cncli sync --host 127.0.0.1 --port $NODE_PORT --db ${NODE_PATH}/cncli.db & 12 | 13 | if [[ $PT_SENDTIP = "True" ]]; then 14 | cncli sendtip --cardano-node /bin/cardano-node --config ${NODE_PATH}/pooltool.json & 15 | fi 16 | 17 | if [[ $PT_SENDSLOTS = "True" ]]; then 18 | # Add to crontab 19 | echo "0 21 * * * every_five_days && leaderlogs_cncli next" >> /crontab 20 | echo "55 21 * * * every_five_days && send_slots" >> /crontab 21 | ensure_cron_running 22 | fi 23 | fi 24 | 25 | if [[ $CEXPLORER_STATS = "True" ]]; then 26 | echo "0 0 * * * /scripts/cexplorer_pool_stats" >> /crontab 27 | ensure_cron_running 28 | fi 29 | 30 | # Running in loop allows for restarting without restarting the container 31 | while true; do 32 | cardano-node run \ 33 | --topology ${NODE_PATH}/topology.json \ 34 | --database-path ${NODE_PATH}/db \ 35 | --socket-path ${CARDANO_NODE_SOCKET_PATH} \ 36 | --host-addr ${HOST_ADDR} \ 37 | --port ${NODE_PORT} \ 38 | --config ${NODE_PATH}/config.json \ 39 | --shelley-kes-key ${NODE_PATH}/staking/pool-keys/kes.skey \ 40 | --shelley-vrf-key ${NODE_PATH}/staking/pool-keys/vrf.skey \ 41 | --shelley-operational-certificate ${NODE_PATH}/staking/pool-keys/node.cert 42 | done 43 | } -------------------------------------------------------------------------------- /scripts/functions/stakepool_info: -------------------------------------------------------------------------------- 1 | function stakepool_info { 2 | if [ -f "${NODE_PATH}/staking/metadata.json" ]; then 3 | METADATA=${NODE_PATH}/staking/metadata.json 4 | 5 | POOL_NAME=$(jq -r '.name' $METADATA) 6 | POOL_DESCRIPTION=$(jq -r '.description' $METADATA) 7 | POOL_TICKER=$(jq -r '.ticker' $METADATA) 8 | POOL_HOMEPAGE=$(jq -r '.homepage' $METADATA) 9 | 10 | echo "Pool Name: ${POOL_NAME}" 11 | echo "Pool Description: ${POOL_DESCRIPTION}" 12 | echo "Pool Ticker: ${POOL_TICKER}" 13 | echo "Pool Homepage: ${POOL_HOMEPAGE}" 14 | fi 15 | 16 | echo "Pool Pledge: ${POOL_PLEDGE}" 17 | echo "Pool Cost: ${POOL_COST}" 18 | echo "Pool Margin: ${POOL_MARGIN}" 19 | } -------------------------------------------------------------------------------- /scripts/functions/status: -------------------------------------------------------------------------------- 1 | function status { 2 | source /scripts/functions/wait_for_socket 3 | source /scripts/functions/check_kes_status 4 | 5 | wait_for_socket 6 | 7 | while true; do 8 | KES_SLOTS_LEFT=$(check_kes_status) 9 | echo "Your KES and VRF keys and node certificate has to be renewed in ${KES_SLOTS_LEFT} slots." 10 | echo "To renew run \`generate_operational_certificate\`" 11 | echo "" 12 | echo "Node sync status:" 13 | sync_status 14 | sleep 60 15 | done 16 | } -------------------------------------------------------------------------------- /scripts/functions/sync_status: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Thanks to Smaug from https://t.me/CardanoStakePoolWorkgroup 3 | 4 | source /scripts/functions/wait_for_socket 5 | wait_for_socket 6 | 7 | GENESIS=${NODE_PATH}/shelley-genesis.json 8 | BYRON_GENESIS=${NODE_PATH}/byron-genesis.json 9 | 10 | epoch_length=$(jq -r .epochLength $GENESIS) 11 | slot_length=$(jq -r .slotLength $GENESIS) 12 | byron_slot_length=$(( $(jq -r .blockVersionData.slotDuration $BYRON_GENESIS) / 1000 )) 13 | byron_epoch_length=$(( $(jq -r .protocolConsts.k $BYRON_GENESIS) * 10 )) 14 | 15 | byron_start=$(jq -r .startTime $BYRON_GENESIS) 16 | byron_end=$((byron_start + HARDFORK_EPOCH * byron_epoch_length * byron_slot_length)) 17 | byron_slots=$(($HARDFORK_EPOCH * byron_epoch_length)) 18 | now=$(date +'%s') 19 | 20 | expected_slot=$((byron_slots + (now - byron_end) / slot_length)) 21 | current_slot=$(cardano-cli query tip $NETWORK_ARGUMENT | jq -r '.slot') 22 | percent=$(echo -e "scale=2\n$current_slot * 100 / $expected_slot" | bc) 23 | 24 | echo "slot ${current_slot}/${expected_slot} ${percent}%" 25 | -------------------------------------------------------------------------------- /scripts/functions/validations: -------------------------------------------------------------------------------- 1 | # Borrowed from https://github.com/cardano-community/guild-operators 2 | # Thank you! 3 | 4 | # Description : Helper function to validate that input is a number 5 | # : $1 = number 6 | isNumber() { 7 | [[ -z $1 ]] && return 1 8 | [[ $1 =~ ^[0-9]+$ ]] && return 0 || return 1 9 | } 10 | 11 | # Description : Helper function to validate IPv4 address 12 | # : $1 = IP 13 | isValidIPv4() { 14 | local ip=$1 15 | [[ -z ${ip} ]] && return 1 16 | if [[ ${ip} =~ ^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$ || ${ip} =~ ^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9_\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9_\-]*[A-Za-z0-9])$ ]]; then 17 | return 0 18 | fi 19 | return 1 20 | } 21 | 22 | # Description : Helper function to validate IPv6 address, works for normal IPv6 addresses, not dual incl IPv4 23 | # : $1 = IP 24 | isValidIPv6() { 25 | local ip=$1 26 | [[ -z ${ip} ]] && return 1 27 | ipv6_regex="^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$" 28 | [[ ${ip} =~ ${ipv6_regex} ]] && return 0 29 | return 1 30 | } 31 | -------------------------------------------------------------------------------- /scripts/functions/wait_for_address_registration: -------------------------------------------------------------------------------- 1 | function wait_for_address_registration { 2 | source /scripts/functions/check_address_registration 3 | 4 | STAKE_ADDR=$1 5 | echo "Waiting for the blockchain to register the address." 6 | while true; do 7 | if [ -n "$(check_address_registration ${STAKE_ADDR})" ]; then 8 | break 9 | fi 10 | echo "Blockchain has not yet registered the address. Waiting.." 11 | sleep 10 12 | done 13 | } -------------------------------------------------------------------------------- /scripts/functions/wait_for_file: -------------------------------------------------------------------------------- 1 | function wait_for_file { 2 | FILE=$1 3 | 4 | while [ ! -f ${FILE} ]; do sleep 1; done 5 | } 6 | -------------------------------------------------------------------------------- /scripts/functions/wait_for_pool_registration: -------------------------------------------------------------------------------- 1 | function wait_for_pool_registration { 2 | source /scripts/functions/check_pool_registration 3 | 4 | echo "Waiting for the blockchain to register the pool." 5 | while true; do 6 | if [ -n "$(check_pool_registration)" ]; then 7 | break 8 | fi 9 | echo "Blockchain has not yet registered the pool. Waiting.." 10 | sleep 10 11 | done 12 | } -------------------------------------------------------------------------------- /scripts/functions/wait_for_slot: -------------------------------------------------------------------------------- 1 | function wait_for_slot { 2 | WAIT_FOR_SLOT=$1 3 | 4 | echo "Waiting for slot ${WAIT_FOR_SLOT}" 5 | while true; do 6 | SLOT=$(get_slot) 7 | 8 | if [ "$SLOT" -ge "$WAIT_FOR_SLOT" ]; then 9 | echo "Reached slot ${WAIT_FOR_SLOT}" 10 | break 11 | fi 12 | echo "Slot: ${SLOT}/${WAIT_FOR_SLOT}" 13 | sleep 10 14 | done 15 | } -------------------------------------------------------------------------------- /scripts/functions/wait_for_socket: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | function wait_for_socket { 4 | source /scripts/init_node_vars 5 | 6 | if [[ -z "$(get_slot 2>/dev/null)" ]]; then 7 | echo -e "\nWaiting for cardano-node to read the blockchain and start the socket." 8 | echo -n "It may take a while. Trying again." 9 | sleep 5 10 | 11 | while true; do 12 | if [[ -z "$(get_slot 2>/dev/null)" ]]; then 13 | echo -n "." 14 | sleep 5 15 | else 16 | break 17 | fi 18 | done 19 | 20 | echo -e "${CHECK_MARK} Socket is now functional." 21 | fi 22 | } 23 | -------------------------------------------------------------------------------- /scripts/functions/wait_for_sync: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | function wait_for_sync { 4 | source /scripts/functions/wait_for_socket 5 | wait_for_socket 6 | WAIT_FOR_SYNC=$1 7 | 8 | echo -e "\nWaiting for cardano-node to sync to at least ${WAIT_FOR_SYNC}%" 9 | echo -n "" 10 | 11 | while true; do 12 | SYNC_PCT=$(sync_status | tr ' ' '\n' | tail -1 | sed 's/%//g' | bc) 13 | echo -en "\\r== $(sync_status) " 14 | 15 | RESULT=$(echo "${SYNC_PCT}>${WAIT_FOR_SYNC}" | bc) 16 | if [[ $RESULT = 1 ]]; then 17 | echo -e "${CHECK_MARK} Done." 18 | break 19 | fi 20 | sleep 30 21 | done 22 | } 23 | -------------------------------------------------------------------------------- /scripts/generate_operational_certificate: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # From Documentation 4 | # https://github.com/input-output-hk/cardano-tutorials/blob/master/node-setup/060_node_keys.md 5 | # https://github.com/input-output-hk/cardano-tutorials/blob/master/node-setup/080_register_stakepool.md 6 | 7 | # Init vars 8 | source /scripts/init_node_vars 9 | source /scripts/functions/wait_for_sync 10 | 11 | # Enter staking directory 12 | mkdir -p ${NODE_PATH}/staking/pool-keys 13 | mkdir -p ${NODE_PATH}/staking/cold-keys 14 | cd ${NODE_PATH}/staking/ 15 | 16 | echo "" 17 | echo "Generate operational certificates" 18 | 19 | if [ -d "pool-keys/" ]; then 20 | source pool-keys/KESPERIOD 21 | BACKUPNAME=pool-keys.$(date +%s).tar.gz 22 | echo "pool-keys already exist." 23 | echo "Created at slot: ${KESSLOT}" 24 | echo "Backing up to ${BACKUPNAME} before creating new KES keys." 25 | mkdir -p ../backups/ 26 | tar -zcvf ../backups/${BACKUPNAME} pool-keys/ > /dev/null 27 | fi 28 | 29 | if [ -d "cold-keys/" ]; then 30 | BACKUPNAME=cold-keys.$(date +%s).tar.gz 31 | echo "Backing up to ${BACKUPNAME} before creating new KES keys." 32 | mkdir -p ../backups/ 33 | tar -zcvf ../backups/${BACKUPNAME} cold-keys/ > /dev/null 34 | fi 35 | 36 | # Create cold key 37 | if [ ! -f "cold-keys/cold.skey" ]; then 38 | echo "Creating cold keys." 39 | echo "Warning: The cold keys should NOT be kept on your server. You should backup your cold keys and delete them from the server." 40 | echo "Alternatively you can generate the keys on a seperate offline node, and move all the neccessary certificates and keys to the active staking node." 41 | 42 | cardano-cli node key-gen \ 43 | --cold-verification-key-file cold-keys/cold.vkey \ 44 | --cold-signing-key-file cold-keys/cold.skey \ 45 | --operational-certificate-issue-counter-file cold-keys/cold.counter 46 | 47 | cardano-cli stake-pool id --cold-verification-key-file cold-keys/cold.vkey --output-format hex > ${NODE_PATH}/staking/POOL_ID 48 | else 49 | echo "Cold keys already exists." 50 | fi 51 | 52 | # Create Verifiable Random Function key 53 | if [ ! -f "pool-keys/vrf.vkey" ]; then 54 | echo "Generating VRF key" 55 | cardano-cli node key-gen-VRF \ 56 | --verification-key-file pool-keys/vrf.vkey \ 57 | --signing-key-file pool-keys/vrf.skey 58 | fi 59 | 60 | # Create Key Evolving Signature key 61 | if [ ! -f "pool-keys/kes.vkey" ]; then 62 | echo "Generating KES key" 63 | cardano-cli node key-gen-KES \ 64 | --verification-key-file pool-keys/kes.vkey \ 65 | --signing-key-file pool-keys/kes.skey 66 | fi 67 | 68 | # Get tip 69 | TIP=$1 70 | if [ -z "$TIP" ]; then 71 | echo "You need to find the current tip of the blockchain. To get the current tip you can run the command \`get_slot\` in the your relay container." 72 | read -p "Enter the current tip slot: " TIP 73 | elif [ "$TIP" == "LIVE" ]; then 74 | echo "Getting slot from live socket" 75 | 76 | if [[ "${WAIT_FOR_SYNC}" == "True" ]]; then 77 | wait_for_sync 99.90 78 | fi 79 | 80 | TIP=$(get_slot) 81 | fi 82 | 83 | # Get KESPeriod 84 | SLOTSPERKESPERIOD=$(jq -r '.slotsPerKESPeriod' ${NODE_PATH}/shelley-genesis.json) 85 | MAXKESEVOLUTIONS=$(jq -r '.maxKESEvolutions' ${NODE_PATH}/shelley-genesis.json) 86 | MAXKESSLOTS=$(expr ${SLOTSPERKESPERIOD} \* ${MAXKESEVOLUTIONS}) 87 | KESPERIOD=$(expr ${TIP} / ${SLOTSPERKESPERIOD}) 88 | #KESPERIOD=$(expr ${KESPERIOD} - 1) # Because of bug in 1.19.0 89 | EXPIRESLOT=$(expr ${TIP} + ${MAXKESSLOTS}) 90 | echo "export SLOTSPERKESPERIOD=${SLOTSPERKESPERIOD}" > pool-keys/KESPERIOD 91 | echo "export KESSLOT=${TIP}" >> pool-keys/KESPERIOD 92 | echo "export MAXKESEVOLUTIONS=${MAXKESEVOLUTIONS}" >> pool-keys/KESPERIOD 93 | echo "export MAXKESSLOTS=${MAXKESSLOTS}" >> pool-keys/KESPERIOD 94 | echo "export KESPERIOD=${KESPERIOD}" >> pool-keys/KESPERIOD 95 | echo "export EXPIRESLOT=${EXPIRESLOT}" >> pool-keys/KESPERIOD 96 | 97 | echo "Current slot: ${TIP}" 98 | echo "slotsPerKesPeriod: ${SLOTSPERKESPERIOD}" 99 | echo "KESPeriod: ${KESPERIOD}" 100 | echo "MaxKESSlots: ${MAXKESSLOTS}" 101 | echo "KESExpireSlot: ${EXPIRESLOT}" 102 | 103 | # Create an operational node certificate 104 | cardano-cli node issue-op-cert \ 105 | --kes-verification-key-file pool-keys/kes.vkey \ 106 | --cold-signing-key-file cold-keys/cold.skey \ 107 | --operational-certificate-issue-counter cold-keys/cold.counter \ 108 | --kes-period ${KESPERIOD} \ 109 | --out-file pool-keys/node.cert 110 | 111 | echo "Successfully created node operational keys." 112 | -------------------------------------------------------------------------------- /scripts/generate_registration_certificates: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # From Documentation 4 | # https://github.com/input-output-hk/cardano-tutorials/blob/ecbfd0ec06e0515701ee3749ce96780c27d2249d/node-setup/080_register_stakepool.md 5 | 6 | # Init vars 7 | source /scripts/init_node_vars 8 | source /scripts/functions/get_public_ip 9 | source /scripts/functions/stakepool_info 10 | TIMESTAMP=$(date +%s) 11 | 12 | # Enter staking directory 13 | cd ${NODE_PATH}/staking/ 14 | 15 | echo "" 16 | echo "Generate registration certificates" 17 | 18 | # Check for required files 19 | if [ ! -f "wallets/owner/stake.vkey" ]; then 20 | echo "Missing required staking/stake.vkey. You need to run \`generate_wallet owner\` to generate this key." 21 | MISSING_FILES=1 22 | fi 23 | 24 | if [ ! -f "cold-keys/cold.vkey" ]; then 25 | echo "Missing required staking/cold-keys/cold.vkey. You need to run \`generate_operational_certificate\` to generate this key." 26 | MISSING_FILES=1 27 | fi 28 | 29 | if [ ! -f "pool-keys/vrf.vkey" ]; then 30 | echo "Missing required staking/pool-keys/vrf.vkey. You need to run \`generate_operational_certificate\` to generate this key." 31 | MISSING_FILES=1 32 | fi 33 | 34 | if [ -n "$MISSING_FILES" ]; then 35 | exit 36 | fi 37 | 38 | if [ -z "$METADATA_URL" ]; then 39 | echo "Missing METADATA_URL You need to upload your metadata.json file at pass the URL to the METADATA_URL variable." 40 | exit 41 | fi 42 | 43 | # Handle arguments 44 | for i in "$@" 45 | do 46 | case $i in 47 | --update) 48 | UPDATE_CERT=1 49 | ;; 50 | --cold-create) 51 | COLD_CREATE=1 52 | ;; 53 | esac 54 | done 55 | 56 | # 1. Create a JSON file with your pool's metadata 57 | if [ ! -f "metadata.json" ]; then 58 | if [ -z "$COLD_CREATE" ]; then 59 | echo "Getting metadata file from ${METADATA_URL}" 60 | wget -O metadata.json ${METADATA_URL} 61 | else 62 | read -n 1 -r -s -p "Missing ${NODE_PATH}/staking/metadata.json. Please add this file, and ENTER when you have placed the file and are ready to continue." 63 | fi 64 | fi 65 | 66 | # 2. get hash of file 67 | echo "Getting hash of metadata.json" 68 | METADATA_HASH=$(cardano-cli latest stake-pool metadata-hash --pool-metadata-file metadata.json) 69 | echo "metadata.json hash: ${METADATA_HASH}" 70 | 71 | # 3. Generate Stake pool registration certificate 72 | if [ ! -f "pool.cert" ] || [ -n "$UPDATE_CERT" ]; then 73 | if [ -f "pool.cert" ]; then 74 | echo "backing up pool.cert." 75 | cp pool.cert pool.${TIMESTAMP}.cert 76 | fi 77 | 78 | echo "Generating pool.cert" 79 | stakepool_info 80 | 81 | 82 | # Collect relay information 83 | POOL_RELAYS="" 84 | 85 | if [ -n "$PUBLIC_RELAY_HOSTS" ]; then 86 | IFS=',' read -ra hosts <<< "$PUBLIC_RELAY_HOSTS" 87 | for host_port in "${hosts[@]}"; do 88 | IFS=':' read -ra parts <<< "$host_port" 89 | if [ "${#parts[@]}" -eq 2 ]; then 90 | host="${parts[0]}" 91 | port="${parts[1]}" 92 | 93 | POOL_RELAYS="$POOL_RELAYS --single-host-pool-relay $host --pool-relay-port $port" 94 | echo "POOL RELAY: ${host}:${port}" 95 | else 96 | echo "Invalid format in PUBLIC_RELAY_HOSTS: $host_port." 97 | exit 98 | fi 99 | done 100 | else 101 | if [ "${PUBLIC_RELAY_IP}" == "TOPOLOGY" ]; then 102 | relay_ip=$(jq -r ".Producers[0].addr" ${NODE_PATH}/topology.json) 103 | relay_port=$(jq -r ".Producers[0].port" ${NODE_PATH}/topology.json) 104 | fi 105 | if [ "${PUBLIC_RELAY_IP}" == "PUBLIC" ]; then 106 | relay_ip=$(get_public_ip) 107 | fi 108 | if [ -z "$PUBLIC_RELAY_PORT" ]; then 109 | relay_port=$(jq -r ".Producers[0].port" ${NODE_PATH}/topology.json) 110 | fi 111 | 112 | POOL_RELAYS="--pool-relay-ipv4 ${relay_ip} --pool-relay-port ${relay_port}" 113 | echo "POOL RELAY: ${relay_ip}:${relay_port}" 114 | fi 115 | 116 | # Multiple owners 117 | if [ -n "$MULTI_OWNERS" ]; then 118 | echo "Multiple owners" 119 | for i in $(echo ${MULTI_OWNERS} | sed "s/,/ /g") 120 | do 121 | echo "$i" 122 | MULTIOWNERS_STRING="${MULTIOWNERS_STRING} --pool-owner-stake-verification-key-file wallets/${i}/stake.vkey" 123 | done 124 | echo $MULTIOWNERS_STRING 125 | echo "" 126 | fi 127 | 128 | cardano-cli latest stake-pool registration-certificate \ 129 | --cold-verification-key-file cold-keys/cold.vkey \ 130 | --vrf-verification-key-file pool-keys/vrf.vkey \ 131 | --pool-pledge ${POOL_PLEDGE} \ 132 | --pool-cost ${POOL_COST} \ 133 | --pool-margin ${POOL_MARGIN} \ 134 | --pool-reward-account-verification-key-file wallets/owner/stake.vkey \ 135 | --pool-owner-stake-verification-key-file wallets/owner/stake.vkey \ 136 | ${MULTIOWNERS_STRING} \ 137 | ${POOL_RELAYS##*( )} \ 138 | --metadata-url ${METADATA_URL} \ 139 | --metadata-hash ${METADATA_HASH} \ 140 | ${NETWORK_ARGUMENT} \ 141 | --out-file pool.cert \ 142 | && echo "Generated pool.cert" 143 | 144 | PAYMENT_ADDR=$(cat ${NODE_PATH}/staking/wallets/owner/payment.addr) 145 | STAKE_ADDR=$(cat ${NODE_PATH}/staking/wallets/owner/stake.addr) 146 | POOL_ID=$(cat ${NODE_PATH}/staking/POOL_ID) 147 | 148 | echo "export POOL_PLEDGE=${POOL_PLEDGE}" > POOL_VARS 149 | echo "export POOL_COST=${POOL_COST}" >> POOL_VARS 150 | echo "export POOL_MARGIN=${POOL_MARGIN}" >> POOL_VARS 151 | echo "export POOL_MARGIN=${POOL_MARGIN}" >> POOL_VARS 152 | echo "export PAYMENT_ADDR=${PAYMENT_ADDR}" >> POOL_VARS 153 | echo "export STAKE_ADDR=${STAKE_ADDR}" >> POOL_VARS 154 | echo "export POOL_ID=${POOL_ID}" >> POOL_VARS 155 | echo "export MULTI_OWNERS=${MULTI_OWNERS}" >> POOL_VARS 156 | echo "" 157 | else 158 | echo "pool.cert already exists." 159 | fi 160 | 161 | # 2. Generate delegation certificate (pledge) 162 | if [ ! -f "wallets/owner/delegation.cert" ]; then 163 | cardano-cli latest stake-address delegation-certificate \ 164 | --stake-verification-key-file wallets/owner/stake.vkey \ 165 | --cold-verification-key-file cold-keys/cold.vkey \ 166 | --out-file wallets/owner/delegation.cert \ 167 | && echo "Generated delegation.cert" 168 | else 169 | echo "delegation.cert already exists." 170 | fi 171 | 172 | # Multiple owners 173 | if [ -n "$MULTI_OWNERS" ]; then 174 | echo "Generating delegation certificates for multiple owners" 175 | for i in $(echo ${MULTI_OWNERS} | sed "s/,/ /g") 176 | do 177 | echo "- $i" 178 | if [ ! -f "wallets/$i/delegation.cert" ]; then 179 | cardano-cli latest stake-address delegation-certificate \ 180 | --stake-verification-key-file wallets/$i/stake.vkey \ 181 | --cold-verification-key-file cold-keys/cold.vkey \ 182 | --out-file wallets/$i/delegation.cert \ 183 | && echo "-- generated delegation.cert" 184 | else 185 | echo "-- delegation.cert already exists." 186 | fi 187 | done 188 | fi 189 | -------------------------------------------------------------------------------- /scripts/generate_wallet: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Init node vars 4 | source /scripts/init_node_vars 5 | 6 | walletName="$1" # eg. wallet/name/name 7 | mkdir -p ${NODE_PATH}/staking/wallets/${walletName} 8 | cd ${NODE_PATH}/staking/wallets/${walletName} 9 | 10 | #if [ -f "phrase.txt" ]; then echo -e "\033[35mWARNING - phrase.txt already present, delete it or use another name !\033[0m"; exit 2; fi 11 | if [ -f "root.prv" ]; then echo -e "\033[35mWARNING - root.prv already present, delete it or use another name !\033[0m"; exit 2; fi 12 | if [ -f "payment.xprv" ]; then echo -e "\033[35mWARNING - payment.xprv already present, delete it or use another name !\033[0m"; exit 2; fi 13 | if [ -f "payment.xpub" ]; then echo -e "\033[35mWARNING - payment.xpub already present, delete it or use another name !\033[0m"; exit 2; fi 14 | if [ -f "stake.xprv" ]; then echo -e "\033[35mWARNING - stake.xprv already present, delete it or use another name !\033[0m"; exit 2; fi 15 | if [ -f "stake.xpub" ]; then echo -e "\033[35mWARNING - stake.xpub already present, delete it or use another name !\033[0m"; exit 2; fi 16 | if [ -f "stake.xpub" ]; then echo -e "\033[35mWARNING - stake.xpub already present, delete it or use another name !\033[0m"; exit 2; fi 17 | 18 | echo 19 | if [ -f "phrase.txt" ]; then 20 | echo "Phrase already present. Generating keys from phrase." 21 | else 22 | echo "Generate Recovery Phrase: ${walletName}" 23 | cardano-address recovery-phrase generate --size 24 > phrase.txt 24 | fi 25 | 26 | echo 27 | echo "Generate Root Key: ${walletName}" 28 | cat phrase.txt | cardano-address key from-recovery-phrase Shelley > root.prv 29 | 30 | echo 31 | echo "Generate Private Keys: ${walletName}" 32 | cat root.prv | cardano-address key child 1852H/1815H/0H/0/0 > payment.xprv 33 | cat payment.xprv | cardano-address key public --with-chain-code > payment.xpub 34 | cat root.prv | cardano-address key child 1852H/1815H/0H/2/0 > stake.xprv 35 | cat stake.xprv | cardano-address key public --with-chain-code > stake.xpub 36 | 37 | echo 38 | echo "Generate Payment Address: ${walletName}" 39 | cat payment.xpub | cardano-address address payment --network-tag ${NETWORK_TAG} > candidate.addr 40 | 41 | echo 42 | echo "Generate Staking Address: ${walletName}" 43 | cat candidate.addr | cardano-address address delegation $(cat stake.xpub) > payment.candidate.addr 44 | 45 | echo 46 | echo "$(cat candidate.addr)" 47 | echo "$(cat payment.candidate.addr)" 48 | cat payment.xprv | cardano-address key inspect 49 | cat payment.xpub | cardano-address key inspect 50 | 51 | cat stake.xprv | cardano-address key inspect 52 | cat stake.xpub | cardano-address key inspect 53 | 54 | cat candidate.addr | cardano-address address inspect 55 | cat payment.candidate.addr | cardano-address address inspect 56 | 57 | # XPrv/XPub conversion to normal private and public key, keep in mind the 58 | # keypars are not a valid Ed25519 signing keypairs. 59 | SESKEY=$(cat stake.xprv | bech32 | cut -b -128 )$(cat stake.xpub | bech32) 60 | PESKEY=$(cat payment.xprv | bech32 | cut -b -128 )$(cat payment.xpub | bech32) 61 | 62 | cat << EOF > stake.skey 63 | { 64 | "type": "StakeExtendedSigningKeyShelley_ed25519_bip32", 65 | "description": "", 66 | "cborHex": "5880$SESKEY" 67 | } 68 | EOF 69 | 70 | cat << EOF > payment.skey 71 | { 72 | "type": "PaymentExtendedSigningKeyShelley_ed25519_bip32", 73 | "description": "Payment Signing Key", 74 | "cborHex": "5880$PESKEY" 75 | } 76 | EOF 77 | 78 | echo 79 | echo "Checking whether cardano-address and cardano-cli outputs match after conversion." 80 | cardano-cli shelley key verification-key --signing-key-file stake.skey --verification-key-file stake.evkey 81 | cardano-cli shelley key verification-key --signing-key-file payment.skey --verification-key-file payment.evkey 82 | 83 | cardano-cli shelley key non-extended-key --extended-verification-key-file stake.evkey --verification-key-file stake.vkey 84 | cardano-cli shelley key non-extended-key --extended-verification-key-file payment.evkey --verification-key-file payment.vkey 85 | 86 | cardano-cli shelley stake-address build --stake-verification-key-file stake.vkey ${NETWORK_ARGUMENT} > stake.addr 87 | cardano-cli shelley address build --payment-verification-key-file payment.vkey ${NETWORK_ARGUMENT} > addr 88 | 89 | cardano-cli shelley address build \ 90 | --payment-verification-key-file payment.vkey \ 91 | --stake-verification-key-file stake.vkey \ 92 | ${NETWORK_ARGUMENT} > payment.addr 93 | 94 | 95 | echo 96 | echo "Important the base.addr and the base.addr_candidate must be the same" 97 | diff payment.addr payment.candidate.addr 98 | echo 99 | 100 | echo 101 | echo $(cat candidate.addr) 102 | echo $(cat addr) 103 | echo 104 | 105 | echo 106 | echo $(cat payment.candidate.addr) 107 | echo $(cat payment.addr) 108 | echo 109 | 110 | if [[ "$(cat payment.candidate.addr)" != "$(cat payment.addr)" ]]; then 111 | 112 | echo -e "\033[35mWARNING - payment.candidate.addr doesn't match payment.addr! Serious ERROR!!!!\033[0m"; exit 2; 113 | fi 114 | 115 | if [[ "$(cat candidate.addr)" != "$(cat addr)" ]]; then 116 | 117 | echo -e "\033[35mWARNING - candidate.addr doesn't match addr! Serious ERROR!!!!\033[0m"; exit 2; 118 | fi -------------------------------------------------------------------------------- /scripts/generate_wallet_old: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Following guide: 4 | # https://github.com/input-output-hk/cardano-tutorials/blob/master/node-setup/020_keys_and_addresses.md 5 | 6 | # Init node vars 7 | source /scripts/init_node_vars 8 | 9 | WALLET=$1 10 | mkdir -p ${NODE_PATH}/staking/wallets/${WALLET} 11 | cd ${NODE_PATH}/staking/wallets/${WALLET} 12 | 13 | echo "" 14 | echo "Generate stake addresses" 15 | 16 | # Generate key & address 17 | ## Generate Payment key pair 18 | if [ ! -f "payment.skey" ]; then 19 | cardano-cli address key-gen \ 20 | --verification-key-file payment.vkey \ 21 | --signing-key-file payment.skey 22 | echo "Generated payment.vkey and payment.skey." 23 | else 24 | echo "Payment key pair already exists." 25 | fi 26 | 27 | ## Generate Stake key pair 28 | if [ ! -f "stake.skey" ]; then 29 | cardano-cli stake-address key-gen \ 30 | --verification-key-file stake.vkey \ 31 | --signing-key-file stake.skey 32 | echo "Generated stake.vkey and stake.skey." 33 | else 34 | 35 | echo "Stake key pair already exists." 36 | fi 37 | 38 | ## Generate Payment address 39 | if [ ! -f "payment.addr" ]; then 40 | cardano-cli address build \ 41 | --payment-verification-key-file payment.vkey \ 42 | --stake-verification-key-file stake.vkey \ 43 | --out-file payment.addr \ 44 | --mainnet 45 | echo "Generated payment.addr." 46 | PAYMENT_ADDR=$(cat payment.addr) 47 | echo "Payment address: ${PAYMENT_ADDR}." 48 | else 49 | PAYMENT_ADDR=$(cat payment.addr) 50 | echo "Payment address already exists: ${PAYMENT_ADDR}." 51 | fi 52 | 53 | ## Generate Stake address 54 | if [ ! -f "stake.addr" ]; then 55 | cardano-cli stake-address build \ 56 | --stake-verification-key-file stake.vkey \ 57 | --out-file stake.addr \ 58 | --mainnet 59 | 60 | echo "Generated stake.addr." 61 | STAKE_ADDR=$(cat stake.addr) 62 | echo "Stake address: ${STAKE_ADDR}." 63 | else 64 | STAKE_ADDR=$(cat stake.addr) 65 | echo "Stake address already exists: ${STAKE_ADDR}." 66 | fi -------------------------------------------------------------------------------- /scripts/get_topology_str.py: -------------------------------------------------------------------------------- 1 | import os 2 | from init_config import parse_topology_str 3 | 4 | if __name__ == '__main__': 5 | topology = parse_topology_str(os.environ.get('NODE_TOPOLOGY', '')) 6 | 7 | _topology = [] 8 | for t in topology: 9 | _topology.append('%s,%s,%s' % (t.get('addr'), t.get('port'), t.get('valency'))) 10 | print('|'.join(_topology)) 11 | -------------------------------------------------------------------------------- /scripts/init_config.py: -------------------------------------------------------------------------------- 1 | import os 2 | import shutil 3 | import re 4 | import argparse 5 | import json 6 | import socket 7 | import time 8 | 9 | CONFIG_TEMPLATES_ROOT_PATH = '/cfg-templates/' 10 | CONFIG_OUTPUT_ROOT_PATH = '/config/' 11 | 12 | def slugify(value): 13 | """ 14 | Normalizes string, converts to lowercase, removes non-alpha characters, 15 | and converts spaces to hyphens. 16 | """ 17 | value = re.sub('[^-a-zA-Z0-9_.]+', '', value) 18 | 19 | return value 20 | 21 | def str2bool(v:str): 22 | """Converts string to boolean""" 23 | return v.lower() in ('yes', 'true', 't', '1') 24 | 25 | def save_json(path:str, data): 26 | with open(path, 'w') as outfile: 27 | json.dump(data, outfile, indent=1) 28 | 29 | def load_json(path:str): 30 | with open(path, 'r') as inputfile: 31 | return json.load(inputfile) 32 | 33 | def init_args(): 34 | # Parse arguments 35 | parser = argparse.ArgumentParser(description='Cardano Configurator') 36 | parser.add_argument('--node-port', dest='node_port', help='Port of node. Defaults to 3000.', type=int, default=os.environ.get('NODE_PORT', 3000)) 37 | parser.add_argument('--node-name', dest='name', help='Name of node. Defaults to node1.', type=slugify, default=os.environ.get('NODE_NAME', 'node1')) 38 | parser.add_argument('--node-topology', dest='topology', help='Topology of the node. Should be comma separated for each individual node to add, on the form: :/. So for example: 127.0.0.1:3001/1,127.0.0.1:3002/1.', type=str, default=os.environ.get('NODE_TOPOLOGY', '')) 39 | parser.add_argument('--node-relay', dest='relay', help='Set to 1 if default IOHK relay should be added to the network topology.', type=str2bool, default=os.environ.get('NODE_RELAY', False)) 40 | parser.add_argument('--p2p', dest='p2p', help='Peer2Peer.', type=str2bool, default=os.environ.get('ENABLEP2P', False)) 41 | parser.add_argument('--cardano-network', dest='network', help='Carano network to use (main, test, pioneer). Defaults to main.', type=str, default=os.environ.get('CARDANO_NETWORK', 'main')) 42 | parser.add_argument('--ekg-port', dest='ekg_port', help='Port of EKG monitoring. Defaults to 12788.', type=int, default=os.environ.get('EKG_PORT', 12788)) 43 | parser.add_argument('--prometheus-host', dest='prometheus_host', help='Host of Prometheus monitoring. Defaults to 127.0.0.1.', type=str, default=os.environ.get('PROMETHEUS_HOST', '127.0.0.1')) 44 | parser.add_argument('--prometheus-port', dest='prometheus_port', help='Port of Prometheus monitoring. Defaults to 12798.', type=int, default=os.environ.get('PROMETHEUS_PORT', 12798)) 45 | parser.add_argument('--resolve-hostnames', dest='resolve_hostnames', help='Resolve hostnames in topology to IP-addresses.', type=str2bool, default=os.environ.get('RESOLVE_HOSTNAMES', False)) 46 | parser.add_argument('--replace-existing', dest='replace_existing', help='Replace existing configs.', type=str2bool, default=os.environ.get('REPLACE_EXISTING_CONFIG', False)) 47 | args = parser.parse_args() 48 | 49 | # Init network specific paths 50 | args.CONFIG_TEMPLATES_PATH = os.path.join(CONFIG_TEMPLATES_ROOT_PATH, args.network) 51 | CONFIG_NAME = args.network+'-'+args.name 52 | args.CONFIG_OUTPUT_PATH = os.path.join(CONFIG_OUTPUT_ROOT_PATH, CONFIG_NAME) 53 | args.BYRON_GENESIS_PATH = os.path.join(args.CONFIG_OUTPUT_PATH, 'byron-genesis.json') 54 | args.SHELLEY_GENESIS_PATH = os.path.join(args.CONFIG_OUTPUT_PATH, 'shelley-genesis.json') 55 | args.ALONZO_GENESIS_PATH = os.path.join(args.CONFIG_OUTPUT_PATH, 'alonzo-genesis.json') 56 | args.CONWAY_GENESIS_PATH = os.path.join(args.CONFIG_OUTPUT_PATH, 'conway-genesis.json') 57 | if args.p2p and args.relay: 58 | args.TOPOLOGY_PATH = os.path.join(args.CONFIG_OUTPUT_PATH, 'topology-p2p.json') 59 | else: 60 | args.TOPOLOGY_PATH = os.path.join(args.CONFIG_OUTPUT_PATH, 'topology.json') 61 | args.CONFIG_PATH = os.path.join(args.CONFIG_OUTPUT_PATH, 'config.json') 62 | args.VARS_PATH = os.path.join(args.CONFIG_OUTPUT_PATH, 'VARS') 63 | 64 | return args 65 | 66 | def init_folder(args): 67 | """Creates network/node config folders""" 68 | if not os.path.exists(args.CONFIG_OUTPUT_PATH): 69 | os.makedirs(args.CONFIG_OUTPUT_PATH) 70 | 71 | def init_genesis(args): 72 | """Initializes the genesis file""" 73 | 74 | CONWAY_SRC = os.path.join(args.CONFIG_TEMPLATES_PATH, 'conway-genesis.json') 75 | ALONZO_SRC = os.path.join(args.CONFIG_TEMPLATES_PATH, 'alonzo-genesis.json') 76 | SHELLEY_SRC = os.path.join(args.CONFIG_TEMPLATES_PATH, 'shelley-genesis.json') 77 | BYRON_SRC = os.path.join(args.CONFIG_TEMPLATES_PATH, 'byron-genesis.json') 78 | 79 | if not os.path.exists(args.CONWAY_GENESIS_PATH) or args.replace_existing: 80 | print('Generating new conway genesis file %s from template %s' % (args.CONWAY_GENESIS_PATH, CONWAY_SRC)) 81 | shutil.copy(CONWAY_SRC, args.CONWAY_GENESIS_PATH) 82 | 83 | if not os.path.exists(args.ALONZO_GENESIS_PATH) or args.replace_existing: 84 | print('Generating new alonzo genesis file %s from template %s' % (args.ALONZO_GENESIS_PATH, ALONZO_SRC)) 85 | shutil.copy(ALONZO_SRC, args.ALONZO_GENESIS_PATH) 86 | 87 | if not os.path.exists(args.SHELLEY_GENESIS_PATH) or args.replace_existing: 88 | print('Generating new shelley genesis file %s from template %s' % (args.SHELLEY_GENESIS_PATH, SHELLEY_SRC)) 89 | shutil.copy(SHELLEY_SRC, args.SHELLEY_GENESIS_PATH) 90 | 91 | if not os.path.exists(args.BYRON_GENESIS_PATH) or args.replace_existing: 92 | print('Generating new byron genesis file %s from template %s' % (args.BYRON_GENESIS_PATH, BYRON_SRC)) 93 | shutil.copy(BYRON_SRC, args.BYRON_GENESIS_PATH) 94 | 95 | 96 | def resolve_hostname(hostname, tries=0): 97 | """Resolve IP from hostname""" 98 | try: 99 | return socket.gethostbyname(hostname) 100 | except: 101 | if tries<10: 102 | time.sleep(1) 103 | 104 | return resolve_hostname(hostname, tries=tries+1) 105 | else: 106 | return hostname 107 | 108 | def parse_topology_str(args) -> list: 109 | """Parses node-topology string and returns list of dicts""" 110 | topology = [] 111 | 112 | s = args.topology 113 | if s: 114 | for a in s.split(','): 115 | (ip_port, valency) = a.split('/') 116 | (ip, port) = ip_port.split(':') 117 | 118 | #if resolve_hostname: ip = resolve_hostname(ip) 119 | 120 | if args.p2p: 121 | topology.append({ 122 | "accessPoints": [{ 123 | 'address': str(ip), 124 | 'port': int(port) 125 | }], 126 | "advertise": False, 127 | "trustable": True, 128 | "valency": int(valency) 129 | }) 130 | else: 131 | topology.append({ 132 | 'addr': str(ip), 133 | 'port': int(port), 134 | 'valency': int(valency) 135 | }) 136 | 137 | return topology 138 | 139 | 140 | def init_topology(args): 141 | """Initializes the topology file""" 142 | 143 | if args.relay: 144 | if args.p2p: 145 | INPUT_PATH = os.path.join(args.CONFIG_TEMPLATES_PATH, 'topology-relay-p2p.json') 146 | else: 147 | INPUT_PATH = os.path.join(args.CONFIG_TEMPLATES_PATH, 'topology-relay.json') 148 | 149 | else: 150 | INPUT_PATH = os.path.join(args.CONFIG_TEMPLATES_PATH, 'topology.json') 151 | 152 | if not os.path.exists(args.TOPOLOGY_PATH) or args.replace_existing: 153 | print('Generating new topology %s from template %s' % (args.TOPOLOGY_PATH, INPUT_PATH)) 154 | print('Topology: ', args.topology) 155 | 156 | # Load template file 157 | data = load_json(INPUT_PATH) 158 | 159 | # Parse topology string 160 | topology = parse_topology_str(args) 161 | 162 | # Add default IOHK relay 163 | 164 | if args.p2p and args.relay: 165 | data['localRoots'] = topology 166 | else: 167 | data['Producers'] = data['Producers']+topology 168 | 169 | save_json(args.TOPOLOGY_PATH, data) 170 | 171 | def init_config(args): 172 | """Initializes the config file""" 173 | 174 | if not os.path.exists(args.CONFIG_PATH) or args.replace_existing: 175 | INPUT_PATH = os.path.join(args.CONFIG_TEMPLATES_PATH, 'config.json') 176 | 177 | print('Generating new config file %s from template %s' % (args.CONFIG_PATH, INPUT_PATH)) 178 | 179 | data = load_json(INPUT_PATH) 180 | data['hasEKG'] = args.ekg_port 181 | data['hasPrometheus'] = [args.prometheus_host, args.prometheus_port] 182 | save_json(args.CONFIG_PATH, data) 183 | 184 | # Set genesis 185 | print('Updating config %s' % (args.CONFIG_PATH)) 186 | INPUT_PATH2 = os.path.join(args.CONFIG_PATH) 187 | data2 = load_json(INPUT_PATH2) 188 | data2['ShelleyGenesisFile'] = args.SHELLEY_GENESIS_PATH 189 | data2['ByronGenesisFile'] = args.BYRON_GENESIS_PATH 190 | data2['AlonzoGenesisFile'] = args.ALONZO_GENESIS_PATH 191 | data2['ConwayGenesisFile'] = args.CONWAY_GENESIS_PATH 192 | save_json(args.CONFIG_PATH, data2) 193 | 194 | 195 | def init_vars(args): 196 | INPUT_PATH = os.path.join(args.CONFIG_TEMPLATES_PATH, 'VARS') 197 | 198 | if not os.path.exists(args.VARS_PATH) or args.replace_existing: 199 | print('Generating new VARS %s from template %s' % (args.VARS_PATH, INPUT_PATH)) 200 | 201 | # Just copy it 202 | shutil.copy(INPUT_PATH, args.VARS_PATH) 203 | 204 | if __name__ == '__main__': 205 | args = init_args() 206 | 207 | init_folder(args) 208 | init_genesis(args) 209 | init_topology(args) 210 | init_config(args) 211 | #init_vars(args) 212 | -------------------------------------------------------------------------------- /scripts/init_node_vars: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | export NODE_PATH=/config/${CARDANO_NETWORK}-${NODE_NAME} 4 | export DB_PATH=${NODE_PATH}/db 5 | 6 | if [[ "${CARDANO_NODE_SOCKET_PATH}" == "DEFAULT" ]]; then 7 | export CARDANO_NODE_SOCKET_PATH=${NODE_PATH}/node.socket 8 | fi 9 | 10 | source /scripts/logging_vars 11 | source /cfg-templates/${CARDANO_NETWORK}/VARS 12 | -------------------------------------------------------------------------------- /scripts/leaderlogs: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source /scripts/init_node_vars 4 | 5 | # Init vars 6 | POOL_ID=$(cat ${NODE_PATH}/staking/POOL_ID) 7 | VRF=${NODE_PATH}/staking/pool-keys/vrf.skey 8 | LSET="${1:-current}" 9 | 10 | case ${LSET} in 11 | current) EPOCH=$(current_epoch) ;; 12 | next) EPOCH=$(($(current_epoch)+1)) ;; 13 | *) echo "Invalid argument. Must be either current|next"; exit ;; 14 | esac 15 | 16 | echo "Running leaderlogs for ${LSET} epoch ${EPOCH}" 17 | 18 | mkdir -p ${NODE_PATH}/leaderlogs 19 | 20 | cardano-cli query leadership-schedule \ 21 | ${NETWORK_ARGUMENT} \ 22 | --genesis ${NODE_PATH}/shelley-genesis.json \ 23 | --stake-pool-id ${POOL_ID} \ 24 | --vrf-signing-key-file ${VRF} \ 25 | --${LSET} | tee ${NODE_PATH}/leaderlogs/${EPOCH}.txt 26 | -------------------------------------------------------------------------------- /scripts/leaderlogs_cncli: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source /scripts/init_node_vars 4 | 5 | # Init vars 6 | POOL_ID=$(cat ${NODE_PATH}/staking/POOL_ID) 7 | BYRON_GENESIS=${NODE_PATH}/byron-genesis.json 8 | SHELLEY_GENESIS=${NODE_PATH}/shelley-genesis.json 9 | VRF=${NODE_PATH}/staking/pool-keys/vrf.skey 10 | SNAPSHOT=/tmp/stake-snapshot.json 11 | LSET="${1:-current}" 12 | TZ=$(cat /etc/timezone) 13 | 14 | case ${LSET} in 15 | prev|current|next) echo "Running leaderlogs for ${LSET} epoch" ;; 16 | *) echo "Invalid argument. Must be either prev|current|next"; exit ;; 17 | esac 18 | 19 | echo "Generating snapshot" 20 | cardano-cli query stake-snapshot --stake-pool-id ${POOL_ID} ${NETWORK_ARGUMENT} > ${SNAPSHOT} 21 | ACTIVE_STAKE=$(cat $SNAPSHOT | jq .activeStakeSet) 22 | POOL_STAKE=$(cat $SNAPSHOT | jq .poolStakeSet) 23 | 24 | # Get leaderlogs 25 | echo "Running leaderlogs" 26 | cncli leaderlog --db ${NODE_PATH}/cncli.db \ 27 | --pool-id ${POOL_ID} \ 28 | --pool-vrf-skey ${VRF} \ 29 | --byron-genesis ${BYRON_GENESIS} \ 30 | --shelley-genesis ${SHELLEY_GENESIS} \ 31 | --active-stake ${ACTIVE_STAKE} \ 32 | --pool-stake ${POOL_STAKE} \ 33 | --tz ${TZ} \ 34 | --ledger-set ${LSET} | tee ${NODE_PATH}/leaderlog_cncli.json -------------------------------------------------------------------------------- /scripts/logging_vars: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | CHECK_MARK="\u2705" 4 | CROSS_MARK="\u274c" 5 | -------------------------------------------------------------------------------- /scripts/mithril/generate_mithril_config: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | mkdir -p /config/mithril/stores 4 | 5 | FILE=/config/mithril/config.env 6 | if [ -f "$FILE" ]; then 7 | echo "$FILE exists." 8 | else 9 | cat > ${FILE} << EOF 10 | export PARTY_ID=${POOL_ID} 11 | export KES_SECRET_KEY_PATH=${NODE_PATH}/staking/pool-keys/kes.skey 12 | export OPERATIONAL_CERTIFICATE_PATH=${NODE_PATH}/staking/pool-keys/node.cert 13 | export NETWORK=mainnet 14 | export AGGREGATOR_ENDPOINT=https://aggregator.release-mainnet.api.mithril.network/aggregator 15 | export RUN_INTERVAL=60000 16 | export DB_DIRECTORY=${NODE_PATH}/db/ 17 | export CARDANO_NODE_SOCKET_PATH=${NODE_PATH}/node.socket 18 | export CARDANO_CLI_PATH=/bin/cardano-cli 19 | export DATA_STORES_DIRECTORY=/config/mithril/stores 20 | export STORE_RETENTION_LIMIT=5 21 | export ERA_READER_ADAPTER_TYPE=cardano-chain 22 | export ERA_READER_ADAPTER_PARAMS='{"address":"addr1qy72kwgm6kypyc5maw0h8mfagwag8wjnx6emgfnsnhqaml6gx7gg4tzplw9l32nsgclqax7stc4u6c5dn0ctljwscm2sqv0teg","verification_key":"5b31312c3133342c3231352c37362c3134312c3232302c3131312c3135342c36332c3233302c3131342c31322c38372c37342c39342c3137322c3133322c32372c39362c3138362c3132362c3137382c31392c3131342c33302c3234332c36342c3134312c3131302c38332c38362c31395d"}' 23 | export RELAY_ENDPOINT=${RELAY_ENDPOINT} 24 | EOF 25 | fi -------------------------------------------------------------------------------- /scripts/mithril/run_mithril: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | generate_mithril_config 4 | 5 | source /config/mithril/config.env && mithril-signer -vvv -------------------------------------------------------------------------------- /scripts/mithril/verify_signer_registration.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | source /config/mithril/config.env 6 | 7 | if [ -z "$AGGREGATOR_ENDPOINT" ] || [ -z "$PARTY_ID" ]; then 8 | echo ">> ERROR: Required environment variables AGGREGATOR_ENDPOINT and/or PARTY_ID are not set." 9 | exit 1 10 | fi 11 | 12 | CURRENT_EPOCH=$(curl -s "$AGGREGATOR_ENDPOINT/epoch-settings" -H 'accept: application/json' | jq -r '.epoch') 13 | SIGNERS_REGISTERED_RESPONSE=$(curl -s "$AGGREGATOR_ENDPOINT/signers/registered/$CURRENT_EPOCH" -H 'accept: application/json') 14 | 15 | if echo "$SIGNERS_REGISTERED_RESPONSE" | grep -q "$PARTY_ID"; then 16 | echo ">> Congrats, your signer node is registered!" 17 | else 18 | echo ">> Oops, your signer node is not registered. Party ID not found among the signers registered at epoch ${CURRENT_EPOCH}." 19 | fi 20 | -------------------------------------------------------------------------------- /scripts/register_stake_address: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # From Documentation 4 | # https://github.com/input-output-hk/cardano-tutorials/blob/master/node-setup/040_transactions.md 5 | # https://github.com/input-output-hk/cardano-tutorials/blob/master/node-setup/050_register_key.md 6 | 7 | # Init functions and vars 8 | 9 | source /scripts/functions/check_balance 10 | source /scripts/functions/check_address_registration 11 | source /scripts/functions/wait_for_address_registration 12 | source /scripts/functions/wait_for_slot 13 | source /scripts/functions/wait_for_sync 14 | source /scripts/init_node_vars 15 | 16 | # Define wallet 17 | WALLET=$1 18 | 19 | if [ -z "$WALLET" ]; then 20 | echo "Wallet is undefined." 21 | exit 22 | fi 23 | 24 | # Enter staking directory 25 | cd ${NODE_PATH}/staking/wallets/${WALLET} 26 | STAKE_ADDR=$(cat ${NODE_PATH}/staking/wallets/${WALLET}/stake.addr) 27 | 28 | echo "" 29 | echo "Submitting staking addresses for $WALLET to the blockchain." 30 | 31 | # Check for required files 32 | if [ ! -f "stake.vkey" ]; then 33 | echo "Missing required wallets/${WALLET}/stake.vkey. You need to run \`generate_wallet ${WALLET}\` to generate this key." 34 | MISSING_FILES=1 35 | fi 36 | 37 | if [ ! -f "stake.skey" ]; then 38 | echo "Missing required wallets/${WALLET}/stake.skey. You need to run \`generate_wallet ${WALLET}\` to generate this key." 39 | MISSING_FILES=1 40 | fi 41 | 42 | if [ ! -f "payment.skey" ]; then 43 | echo "Missing required wallets/${WALLET}/payment.skey. You need to run \`generate_wallet ${WALLET}\` to generate this key." 44 | MISSING_FILES=1 45 | fi 46 | 47 | if [ ! -f "payment.addr" ]; then 48 | echo "Missing required wallets/${WALLET}/payment.addr. You need to run \`generate_wallet ${WALLET}\` to generate this key." 49 | MISSING_FILES=1 50 | fi 51 | 52 | if [ -n "$MISSING_FILES" ]; then 53 | exit 54 | fi 55 | 56 | # Handle arguments 57 | for i in "$@"; do 58 | case $i in 59 | --cold-create) 60 | COLD_CREATE=1 61 | ;; 62 | esac 63 | done 64 | 65 | mkdir -p transactions 66 | 67 | # Wait for node to sync 68 | if [[ "${WAIT_FOR_SYNC}" == "True" ]]; then 69 | wait_for_sync 99.90 70 | fi 71 | 72 | if [ -z "$COLD_CREATE" ]; then 73 | if [ -n "$(check_address_registration ${STAKE_ADDR})" ]; then 74 | echo "Your stake address has already been registered in the blockchain." 75 | touch transactions/register_stake_address.submitted 76 | exit 77 | fi 78 | fi 79 | 80 | # Create an address registration certificate 81 | if [ ! -f "stake.cert" ]; then 82 | cardano-cli stake-address registration-certificate \ 83 | --staking-verification-key-file stake.vkey \ 84 | --out-file stake.cert 85 | echo "Created stake.cert" 86 | else 87 | echo "stake.cert certificate already exists." 88 | fi 89 | 90 | # Generate protocol 91 | if [ -z "$COLD_CREATE" ]; then 92 | cardano-cli query protocol-parameters \ 93 | ${NETWORK_ARGUMENT} \ 94 | --out-file ${NODE_PATH}/staking/protocol.json 95 | else 96 | if [ ! -f "${NODE_PATH}/staking/protocol.json" ]; then 97 | read -n 1 -r -s -p "Missing ${NODE_PATH}/staking/protocol.json. You must transfer this file from an online node. Press ENTER when you have placed the file and are ready to continue." 98 | fi 99 | fi 100 | 101 | # Get key-deposit 102 | KEY_DEPOSIT=$(jq -r .stakeAddressDeposit ${NODE_PATH}/staking/protocol.json) 103 | 104 | # Find UTXO in address with enough lovelace to do the transaction 105 | ADDRESS=$(cat payment.addr) 106 | check_balance ${KEY_DEPOSIT} 107 | 108 | # Draft transaction 109 | cardano-cli transaction build-raw \ 110 | --tx-in "${UTXO}#${TXIX}" \ 111 | --tx-out ${ADDRESS}+0 \ 112 | --ttl 0 \ 113 | --fee 0 \ 114 | --out-file transactions/register_stake_address.draft \ 115 | --certificate-file stake.cert 116 | 117 | # Calculate fees 118 | FEE=$(cardano-cli transaction calculate-min-fee \ 119 | --tx-body-file transactions/register_stake_address.draft \ 120 | --tx-in-count 1 \ 121 | --tx-out-count 1 \ 122 | --witness-count 1 \ 123 | --byron-witness-count 0 \ 124 | ${NETWORK_ARGUMENT} \ 125 | --protocol-params-file ${NODE_PATH}/staking/protocol.json | tr ' ' '\n' | head -1) 126 | 127 | TOTAL_PRICE=$(expr ${FEE} + ${KEY_DEPOSIT}) 128 | echo "Fee is: ${FEE} Lovelace" 129 | echo "Key-Deposit: ${KEY_DEPOSIT} Lovelace" 130 | echo "Total Price is: ${TOTAL_PRICE}" 131 | 132 | # Find UTXO in address with enough lovelace to do the transaction 133 | if [ -z "$COLD_CREATE" ]; then 134 | check_balance ${TOTAL_PRICE} 135 | SLOT=$(get_slot) 136 | else 137 | read -p "Enter the current tip slot: " SLOT 138 | fi 139 | 140 | # Get slot and TTL 141 | TTL=$(expr ${SLOT} + 500) 142 | 143 | # Display transaction info 144 | REMAINING_AFTER_TX=$(expr ${LOVELACE} - ${TOTAL_PRICE}) 145 | echo "Creating transaction" 146 | echo "Lovelace after transaction: ${REMAINING_AFTER_TX}" 147 | echo "Current slot: ${SLOT}" 148 | echo "TTL: ${TTL}" 149 | 150 | # 151 | # Create the transaction 152 | # 153 | cardano-cli transaction build-raw \ 154 | --tx-in "${UTXO}#${TXIX}" \ 155 | --tx-out ${ADDRESS}+${REMAINING_AFTER_TX} \ 156 | --ttl ${TTL} \ 157 | --fee ${FEE} \ 158 | --out-file transactions/register_stake_address.raw \ 159 | --certificate-file stake.cert 160 | 161 | # Sign the transaction 162 | cardano-cli transaction sign \ 163 | --tx-body-file transactions/register_stake_address.raw \ 164 | --signing-key-file payment.skey \ 165 | --signing-key-file stake.skey \ 166 | ${NETWORK_ARGUMENT} \ 167 | --out-file transactions/register_stake_address.signed 168 | 169 | 170 | # Submit the transaction 171 | if [ -z "$COLD_CREATE" ]; then 172 | read -n 1 -r -s -p $'Press enter to submit the stake address certificate...\n' 173 | 174 | OUT=$(cardano-cli transaction submit \ 175 | --tx-file transactions/register_stake_address.signed \ 176 | ${NETWORK_ARGUMENT} 2>&1) 177 | 178 | if [[ $OUT =~ "Error" ]] 179 | then 180 | echo "An error occoured." 181 | echo ${OUT} 182 | read 183 | else 184 | echo "Transaction has been submitted to the blockchain." 185 | echo ${OUT} 186 | 187 | # Wait for blockchain to register the address 188 | wait_for_address_registration ${STAKE_ADDR} 189 | echo "Your stake address is now registered in the blockchain." 190 | touch transactions/register_stake_address.submitted 191 | fi 192 | fi 193 | -------------------------------------------------------------------------------- /scripts/register_stake_pool: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # From Documentation 4 | # https://github.com/input-output-hk/cardano-tutorials/blob/master/node-setup/080_register_stakepool.md 5 | 6 | # Init vars 7 | source /scripts/functions/check_balance 8 | source /scripts/functions/check_pool_registration 9 | source /scripts/functions/wait_for_pool_registration 10 | source /scripts/functions/wait_for_slot 11 | source /scripts/functions/wait_for_sync 12 | source /scripts/init_node_vars 13 | TIMESTAMP=$(date +%s) 14 | 15 | # Enter staking directory 16 | cd ${NODE_PATH}/staking/ 17 | mkdir -p wallets/owner/transactions 18 | 19 | echo "" 20 | echo "Submitting stake pool certificates to the blockchain." 21 | 22 | # Check for required files 23 | if [ ! -f "wallets/owner/stake.skey" ]; then 24 | echo "Missing required wallets/${WALLET}/stake.skey. You need to run \`generate_wallet owner\` to generate this key." 25 | MISSING_FILES=1 26 | fi 27 | 28 | if [ ! -f "wallets/owner/payment.skey" ]; then 29 | echo "Missing required wallets/${WALLET}/payment.skey. You need to run \`generate_wallet owner\` to generate this key." 30 | MISSING_FILES=1 31 | fi 32 | 33 | if [ ! -f "wallets/owner/payment.addr" ]; then 34 | echo "Missing required wallets/${WALLET}/payment.addr. You need to run \`generate_wallet owner\` to generate this key." 35 | MISSING_FILES=1 36 | fi 37 | 38 | if [ ! -f "cold-keys/cold.skey" ]; then 39 | echo "Missing required staking/cold-keys/cold.skey. You need to run \`generate_operational_certificate\` to generate this key." 40 | MISSING_FILES=1 41 | fi 42 | 43 | if [ ! -f "pool.cert" ]; then 44 | echo "Missing required staking/pool.cert. You need to run \`generate_registration_certificate\` to generate this certificate." 45 | MISSING_FILES=1 46 | fi 47 | 48 | if [ ! -f "wallets/owner/delegation.cert" ]; then 49 | echo "Missing required staking/wallets/owner/delegation.cert. You need to run \`generate_registration_certificate\` to generate this certificate." 50 | MISSING_FILES=1 51 | fi 52 | 53 | if [ -n "$MISSING_FILES" ]; then 54 | exit 55 | fi 56 | 57 | # Handle arguments 58 | for i in "$@" 59 | do 60 | case $i in 61 | --update) 62 | UPDATE=1 63 | ;; 64 | --no_deleg) 65 | NO_DELEG=1 66 | ;; 67 | --cold-create) 68 | COLD_CREATE=1 69 | ;; 70 | esac 71 | done 72 | 73 | EXTRA_FEE=15000 74 | 75 | # Wait for node to sync 76 | if [[ "${WAIT_FOR_SYNC}" == "True" ]]; then 77 | wait_for_sync 99.90 78 | fi 79 | 80 | # Generate protocol 81 | if [ -z "$COLD_CREATE" ]; then 82 | cardano-cli query protocol-parameters \ 83 | ${NETWORK_ARGUMENT} \ 84 | --out-file ${NODE_PATH}/staking/protocol.json 85 | else 86 | if [ ! -f "${NODE_PATH}/staking/protocol.json" ]; then 87 | read -n 1 -r -s -p "Missing ${NODE_PATH}/staking/protocol.json. You must transfer this file from an online node. Press ENTER when you have placed the file and is ready to continue." 88 | fi 89 | fi 90 | 91 | # Get pool-deposit 92 | if [ -z "$UPDATE" ]; then 93 | POOL_DEPOSIT=$(jq -r .stakePoolDeposit protocol.json) 94 | else 95 | POOL_DEPOSIT=0 96 | fi 97 | 98 | # Find UTXO in address with enough lovelace to do the transaction 99 | ADDRESS=$(cat wallets/owner/payment.addr) 100 | check_balance $(expr ${POOL_DEPOSIT} + ${EXTRA_FEE}) 101 | 102 | # Multiowners delegation certificates 103 | if [ -n "$MULTI_OWNERS" ]; then 104 | echo "Multiple owner delegation certificates" 105 | for i in $(echo ${MULTI_OWNERS} | sed "s/,/ /g") 106 | do 107 | echo "$i" 108 | MULTIOWNERS_CERT_STRING="${MULTIOWNERS_CERT_STRING} --certificate-file wallets/$i/delegation.cert" 109 | MULTIOWNERS_SIGN="${MULTIOWNERS_SIGN} --signing-key-file wallets/$i/stake.skey" 110 | done 111 | echo $MULTIOWNERS_CERT_STRING 112 | echo $MULTIOWNERS_SIGN 113 | fi 114 | 115 | if [ -z "$NO_DELEG" ]; then 116 | DELEG_CERTS="--certificate-file wallets/owner/delegation.cert ${MULTIOWNERS_CERT_STRING}" 117 | fi 118 | 119 | # Draft transaction 120 | cardano-cli transaction build-raw \ 121 | --tx-in "${UTXO}#${TXIX}" \ 122 | --tx-out ${ADDRESS}+0 \ 123 | --ttl 0 \ 124 | --fee 0 \ 125 | --out-file wallets/owner/transactions/register_stake_pool.draft \ 126 | --certificate-file pool.cert ${DELEG_CERTS} 127 | 128 | 129 | ## Calculate the fee 130 | FEE=$(cardano-cli transaction calculate-min-fee \ 131 | --tx-body-file wallets/owner/transactions/register_stake_pool.draft \ 132 | --tx-in-count 1 \ 133 | --tx-out-count 1 \ 134 | ${NETWORK_ARGUMENT} \ 135 | --witness-count 1 \ 136 | --byron-witness-count 0 \ 137 | --protocol-params-file protocol.json | tr ' ' '\n' | head -1) 138 | FEE=$(expr ${FEE} + ${EXTRA_FEE}) # FEE IS TOO SMALL? 139 | TOTAL_PRICE=$(expr ${FEE} + ${POOL_DEPOSIT}) 140 | 141 | echo "Fee is: ${FEE} Lovelace" 142 | echo "Pool-Deposit: ${POOL_DEPOSIT} Lovelace" 143 | echo "Total Price is: ${TOTAL_PRICE} Lovelace" 144 | 145 | # Find UTXO in address with enough lovelace to do the transaction 146 | if [ -z "$COLD_CREATE" ]; then 147 | check_balance ${TOTAL_PRICE} 148 | SLOT=$(get_slot) 149 | else 150 | read -p "Enter the current tip slot: " SLOT 151 | fi 152 | TTL=$(expr ${SLOT} + 500) 153 | 154 | # Display transaction info 155 | REMAINING_AFTER_TX=$(expr ${LOVELACE} - ${TOTAL_PRICE}) 156 | echo "Creating transaction" 157 | echo "Lovelace after transaction: ${REMAINING_AFTER_TX}" 158 | echo "Current tip Slot: ${SLOT}" 159 | echo "TTL: ${TTL}" 160 | 161 | # 162 | # Create the transaction 163 | # 164 | echo "Create transaction" 165 | cardano-cli transaction build-raw \ 166 | --tx-in "${UTXO}#${TXIX}" \ 167 | --tx-out ${ADDRESS}+${REMAINING_AFTER_TX} \ 168 | --ttl ${TTL} \ 169 | --fee ${FEE} \ 170 | --out-file wallets/owner/transactions/register_stake_pool.raw \ 171 | --certificate-file pool.cert ${DELEG_CERTS} 172 | 173 | # Sign the transaction 174 | echo "Sign transaction" 175 | cardano-cli transaction sign \ 176 | --tx-body-file wallets/owner/transactions/register_stake_pool.raw \ 177 | --signing-key-file wallets/owner/payment.skey \ 178 | --signing-key-file wallets/owner/stake.skey \ 179 | ${MULTIOWNERS_SIGN} \ 180 | --signing-key-file cold-keys/cold.skey \ 181 | ${NETWORK_ARGUMENT} \ 182 | --out-file wallets/owner/transactions/register_stake_pool.signed 183 | 184 | 185 | # Submit the transaction 186 | if [ -z "$COLD_CREATE" ]; then 187 | read -n 1 -r -s -p $'Press enter to submit the certificates...\n' 188 | 189 | echo "Submit transaction" 190 | OUT=$(cardano-cli transaction submit \ 191 | --tx-file wallets/owner/transactions/register_stake_pool.signed \ 192 | ${NETWORK_ARGUMENT} 2>&1) 193 | 194 | if [[ $OUT =~ "Error" ]] 195 | then 196 | echo "An error occoured." 197 | echo ${OUT} 198 | read 199 | else 200 | echo "Transaction has been submitted to the blockchain." 201 | echo ${OUT} 202 | 203 | # Wait for blockchain to register the pool 204 | #wait_for_slot ${TTL} 205 | #wait_for_pool_registration 206 | echo "Your stake pool registration has been sent to the blockchain." 207 | touch ${NODE_PATH}/staking/wallets/owner/transactions/register_stake_pool.submitted 208 | fi 209 | fi 210 | -------------------------------------------------------------------------------- /scripts/request_faucet.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source /scripts/init_node_vars 4 | 5 | # Init vars 6 | ADDRESS=$(cat ${NODE_PATH}/staking/wallets/owner/payment.addr) 7 | 8 | curl -v -XPOST "${FAUCET_URL}/${ADDRESS}?apiKey=${FAUCET_KEY}" -------------------------------------------------------------------------------- /scripts/send_ada: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source /scripts/functions/check_balance 4 | 5 | WALLET=$1 6 | TO_ADDR=$2 7 | SEND_ADA=$3 8 | TIMESTAMP=$(date +%s) 9 | 10 | if [ -z "$WALLET" ]; then 11 | echo "Invalid wallet." 12 | MISSING_ARG=1 13 | fi 14 | 15 | if [ -z "$TO_ADDR" ]; then 16 | echo "Invalid recipient address." 17 | MISSING_ARG=1 18 | fi 19 | 20 | if [ -z "$SEND_ADA" ]; then 21 | echo "Missing ADA amount." 22 | MISSING_ARG=1 23 | fi 24 | 25 | if [ -n "$MISSING_ARG" ]; then 26 | exit 27 | fi 28 | 29 | # Check for required files 30 | if [ ! -f "${NODE_PATH}/staking/wallets/${WALLET}/payment.skey" ]; then 31 | echo "Missing required payment.skey. You need to run \`generate_wallet ${WALLET}\` to generate this key." 32 | MISSING_FILES=1 33 | fi 34 | 35 | if [ ! -f "${NODE_PATH}/staking/wallets/${WALLET}/payment.addr" ]; then 36 | echo "Missing required payment.addr. You need to run \`generate_wallet ${WALLET}\` to generate this key." 37 | MISSING_FILES=1 38 | fi 39 | 40 | if [ -n "$MISSING_FILES" ]; then 41 | exit 42 | fi 43 | 44 | cd ${NODE_PATH}/staking/wallets/${WALLET}/ 45 | mkdir -p transactions/ 46 | 47 | # Wait for node to sync 48 | if [[ "${WAIT_FOR_SYNC}" == "True" ]]; then 49 | wait_for_sync 99.90 50 | fi 51 | 52 | cardano-cli query protocol-parameters \ 53 | ${NETWORK_ARGUMENT} \ 54 | --out-file ${NODE_PATH}/staking/protocol.json 55 | 56 | ADDRESS=$(cat payment.addr) 57 | SEND_LOVELACE=$(expr ${SEND_ADA} \* 1000000) # Convert ADA to Lovelace 58 | check_balance $SEND_LOVELACE 59 | 60 | # Draft transaction 61 | cardano-cli transaction build-raw \ 62 | --tx-in "${UTXO}#${TXIX}" \ 63 | --tx-out ${TO_ADDR}+0 \ 64 | --tx-out ${ADDRESS}+0 \ 65 | --ttl 0 \ 66 | --fee 0 \ 67 | --out-file transactions/tx.${TIMESTAMP}.draft 68 | 69 | FEE=$(cardano-cli transaction calculate-min-fee \ 70 | --tx-body-file transactions/tx.${TIMESTAMP}.draft \ 71 | --tx-in-count 1 \ 72 | --tx-out-count 2 \ 73 | ${NETWORK_ARGUMENT} \ 74 | --witness-count 1 \ 75 | --byron-witness-count 0 \ 76 | --protocol-params-file ${NODE_PATH}/staking/protocol.json | tr ' ' '\n' | head -1) 77 | 78 | TOTAL_PRICE=$(expr ${FEE} + ${SEND_LOVELACE}) 79 | 80 | # Find UTXO in address with enough lovelace to do the transaction 81 | check_balance ${TOTAL_PRICE} 82 | 83 | # Update slot and TTL 84 | SLOT=$(get_slot) 85 | TTL=$(expr ${SLOT} + 500) 86 | 87 | # Display transaction info 88 | REMAINING_AFTER_TX=$(expr ${LOVELACE} - ${TOTAL_PRICE}) 89 | echo "Creating transaction" 90 | echo "Current tip Slot: ${SLOT}" 91 | echo "TTL: ${TTL}" 92 | echo "" 93 | echo "$SEND_ADA ADA is ${SEND_LOVELACE} Lovelace" 94 | echo "From wallet: ${WALLET}" 95 | echo "From address: ${ADDRESS}" 96 | echo "To address: ${TO_ADDR}" 97 | echo "Send amount: ${SEND_LOVELACE} Lovelace" 98 | echo "Fee is: ${FEE} Lovelace" 99 | echo "Total amount is: ${TOTAL_PRICE} Lovelace" 100 | echo "Balance after transaction: ${REMAINING_AFTER_TX} Lovelace" 101 | 102 | # 103 | # Create the transaction 104 | # 105 | echo "Create transaction" 106 | cardano-cli transaction build-raw \ 107 | --tx-in "${UTXO}#${TXIX}" \ 108 | --tx-out ${TO_ADDR}+${SEND_LOVELACE} \ 109 | --tx-out ${ADDRESS}+${REMAINING_AFTER_TX} \ 110 | --ttl ${TTL} \ 111 | --fee ${FEE} \ 112 | --out-file transactions/tx.${TIMESTAMP}.raw 113 | 114 | cardano-cli transaction sign \ 115 | --tx-body-file transactions/tx.${TIMESTAMP}.raw \ 116 | --signing-key-file payment.skey \ 117 | ${NETWORK_ARGUMENT} \ 118 | --out-file transactions/tx.${TIMESTAMP}.signed 119 | 120 | # Submit the transaction 121 | read -n 1 -r -s -p $'Press enter to submit the transaction...\n' 122 | 123 | echo "Submit transaction" 124 | OUT=$(cardano-cli transaction submit \ 125 | --tx-file transactions/tx.${TIMESTAMP}.signed \ 126 | ${NETWORK_ARGUMENT} 2>&1) 127 | 128 | if [[ $OUT =~ "Error" ]] 129 | then 130 | echo "An error occoured." 131 | echo ${OUT} 132 | read 133 | else 134 | echo "Transaction has been submitted to the blockchain." 135 | echo ${OUT} 136 | fi 137 | -------------------------------------------------------------------------------- /scripts/send_lovelace_utxo: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source /scripts/functions/check_balance 4 | 5 | WALLET=$1 6 | TO_ADDR=$2 7 | UTXO=$3 8 | SEND_LOVELACE=$4 9 | TIMESTAMP=$(date +%s) 10 | 11 | if [ -z "$WALLET" ]; then 12 | echo "Invalid wallet." 13 | MISSING_ARG=1 14 | fi 15 | 16 | if [ -z "$TO_ADDR" ]; then 17 | echo "Invalid recipient address." 18 | MISSING_ARG=1 19 | fi 20 | 21 | if [ -z "$UTXO" ]; then 22 | echo "Missing UTXO." 23 | MISSING_ARG=1 24 | fi 25 | 26 | if [ -z "$SEND_LOVELACE" ]; then 27 | echo "Missing ADA amount." 28 | MISSING_ARG=1 29 | fi 30 | 31 | if [ -n "$MISSING_ARG" ]; then 32 | exit 33 | fi 34 | 35 | # Check for required files 36 | if [ ! -f "${NODE_PATH}/staking/wallets/${WALLET}/payment.skey" ]; then 37 | echo "Missing required payment.skey. You need to run \`generate_wallet ${WALLET}\` to generate this key." 38 | MISSING_FILES=1 39 | fi 40 | 41 | if [ ! -f "${NODE_PATH}/staking/wallets/${WALLET}/payment.addr" ]; then 42 | echo "Missing required payment.addr. You need to run \`generate_wallet ${WALLET}\` to generate this key." 43 | MISSING_FILES=1 44 | fi 45 | 46 | if [ -n "$MISSING_FILES" ]; then 47 | exit 48 | fi 49 | 50 | cd ${NODE_PATH}/staking/wallets/${WALLET}/ 51 | mkdir -p transactions/ 52 | 53 | # Wait for node to sync 54 | if [[ "${WAIT_FOR_SYNC}" == "True" ]]; then 55 | wait_for_sync 99.90 56 | fi 57 | 58 | cardano-cli query protocol-parameters \ 59 | ${NETWORK_ARGUMENT} \ 60 | --out-file ${NODE_PATH}/staking/protocol.json 61 | 62 | ADDRESS=$(cat payment.addr) 63 | 64 | # Draft transaction 65 | cardano-cli transaction build-raw \ 66 | --tx-in "${UTXO}" \ 67 | --tx-out ${TO_ADDR}+0 \ 68 | --tx-out ${ADDRESS}+0 \ 69 | --ttl 0 \ 70 | --fee 0 \ 71 | --out-file transactions/tx.${TIMESTAMP}.draft 72 | 73 | FEE=$(cardano-cli transaction calculate-min-fee \ 74 | --tx-body-file transactions/tx.${TIMESTAMP}.draft \ 75 | --tx-in-count 1 \ 76 | --tx-out-count 2 \ 77 | ${NETWORK_ARGUMENT} \ 78 | --witness-count 1 \ 79 | --byron-witness-count 0 \ 80 | --protocol-params-file ${NODE_PATH}/staking/protocol.json | tr ' ' '\n' | head -1) 81 | 82 | # Find UTXO in address with enough lovelace to do the transaction 83 | check_balance ${SEND_LOVELACE} 84 | 85 | # Update slot and TTL 86 | SLOT=$(get_slot) 87 | TTL=$(expr ${SLOT} + 500) 88 | 89 | # Display transaction info 90 | REMAINING_AFTER_TX=$(expr ${LOVELACE} - ${SEND_LOVELACE}) 91 | RECEIVE_LOVELACE=$(expr ${SEND_LOVELACE} - ${FEE}) 92 | echo "Creating transaction" 93 | echo "Current tip Slot: ${SLOT}" 94 | echo "TTL: ${TTL}" 95 | echo "" 96 | echo "$SEND_ADA ADA is ${SEND_LOVELACE} Lovelace" 97 | echo "From wallet: ${WALLET}" 98 | echo "From address: ${ADDRESS}" 99 | echo "To address: ${TO_ADDR}" 100 | echo "Send amount: ${SEND_LOVELACE} Lovelace" 101 | echo "Fee is: ${FEE} Lovelace" 102 | echo "Recipient gets: ${RECEIVE_LOVELACE} Lovelace" 103 | echo "Balance after transaction: ${REMAINING_AFTER_TX} Lovelace" 104 | 105 | # 106 | # Create the transaction 107 | # 108 | echo "Create transaction" 109 | cardano-cli transaction build-raw \ 110 | --tx-in "${UTXO}" \ 111 | --tx-out ${TO_ADDR}+${RECEIVE_LOVELACE} \ 112 | --tx-out ${ADDRESS}+${REMAINING_AFTER_TX} \ 113 | --ttl ${TTL} \ 114 | --fee ${FEE} \ 115 | --out-file transactions/tx.${TIMESTAMP}.raw 116 | 117 | cardano-cli transaction sign \ 118 | --tx-body-file transactions/tx.${TIMESTAMP}.raw \ 119 | --signing-key-file payment.skey \ 120 | ${NETWORK_ARGUMENT} \ 121 | --out-file transactions/tx.${TIMESTAMP}.signed 122 | 123 | # Submit the transaction 124 | read -n 1 -r -s -p $'Press enter to submit the transaction...\n' 125 | 126 | echo "Submit transaction" 127 | OUT=$(cardano-cli transaction submit \ 128 | --tx-file transactions/tx.${TIMESTAMP}.signed \ 129 | ${NETWORK_ARGUMENT} 2>&1) 130 | 131 | if [[ $OUT =~ "Error" ]] 132 | then 133 | echo "An error occoured." 134 | echo ${OUT} 135 | read 136 | else 137 | echo "Transaction has been submitted to the blockchain." 138 | echo ${OUT} 139 | fi 140 | -------------------------------------------------------------------------------- /scripts/send_slots: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source /scripts/init_node_vars 4 | 5 | POOL_ID=$(cat ${NODE_PATH}/staking/POOL_ID) 6 | VRF=${NODE_PATH}/staking/pool-keys/vrf.skey 7 | BYRON_GENESIS=${NODE_PATH}/byron-genesis.json 8 | SHELLEY_GENESIS=${NODE_PATH}/shelley-genesis.json 9 | SNAPSHOT=/tmp/stake-snapshot.json 10 | 11 | cncli sendslots --db ${NODE_PATH}/cncli.db --byron-genesis ${BYRON_GENESIS} --shelley-genesis ${SHELLEY_GENESIS} --config ${NODE_PATH}/pooltool.json -------------------------------------------------------------------------------- /scripts/setup_bashrc: -------------------------------------------------------------------------------- 1 | echo "export PATH=$PATH:/root/.local/bin" > /root/.bashrc 2 | echo "export CARDANO_NETWORK=${CARDANO_NETWORK}" >> /root/.bashrc 3 | echo "export CARDANO_NODE_SOCKET_PATH=${CARDANO_NODE_SOCKET_PATH}" >> /root/.bashrc 4 | echo "export NODE_NAME=${NODE_NAME}" >> /root/.bashrc 5 | echo "export NODE_PORT=${NODE_PORT}" >> /root/.bashrc 6 | echo "export WAIT_FOR_SYNC=${WAIT_FOR_SYNC}" >> /root/.bashrc 7 | echo "export NODE_TOPOLOGY=${NODE_TOPOLOGY}" >> /root/.bashrc 8 | echo "source /scripts/init_node_vars" >> /root/.bashrc 9 | -------------------------------------------------------------------------------- /scripts/start-cardano-node: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | /scripts/setup_bashrc 4 | 5 | # Include functions 6 | source /scripts/init_node_vars 7 | source /scripts/functions/run_node 8 | source /scripts/functions/get_public_ip 9 | source /scripts/functions/init_config 10 | source /scripts/functions/ensure_cron_running 11 | 12 | function help { 13 | echo "Arguments:" 14 | echo "--start Start basic node." 15 | echo "--staking Start as a staking node (Also requires the \`--start\` argument)" 16 | echo "--create Start Stakepool creation. Initializes Stake Pool keys, addresses and certificates, and sends them to the blockchain, when starting as a stakepool, if it is not already initialized." 17 | echo "--cold-create Initializes Stake Pool keys, addresses and certificates, and sign registration transactions. Registation transactions has to be sent using the \`--cold-register\` argument." 18 | echo "--cold-register Submits the address and pool registration transactions to the blockchain created using the \`--cold-create\` argument." 19 | echo "--cli Start command-line interface." 20 | echo "--init_config Initialize config." 21 | echo "--help Display this message." 22 | echo "Environment variables:" 23 | echo "NODE_PORT Port of node. Default: 3000." 24 | echo "NODE_NAME Name of node. Default: node1." 25 | echo "NODE_TOPOLOGY Topology of the node. Should be comma separated for each individual node to add, on the form: :/. So for example: 127.0.0.1:3001/1,127.0.0.1:3002/1." 26 | echo "AUTO_TOPOLOGY Automatically update topology. Default: True." 27 | echo "NODE_RELAY Set to True if default IOHK relay should be added to the network topology. Default: False." 28 | echo "METADATA_URL URL for file containing stake pool metadata information. See \`examples/metadata.json\` for examle. The file be uploaded to an URL accessible to public." 29 | echo "PUBLIC_RELAY_PORT Public port of Relay node." 30 | echo "PUBLIC_RELAY_IP Public IP address of Relay node." 31 | echo " Values:" 32 | echo " " 33 | echo " TOPOLOGY: Use first entry of the topology." 34 | echo " PUBLIC: Use public IP of node." 35 | echo " Default: TOPOLOGY." 36 | echo "HOST_ADDR Set cardano-node host address. Defaults to public IP address." 37 | echo "CARDANO_NETWORK Carano network to use (main, test, pioneer). Default: main." 38 | echo "EKG_PORT Port of EKG monitoring. Default: 12788." 39 | echo "PROMETHEUS_HOST Host of Prometheus monitoring. Default: 127.0.0.1." 40 | echo "PROMETHEUS_PORT Port of Prometheus monitoring. Default: 12798." 41 | echo "RESOLVE_HOSTNAMES Resolve topology hostnames to IP-addresses. Default: False." 42 | echo "REPLACE_EXISTING_CONFIG Reset and replace existing configs. Default: False." 43 | echo "POOL_PLEDGE Pledge (lovelace). Default: 100000000000" 44 | echo "POOL_COST Operational costs per epoch (lovelace). Default: 10000000000" 45 | echo "POOL_MARGIN Operator margin. Default: 0.05" 46 | echo "CNCLI_SYNC Run cncli sync. Default: True" 47 | echo "ENABLEP2P Enable P2P Topology. Default: False" 48 | echo "BOOTSTRAP_DB Bootstrap DB with latest Mithril snapshot. Default: True" 49 | 50 | exit 51 | } 52 | 53 | for i in "$@"; do 54 | case $i in 55 | --help) 56 | help 57 | break 58 | ;; 59 | --cli) 60 | /bin/bash 61 | break 62 | ;; 63 | --init_config) 64 | init_config 65 | ;; 66 | --start) 67 | START_NODE=1 68 | ;; 69 | --staking) 70 | STAKING=1 71 | ;; 72 | --create) 73 | CREATE=1 74 | ;; 75 | --cold-create) 76 | CREATE=1 77 | COLD_CREATE=1 78 | COLD="${COLD} --cold-create" 79 | ;; 80 | --cold-register) 81 | CREATE=1 82 | COLD="${COLD} --cold-register" 83 | ;; 84 | *) 85 | break 86 | ;; 87 | esac 88 | done 89 | if [ -z "$1" ]; then 90 | help 91 | fi 92 | 93 | 94 | # Init config on first run 95 | if [[ ! -f "${NODE_PATH}/VARS" || "$REPLACE_EXISTING_CONFIG" == "True" ]]; then 96 | init_config 97 | fi 98 | 99 | if [[ $ENABLEP2P = "True" ]]; then 100 | mv -f ${NODE_PATH}/config.json /tmp/config.json 101 | cat /tmp/config.json | jq .EnableP2P=true > ${NODE_PATH}/config.json 102 | mv -f ${NODE_PATH}/config.json /tmp/config.json 103 | cat /tmp/config.json | jq .PeerSharing=true > ${NODE_PATH}/config.json 104 | else 105 | mv -f ${NODE_PATH}/config.json /tmp/config.json 106 | cat /tmp/config.json | jq .EnableP2P=false > ${NODE_PATH}/config.json 107 | mv -f ${NODE_PATH}/config.json /tmp/config.json 108 | cat /tmp/config.json | jq .PeerSharing=false > ${NODE_PATH}/config.json 109 | fi 110 | 111 | 112 | # Init pooltool config 113 | POOL_ID=$(cat ${NODE_PATH}/staking/POOL_ID) 114 | echo {'"'api_key'"': '"'${PT_API_KEY}'"','"'pools'"': [{'"'name'"': '"'${POOL_TICKER}'"','"'pool_id'"':'"'${POOL_ID}'"','"'host'"':'"'127.0.0.1'"','"'port'"':${NODE_PORT}}]} > ${NODE_PATH}/pooltool.json 115 | 116 | # If not doing cold-create 117 | if [ -z "${COLD_CREATE}" ]; then 118 | # Handle IP addresses 119 | export PUBLIC_IP=$(get_public_ip) 120 | if [ -z "${HOST_ADDR}" ]; then 121 | export HOST_ADDR=${PUBLIC_IP} 122 | fi 123 | fi 124 | 125 | if [ -n "$CREATE" ]; then 126 | create_stakepool ${COLD} 127 | fi 128 | 129 | # Ensure we only bootstrap on the first run (db dir doesn't exist). 130 | if [[ $BOOTSTRAP_DB = "True" ]]; then 131 | if [ ! -d $DB_PATH ]; then 132 | /scripts/download_db_snapshot 133 | else 134 | echo "Skipping db bootstrapping. Database directory already exists." 135 | echo "Delete $DB_PATH if you want a snapshot to be used." 136 | fi 137 | fi 138 | 139 | # start node 140 | if [ -n "$START_NODE" ]; then 141 | if [ -n "$STAKING" ]; then 142 | # Start as staking node 143 | /scripts/start-stakenode 144 | else 145 | export EnableP2P=$(cat ${NODE_PATH}/config.json | jq .EnableP2P) 146 | if [[ $EnableP2P = "true" ]]; then 147 | echo "P2P Topology: true" 148 | export TOPOLOGY_PATH=${NODE_PATH}/topology-p2p.json 149 | 150 | if [ ! -f ${TOPOLOGY_PATH} ]; then 151 | echo "Create P2P Topology" 152 | cp /cfg-templates/${CARDANO_NETWORK}/topology-relay-p2p.json ${NODE_PATH}/topology-p2p.json 153 | fi 154 | else 155 | export TOPOLOGY_PATH=${NODE_PATH}/topology.json 156 | fi 157 | 158 | if [[ $AUTO_TOPOLOGY = "True" ]]; then 159 | # We always want to submit our node for others not running in P2P mode 160 | echo "30 * * * * /scripts/topology_submit" >> /crontab 161 | 162 | # We keep our topology updated unless P2P is enabled 163 | if [[ $EnableP2P != "true" ]]; then 164 | echo "45 * * * * /scripts/topology_update" >> /crontab 165 | fi 166 | 167 | ensure_cron_running 168 | fi 169 | 170 | source /scripts/functions/run_node 171 | run_node 172 | fi 173 | fi 174 | -------------------------------------------------------------------------------- /scripts/start-stakenode: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source /scripts/init_node_vars 4 | source /scripts/functions/check_pool_registration 5 | 6 | # Check for required files 7 | if [ ! -f "${NODE_PATH}/staking/pool-keys/kes.skey" ]; then 8 | echo "Missing required pool-keys/kes.skey." 9 | MISSING_FILES=1 10 | fi 11 | 12 | if [ ! -f "${NODE_PATH}/staking/pool-keys/vrf.skey" ]; then 13 | echo "Missing required pool-keys/vrf.skey." 14 | MISSING_FILES=1 15 | fi 16 | 17 | if [ ! -f "${NODE_PATH}/staking/pool-keys/node.cert" ]; then 18 | echo "Missing required pool-keys/node.cert." 19 | MISSING_FILES=1 20 | fi 21 | 22 | if [ ! -f "${NODE_PATH}/staking/POOL_ID" ]; then 23 | echo "Missing required POOL_ID." 24 | MISSING_FILES=1 25 | fi 26 | 27 | if [ -n "$MISSING_FILES" ]; then 28 | echo "You are missing required files to start." 29 | echo "You need to initialize the stake pool keys, addresses and certificates and submit them to the blockchain first." 30 | echo "You can do that by running \`create_stakepool\`" 31 | read 32 | 33 | exit 34 | else 35 | if [[ $STATUS_PANEL = "True" ]]; then 36 | tmux \ 37 | new-session "source /scripts/functions/run_stakingnode; run_stakingnode" \; \ 38 | split-window "source /scripts/functions/status; status" \; \ 39 | select-layout even-horizontal 40 | else 41 | source /scripts/functions/run_stakingnode 42 | run_stakingnode 43 | fi 44 | fi -------------------------------------------------------------------------------- /scripts/test_run: -------------------------------------------------------------------------------- 1 | #!/bin/bash -l 2 | 3 | PIDFILE="/tmp/topology_update.pid" 4 | 5 | echo "start" 6 | if [ -e "${PIDFILE}" ]; then 7 | echo "Already running." 8 | exit 0 9 | fi 10 | 11 | touch $PIDFILE 12 | 13 | echo "run this" 14 | sleep 10 15 | echo "done" 16 | 17 | rm -rf $PIDFILE -------------------------------------------------------------------------------- /scripts/topology_submit: -------------------------------------------------------------------------------- 1 | #!/bin/bash -l 2 | 3 | source /scripts/functions/get_public_ip 4 | source /scripts/functions/wait_for_sync 5 | 6 | PIDFILE="/tmp/topology_submit.pid" 7 | 8 | if [ -e "${PIDFILE}" ]; then 9 | echo "Already running." 10 | exit 0 11 | fi 12 | 13 | # Wait for node to sync 14 | if [[ "${WAIT_FOR_SYNC}" == "True" ]]; then 15 | wait_for_sync 99.98 16 | fi 17 | 18 | touch $PIDFILE 19 | 20 | TIMESTAMP=$(date +%s) 21 | LOG_FILE=${NODE_PATH}/logs/submit_topology.${TIMESTAMP}.json.log 22 | 23 | mkdir -p ${NODE_PATH}/logs/ 24 | 25 | NWMAGIC=$(jq -r .networkMagic < ${NODE_PATH}/shelley-genesis.json) 26 | BLOCK=$(get_block) 27 | 28 | 29 | if [ -n "$HOSTNAME" ]; then 30 | HOST=$HOSTNAME 31 | HOSTNAME="&hostname=${HOSTNAME}" 32 | else 33 | HOST=$(get_public_ip) 34 | HOSTNAME="" 35 | fi 36 | 37 | echo "Submitting node IP to api.clio.one" | tee -a $LOG_FILE 38 | 39 | echo "Network Magic: ${NWMAGIC}" | tee -a $LOG_FILE 40 | echo "Block: ${BLOCK}" | tee -a $LOG_FILE 41 | echo "Host: ${HOST}" | tee -a $LOG_FILE 42 | echo "Port: ${NODE_PORT}" | tee -a $LOG_FILE 43 | 44 | curl -v "https://api.clio.one/htopology/v1/?port=${NODE_PORT}&blockNo=${BLOCK}&valency=1&magic=${NWMAGIC}${HOSTNAME}" | tee -a $LOG_FILE 45 | 46 | cat $LOG_FILE 47 | 48 | rm -rf $PIDFILE 49 | -------------------------------------------------------------------------------- /scripts/topology_update: -------------------------------------------------------------------------------- 1 | #!/bin/bash -l 2 | 3 | for i in "$@"; do 4 | case $i in 5 | --auto-restart) 6 | AUTO_RESTART=1 7 | ;; 8 | --retry) 9 | RETRY=1 10 | ;; 11 | esac 12 | done 13 | 14 | source /scripts/functions/get_public_ip 15 | source /scripts/functions/validations 16 | 17 | echo -n "Updating topology.json ... " 18 | 19 | TOPOLOGY_FILE=${NODE_PATH}/topology.json 20 | NWMAGIC=$(jq -r .networkMagic < ${NODE_PATH}/shelley-genesis.json) 21 | CUSTOM_PEERS=$(python3 /scripts/get_topology_str.py) 22 | 23 | curl -s -f -o "${TOPOLOGY_FILE}".tmp "https://api.clio.one/htopology/v1/fetch/?max=14&magic=${NWMAGIC}" 24 | 25 | [[ ! -s "${TOPOLOGY_FILE}".tmp ]] && echo "ERROR: The downloaded topology file is empty!" && exit 1 26 | PRODUCERS=$(jq -r .Producers < "${TOPOLOGY_FILE}".tmp) 27 | 28 | if [[ "${PRODUCERS}" == "null" ]]; then 29 | echo "${CROSS_MARK} Error." && cat "${TOPOLOGY_FILE}".tmp 30 | 31 | if [[ -n "$RETRY" ]]; then 32 | echo "Submitting IP to topology updater database and retrying fetching the topology." 33 | topology_submit && topology_update 34 | fi 35 | else 36 | if [[ -n "${CUSTOM_PEERS}" ]]; then 37 | topo="$(cat "${TOPOLOGY_FILE}".tmp)" 38 | IFS='|' read -ra cpeers <<< "${CUSTOM_PEERS}" 39 | for cpeer in "${cpeers[@]}"; do 40 | IFS=',' read -ra cpeer_attr <<< "${cpeer}" 41 | case ${#cpeer_attr[@]} in 42 | 2) addr="${cpeer_attr[0]}" 43 | port=${cpeer_attr[1]} 44 | valency=1 ;; 45 | 3) addr="${cpeer_attr[0]}" 46 | port=${cpeer_attr[1]} 47 | valency=${cpeer_attr[2]} ;; 48 | *) echo "ERROR: Invalid Custom Peer definition '${cpeer}'. Please double check CUSTOM_PEERS definition" 49 | exit 1 ;; 50 | esac 51 | if [[ ${addr} = *.* ]]; then 52 | ! isValidIPv4 "${addr}" && echo "ERROR: Invalid IPv4 address or hostname '${addr}'. Please check CUSTOM_PEERS definition" && continue 53 | elif [[ ${addr} = *:* ]]; then 54 | ! isValidIPv6 "${addr}" && echo "ERROR: Invalid IPv6 address '${addr}'. Please check CUSTOM_PEERS definition" && continue 55 | fi 56 | ! isNumber ${port} && echo "ERROR: Invalid port number '${port}'. Please check CUSTOM_PEERS definition" && continue 57 | ! isNumber ${valency} && echo "ERROR: Invalid valency number '${valency}'. Please check CUSTOM_PEERS definition" && continue 58 | topo=$(jq '.Producers += [{"addr": $addr, "port": $port|tonumber, "valency": $valency|tonumber}]' --arg addr "${addr}" --arg port ${port} --arg valency ${valency} <<< "${topo}") 59 | done 60 | echo "${topo}" | jq -r . >/dev/null 2>&1 && echo "${topo}" > "${TOPOLOGY_FILE}".tmp 61 | fi 62 | 63 | # Replace topology 64 | mv "${TOPOLOGY_FILE}" "${TOPOLOGY_FILE}".backup 65 | mv -f "${TOPOLOGY_FILE}".tmp $TOPOLOGY_FILE 66 | 67 | echo -e "${CHECK_MARK} Done." 68 | 69 | # Restart cardano-node 70 | if [[ -n "$AUTO_RESTART" ]]; then 71 | echo -en "\nRestarting cardano-node ... " 72 | killall -9 cardano-node 73 | echo -e "${CHECK_MARK} Done." 74 | fi 75 | fi 76 | -------------------------------------------------------------------------------- /scripts/wallet_balance: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | WALLET=$1 5 | 6 | if [ -z "$WALLET" ]; then 7 | echo "Invalid wallet." 8 | MISSING_ARG=1 9 | fi 10 | 11 | if [ -n "$MISSING_ARG" ]; then 12 | exit 13 | fi 14 | 15 | # Check for required files 16 | if [ ! -f "${NODE_PATH}/staking/wallets/${WALLET}/payment.addr" ]; then 17 | echo "Missing required payment.addr. You need to run \`generate_wallet ${WALLET}\` to generate this key." 18 | MISSING_FILES=1 19 | fi 20 | 21 | if [ -n "$MISSING_FILES" ]; then 22 | exit 23 | fi 24 | 25 | # Wait for node to sync 26 | if [[ "${WAIT_FOR_SYNC}" == "True" ]]; then 27 | wait_for_sync 99.90 28 | fi 29 | 30 | ADDRESS=$(cat ${NODE_PATH}/staking/wallets/${WALLET}/payment.addr) 31 | 32 | cardano-cli query utxo ${NETWORK_ARGUMENT} --address ${ADDRESS} 33 | -------------------------------------------------------------------------------- /scripts/withdraw_rewards: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source /scripts/functions/check_balance 4 | 5 | WALLET=$1 6 | TIMESTAMP=$(date +%s) 7 | 8 | if [ -z "$WALLET" ]; then 9 | echo "Invalid wallet." 10 | MISSING_ARG=1 11 | fi 12 | 13 | if [ -n "$MISSING_ARG" ]; then 14 | exit 15 | fi 16 | 17 | # Check for required files 18 | if [ ! -f "${NODE_PATH}/staking/wallets/${WALLET}/payment.skey" ]; then 19 | echo "Missing required payment.skey. You need to run \`generate_wallet ${WALLET}\` to generate this key." 20 | MISSING_FILES=1 21 | fi 22 | 23 | if [ ! -f "${NODE_PATH}/staking/wallets/${WALLET}/payment.addr" ]; then 24 | echo "Missing required payment.addr. You need to run \`generate_wallet ${WALLET}\` to generate this key." 25 | MISSING_FILES=1 26 | fi 27 | 28 | if [ ! -f "${NODE_PATH}/staking/wallets/${WALLET}/stake.addr" ]; then 29 | echo "Missing required stake.addr. You need to run \`generate_wallet ${WALLET}\` to generate this key." 30 | MISSING_FILES=1 31 | fi 32 | 33 | if [ ! -f "${NODE_PATH}/staking/wallets/${WALLET}/stake.skey" ]; then 34 | echo "Missing required stake.skey. You need to run \`generate_wallet ${WALLET}\` to generate this key." 35 | MISSING_FILES=1 36 | fi 37 | 38 | if [ -n "$MISSING_FILES" ]; then 39 | exit 40 | fi 41 | 42 | cd ${NODE_PATH}/staking/wallets/${WALLET}/ 43 | mkdir -p transactions/ 44 | 45 | # Wait for node to sync 46 | if [[ "${WAIT_FOR_SYNC}" == "True" ]]; then 47 | wait_for_sync 99.90 48 | fi 49 | 50 | cardano-cli query protocol-parameters \ 51 | ${NETWORK_ARGUMENT} \ 52 | --out-file ${NODE_PATH}/staking/protocol.json 53 | 54 | ADDRESS=$(cat payment.addr) 55 | STAKE_ADDRESS=$(cat stake.addr) 56 | REWARD_BALANCE=$(cardano-cli query stake-address-info ${NETWORK_ARGUMENT} --address $(cat stake.addr) | jq -r ".[0].rewardAccountBalance") 57 | check_balance 200000 # Dummy transaction fee 58 | 59 | # Draft transaction 60 | echo "Draft transaction" 61 | cardano-cli transaction build-raw \ 62 | --tx-in "${UTXO}#${TXIX}" \ 63 | --tx-out ${ADDRESS}+0 \ 64 | --withdrawal ${STAKE_ADDRESS}+${REWARD_BALANCE} \ 65 | --ttl 0 \ 66 | --fee 0 \ 67 | --out-file transactions/tx.${TIMESTAMP}.draft 68 | 69 | echo "Calculate fee" 70 | FEE=$(cardano-cli transaction calculate-min-fee \ 71 | --tx-body-file transactions/tx.${TIMESTAMP}.draft \ 72 | --tx-in-count 1 \ 73 | --tx-out-count 1 \ 74 | ${NETWORK_ARGUMENT} \ 75 | --witness-count 1 \ 76 | --byron-witness-count 0 \ 77 | --protocol-params-file ${NODE_PATH}/staking/protocol.json | tr ' ' '\n' | head -1) 78 | 79 | # Find UTXO in address with enough lovelace to do the transaction 80 | check_balance ${FEE} 81 | 82 | # Update slot and TTL 83 | SLOT=$(get_slot) 84 | TTL=$(expr ${SLOT} + 500) 85 | 86 | # Display transaction info 87 | BALANCE_AFTER_TX=$(expr ${LOVELACE} + ${REWARD_BALANCE} - ${FEE}) 88 | echo "Creating rewards withdrawal transaction" 89 | echo "Current tip Slot: ${SLOT}" 90 | echo "TTL: ${TTL}" 91 | echo "Withdrawing rewards from: ${STAKE_ADDRESS}" 92 | echo "Withdrawing rewards to: ${ADDRESS}" 93 | echo "Fee is: ${FEE} Lovelace" 94 | echo "Rewards amount: ${REWARD_BALANCE} Lovelace" 95 | echo "Lovelace before withdrawal: ${LOVELACE}" 96 | echo "Lovelace after withdrawal: ${BALANCE_AFTER_TX}" 97 | 98 | # 99 | # Create the transaction 100 | # 101 | cardano-cli transaction build-raw \ 102 | --tx-in "${UTXO}#${TXIX}" \ 103 | --tx-out ${ADDRESS}+${BALANCE_AFTER_TX} \ 104 | --withdrawal ${STAKE_ADDRESS}+${REWARD_BALANCE} \ 105 | --ttl ${TTL} \ 106 | --fee ${FEE} \ 107 | --out-file transactions/tx.${TIMESTAMP}.raw 108 | 109 | cardano-cli transaction sign \ 110 | --tx-body-file transactions/tx.${TIMESTAMP}.raw \ 111 | --signing-key-file payment.skey \ 112 | --signing-key-file stake.skey \ 113 | ${NETWORK_ARGUMENT} \ 114 | --out-file transactions/tx.${TIMESTAMP}.signed 115 | 116 | # Submit the transaction 117 | read -n 1 -r -s -p $'Press enter to submit the transaction...\n' 118 | 119 | echo "Submit transaction" 120 | OUT=$(cardano-cli transaction submit \ 121 | --tx-file transactions/tx.${TIMESTAMP}.signed \ 122 | ${NETWORK_ARGUMENT} 2>&1) 123 | 124 | if [[ $OUT =~ "Error" ]] 125 | then 126 | echo "An error occoured." 127 | echo ${OUT} 128 | read 129 | else 130 | echo "Transaction has been submitted to the blockchain." 131 | echo ${OUT} 132 | fi 133 | --------------------------------------------------------------------------------