diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..92c44a8 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,11 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" diff --git a/.github/workflows/conventional-commits.yml b/.github/workflows/conventional-commits.yml new file mode 100644 index 0000000..9beef23 --- /dev/null +++ b/.github/workflows/conventional-commits.yml @@ -0,0 +1,16 @@ +# The below is pulled from upstream and slightly modified +# https://github.com/webiny/action-conventional-commits/blob/master/README.md#usage + +name: Conventional Commits + +on: + pull_request: + +jobs: + build: + name: Conventional Commits + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: webiny/action-conventional-commits@v1.3.0 diff --git a/.github/workflows/package-validate.yml b/.github/workflows/package-validate.yml new file mode 100644 index 0000000..a70add4 --- /dev/null +++ b/.github/workflows/package-validate.yml @@ -0,0 +1,21 @@ +name: package-validate + +on: + push: + tags: + - v* + branches: + - main + pull_request: + +jobs: + validate: + name: Validate packages + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: | + set -e + curl -sLo cardano-up $(curl -s https://api.github.com/repos/blinklabs-io/cardano-up/releases/latest | grep "browser_download_url.*linux-amd64" | cut -d: -f2,3 | tr -d \") + chmod +x cardano-up + - run: ./cardano-up validate -D diff --git a/packages/cardano-cli/cardano-cli-8.20.3.0.yaml b/packages/cardano-cli/cardano-cli-8.20.3.0.yaml new file mode 100644 index 0000000..c82e313 --- /dev/null +++ b/packages/cardano-cli/cardano-cli-8.20.3.0.yaml @@ -0,0 +1,18 @@ +name: cardano-cli +version: 8.20.3.0 +description: CLI software for interfacing with Cardano node by Input Output Global +installSteps: + - docker: + containerName: cardano-cli + image: ghcr.io/blinklabs-io/cardano-cli:8.20.3.0 + pullOnly: true + - file: + binary: true + filename: cardano-cli + source: files/cardano-cli.sh.gotmpl +tags: + - docker + - linux + - darwin + - amd64 + - arm64 diff --git a/packages/cardano-cli/cardano-cli-8.24.0.0.yaml b/packages/cardano-cli/cardano-cli-8.24.0.0.yaml new file mode 100644 index 0000000..d98d2e5 --- /dev/null +++ b/packages/cardano-cli/cardano-cli-8.24.0.0.yaml @@ -0,0 +1,18 @@ +name: cardano-cli +version: 8.24.0.0 +description: CLI software for interfacing with Cardano node by Input Output Global +installSteps: + - docker: + containerName: cardano-cli + image: ghcr.io/blinklabs-io/cardano-cli:8.24.0.0 + pullOnly: true + - file: + binary: true + filename: cardano-cli + source: files/cardano-cli.sh.gotmpl +tags: + - docker + - linux + - darwin + - amd64 + - arm64 diff --git a/packages/cardano-cli/cardano-cli-9.0.0.0.yaml b/packages/cardano-cli/cardano-cli-9.0.0.0.yaml new file mode 100644 index 0000000..3052f94 --- /dev/null +++ b/packages/cardano-cli/cardano-cli-9.0.0.0.yaml @@ -0,0 +1,18 @@ +name: cardano-cli +version: 9.0.0.0 +description: CLI software for interfacing with Cardano node by Input Output Global +installSteps: + - docker: + containerName: cardano-cli + image: ghcr.io/blinklabs-io/cardano-cli:9.0.0.0 + pullOnly: true + - file: + binary: true + filename: cardano-cli + source: files/cardano-cli.sh.gotmpl +tags: + - docker + - linux + - darwin + - amd64 + - arm64 diff --git a/packages/cardano-cli/files/cardano-cli.sh.gotmpl b/packages/cardano-cli/files/cardano-cli.sh.gotmpl new file mode 100644 index 0000000..0d1f004 --- /dev/null +++ b/packages/cardano-cli/files/cardano-cli.sh.gotmpl @@ -0,0 +1,55 @@ +#!/bin/bash + +declare -a valid_paths=( + "/Users" + "/Volumes" + "/private" + "/tmp" + "/var/folders" +) + +_args=() + +# Remap absolute paths to /host in the container +while [[ $# -gt 0 ]]; do + _arg=$1 + if [[ $_arg =~ ^/ ]]; then + _arg="/host${_arg}" + fi + _args+=( $_arg ) + shift +done + +_docker_args=() + +if [[ $CARDANO_NODE_SOCKET_PATH ]]; then + # Use the host socket path if specified + if [[ ! -e $CARDANO_NODE_SOCKET_PATH ]]; then + echo "Specified CARDANO_NODE_SOCKET_PATH '${CARDANO_NODE_SOCKET_PATH}' does not exist!" + exit 1 + fi + _docker_args+=( "-v" "${CARDANO_NODE_SOCKET_PATH}:/ipc/node.socket" ) +else + # Use the default context node socket if no socket path is provided + _docker_args+=( "-v" "{{ .Paths.ContextDir }}/node-ipc:/ipc" ) +fi + +if [[ $(uname -s) == Darwin ]]; then + for _path in "${_darwin_allowed_paths[@]}"; do + _docker_args+=( "-v" "${_path}:/host${_path}" ) + done +else + _docker_args+=( "-v" "/:/host" ) +fi + +# Run cardano-cli via Docker +# We map the host filesystem and node socket into the container +docker run \ + -ti \ + --rm \ + -u $(id -u):$(id -g) \ + -w /host$(pwd) \ + -e CARDANO_NODE_SOCKET_PATH=/ipc/node.socket \ + "${_docker_args[@]}" \ + ghcr.io/blinklabs-io/cardano-cli:{{ .Package.Version }} \ + "${_args[@]}" diff --git a/packages/cardano-config/cardano-config-20240515.yaml b/packages/cardano-config/cardano-config-20240515.yaml new file mode 100644 index 0000000..f948dfa --- /dev/null +++ b/packages/cardano-config/cardano-config-20240515.yaml @@ -0,0 +1,24 @@ +name: cardano-config +version: 20240515 +description: Configuration files for the Cardano node by Input Output Global +installSteps: + - docker: + containerName: cardano-configs + image: ghcr.io/blinklabs-io/cardano-configs:20240515-1 + pullOnly: true +outputs: + - name: base + description: Path to the Cardano Node configuration files + value: '{{ .Paths.ContextDir }}/config' +postInstallScript: | + set -e + mkdir -p {{ .Paths.ContextDir }}/config + docker create --name {{ .Package.Name }}-{{ .Package.ShortName }} ghcr.io/blinklabs-io/cardano-configs:20240515-1 bash + docker cp {{ .Package.Name }}-{{ .Package.ShortName }}:/config/{{ .Context.Network }}/ {{ .Paths.ContextDir }}/config/ + docker rm {{ .Package.Name }}-{{ .Package.ShortName }} +tags: + - docker + - linux + - darwin + - amd64 + - arm64 diff --git a/packages/cardano-config/cardano-config-20240702.yaml b/packages/cardano-config/cardano-config-20240702.yaml new file mode 100644 index 0000000..7ce1338 --- /dev/null +++ b/packages/cardano-config/cardano-config-20240702.yaml @@ -0,0 +1,24 @@ +name: cardano-config +version: 20240702 +description: Configuration files for the Cardano node by Input Output Global +installSteps: + - docker: + containerName: cardano-configs + image: ghcr.io/blinklabs-io/cardano-configs:20240702-1 + pullOnly: true +outputs: + - name: base + description: Path to the Cardano Node configuration files + value: '{{ .Paths.ContextDir }}/config' +postInstallScript: | + set -e + mkdir -p {{ .Paths.ContextDir }}/config + docker create --name {{ .Package.Name }}-{{ .Package.ShortName }} ghcr.io/blinklabs-io/cardano-configs:20240702-1 bash + docker cp {{ .Package.Name }}-{{ .Package.ShortName }}:/config/{{ .Context.Network }}/ {{ .Paths.ContextDir }}/config/ + docker rm {{ .Package.Name }}-{{ .Package.ShortName }} +tags: + - docker + - linux + - darwin + - amd64 + - arm64 diff --git a/packages/cardano-node-api/cardano-node-api-0.1.2.yaml b/packages/cardano-node-api/cardano-node-api-0.1.2.yaml new file mode 100644 index 0000000..15d0bb4 --- /dev/null +++ b/packages/cardano-node-api/cardano-node-api-0.1.2.yaml @@ -0,0 +1,33 @@ +name: cardano-node-api +version: 0.1.2 +description: Multi-protocol API for interfacing with a local Cardano node +dependencies: + - cardano-config >= 20240515 + - cardano-node >= 8.7.3 +installSteps: + - docker: + containerName: cardano-node-api + image: ghcr.io/blinklabs-io/cardano-node-api:0.1.2 + env: + CARDANO_NETWORK: '{{ .Context.Network }}' + CARDANO_NODE_SOCKET_PATH: /ipc/node.socket + binds: + - '{{ .Paths.ContextDir }}/node-ipc:/ipc' + - '{{ .Paths.ContextDir }}/config/{{ .Context.Network }}:/opt/cardano/config' + ports: + - "8080" + - "9090" + pullOnly: false +outputs: + - name: grpc + description: Cardano Node API gRPC service + value: 'http://localhost:{{ index (index .Ports "cardano-node-api") "8080" }}' + - name: rest + description: Cardano Node API REST service + value: 'localhost:{{ index (index .Ports "cardano-node-api") "9090" }}' +tags: + - docker + - linux + - darwin + - amd64 + - arm64 diff --git a/packages/cardano-node-api/cardano-node-api-0.2.0.yaml b/packages/cardano-node-api/cardano-node-api-0.2.0.yaml new file mode 100644 index 0000000..b2af3c4 --- /dev/null +++ b/packages/cardano-node-api/cardano-node-api-0.2.0.yaml @@ -0,0 +1,33 @@ +name: cardano-node-api +version: 0.2.0 +description: Multi-protocol API for interfacing with a local Cardano node +dependencies: + - cardano-config >= 20240515 + - cardano-node >= 8.7.3 +installSteps: + - docker: + containerName: cardano-node-api + image: ghcr.io/blinklabs-io/cardano-node-api:0.2.0 + env: + CARDANO_NETWORK: '{{ .Context.Network }}' + CARDANO_NODE_SOCKET_PATH: /ipc/node.socket + binds: + - '{{ .Paths.ContextDir }}/node-ipc:/ipc' + - '{{ .Paths.ContextDir }}/config/{{ .Context.Network }}:/opt/cardano/config' + ports: + - "8080" + - "9090" + pullOnly: false +outputs: + - name: grpc + description: Cardano Node API gRPC service + value: 'http://localhost:{{ index (index .Ports "cardano-node-api") "8080" }}' + - name: rest + description: Cardano Node API REST service + value: 'localhost:{{ index (index .Ports "cardano-node-api") "9090" }}' +tags: + - docker + - linux + - darwin + - amd64 + - arm64 diff --git a/packages/cardano-node/cardano-node-8.9.3.yaml b/packages/cardano-node/cardano-node-8.9.3.yaml new file mode 100644 index 0000000..e13b06e --- /dev/null +++ b/packages/cardano-node/cardano-node-8.9.3.yaml @@ -0,0 +1,49 @@ +name: cardano-node +version: 8.9.3 +description: Cardano node software by Input Output Global +dependencies: + - cardano-config = 20240515 + - cardano-cli >= 8.20 + - mithril-client >= 0.8 +installSteps: + - docker: + containerName: cardano-node + image: ghcr.io/blinklabs-io/cardano-node:8.9.3 + env: + CARDANO_NODE_SOCKET_PATH: /ipc/node.socket + NETWORK: '{{ .Context.Network }}' + RESTORE_NETWORK: 'false' + binds: + - '{{ .Paths.ContextDir }}/config:/opt/cardano/config' + - '{{ .Paths.ContextDir }}/node-ipc:/ipc' + - '{{ .Paths.DataDir }}/data:/data' + ports: + - "3001" + - "12788" + - "12798" + pullOnly: false + - file: + binary: true + filename: nview + source: files/nview.sh.gotmpl + - file: + binary: true + filename: txtop + source: files/txtop.sh.gotmpl +outputs: + - name: port + description: Ouroboros Node-to-Node service + value: '{{ index (index .Ports "cardano-node") "3001" }}' + - name: socket_path + description: Path to the Cardano Node UNIX socket + value: '{{ .Paths.ContextDir }}/node-ipc/node.socket' +preInstallScript: | + set -e + test -e {{ .Paths.DataDir }}/data/db/protocolMagicId && exit 0 + mithril-client cardano-db download --download-dir {{ .Paths.DataDir }}/data latest +tags: + - docker + - linux + - darwin + - amd64 + - arm64 diff --git a/packages/cardano-node/cardano-node-8.9.4.yaml b/packages/cardano-node/cardano-node-8.9.4.yaml new file mode 100644 index 0000000..7cce042 --- /dev/null +++ b/packages/cardano-node/cardano-node-8.9.4.yaml @@ -0,0 +1,49 @@ +name: cardano-node +version: 8.9.4 +description: Cardano node software by Input Output Global +dependencies: + - cardano-config = 20240515 + - cardano-cli >= 8.20 + - mithril-client >= 0.8 +installSteps: + - docker: + containerName: cardano-node + image: ghcr.io/blinklabs-io/cardano-node:8.9.4 + env: + CARDANO_NODE_SOCKET_PATH: /ipc/node.socket + NETWORK: '{{ .Context.Network }}' + RESTORE_NETWORK: 'false' + binds: + - '{{ .Paths.ContextDir }}/config:/opt/cardano/config' + - '{{ .Paths.ContextDir }}/node-ipc:/ipc' + - '{{ .Paths.DataDir }}/data:/data' + ports: + - "3001" + - "12788" + - "12798" + pullOnly: false + - file: + binary: true + filename: nview + source: files/nview.sh.gotmpl + - file: + binary: true + filename: txtop + source: files/txtop.sh.gotmpl +outputs: + - name: port + description: Ouroboros Node-to-Node service + value: '{{ index (index .Ports "cardano-node") "3001" }}' + - name: socket_path + description: Path to the Cardano Node UNIX socket + value: '{{ .Paths.ContextDir }}/node-ipc/node.socket' +preInstallScript: | + set -e + test -e {{ .Paths.DataDir }}/data/db/protocolMagicId && exit 0 + mithril-client cardano-db download --download-dir {{ .Paths.DataDir }}/data latest +tags: + - docker + - linux + - darwin + - amd64 + - arm64 diff --git a/packages/cardano-node/cardano-node-9.0.0.yaml b/packages/cardano-node/cardano-node-9.0.0.yaml new file mode 100644 index 0000000..094fa55 --- /dev/null +++ b/packages/cardano-node/cardano-node-9.0.0.yaml @@ -0,0 +1,49 @@ +name: cardano-node +version: 9.0.0 +description: Cardano node software by Input Output Global +dependencies: + - cardano-config = 20240702 + - cardano-cli >= 9.0 + - mithril-client >= 0.8 +installSteps: + - docker: + containerName: cardano-node + image: ghcr.io/blinklabs-io/cardano-node:9.0.0 + env: + CARDANO_NODE_SOCKET_PATH: /ipc/node.socket + NETWORK: '{{ .Context.Network }}' + RESTORE_NETWORK: 'false' + binds: + - '{{ .Paths.ContextDir }}/config:/opt/cardano/config' + - '{{ .Paths.ContextDir }}/node-ipc:/ipc' + - '{{ .Paths.DataDir }}/data:/data' + ports: + - "3001" + - "12788" + - "12798" + pullOnly: false + - file: + binary: true + filename: nview + source: files/nview.sh.gotmpl + - file: + binary: true + filename: txtop + source: files/txtop.sh.gotmpl +outputs: + - name: port + description: Ouroboros Node-to-Node service + value: '{{ index (index .Ports "cardano-node") "3001" }}' + - name: socket_path + description: Path to the Cardano Node UNIX socket + value: '{{ .Paths.ContextDir }}/node-ipc/node.socket' +preInstallScript: | + set -e + test -e {{ .Paths.DataDir }}/data/db/protocolMagicId && exit 0 + mithril-client cardano-db download --download-dir {{ .Paths.DataDir }}/data latest +tags: + - docker + - linux + - darwin + - amd64 + - arm64 diff --git a/packages/cardano-node/files/nview.sh.gotmpl b/packages/cardano-node/files/nview.sh.gotmpl new file mode 100755 index 0000000..f63bf50 --- /dev/null +++ b/packages/cardano-node/files/nview.sh.gotmpl @@ -0,0 +1,7 @@ +#!/bin/bash + +# Run nview +docker exec \ + -ti \ + {{ .Package.Name }}-cardano-node \ + nview ${@} diff --git a/packages/cardano-node/files/txtop.sh.gotmpl b/packages/cardano-node/files/txtop.sh.gotmpl new file mode 100755 index 0000000..885f3ec --- /dev/null +++ b/packages/cardano-node/files/txtop.sh.gotmpl @@ -0,0 +1,7 @@ +#!/bin/bash + +# Run nview +docker exec \ + -ti \ + {{ .Package.Name }}-cardano-node \ + txtop ${@} diff --git a/packages/dolos/dolos-0.10.1.yaml b/packages/dolos/dolos-0.10.1.yaml new file mode 100644 index 0000000..3152d30 --- /dev/null +++ b/packages/dolos/dolos-0.10.1.yaml @@ -0,0 +1,40 @@ +name: dolos +version: 0.10.1 +description: Dolos is a Cardano data node +dependencies: + - cardano-config >= 20240515 +installSteps: + - file: + filename: daemon.toml + source: files/daemon.toml.gotmpl + - docker: + containerName: dolos + image: ghcr.io/txpipe/dolos:v0.10.1 + command: + - dolos + - daemon + binds: + - '{{ .Paths.DataDir }}:/etc/dolos' + - '{{ .Paths.DataDir }}/data:/data' + - '{{ .Paths.ContextDir }}/config/{{ .Context.Network }}:/config' + - '{{ .Paths.ContextDir }}/dolos-ipc:/ipc' + ports: + - "30013" + - "50051" + pullOnly: false +outputs: + - name: grpc + description: Dolos gRPC service + value: 'http://localhost:{{ index (index .Ports "dolos") "50051" }}' + - name: relay + description: Dolos Ouroboros Node-to-Node service + value: 'localhost:{{ index (index .Ports "dolos") "30013" }}' + - name: socket-path + description: Path to the Dolos Ouroboros Node-to-Client UNIX socket + value: '{{ .Paths.ContextDir }}/dolos-ipc/dolos.socket' +tags: + - docker + - linux + - darwin + - amd64 + - arm64 diff --git a/packages/dolos/dolos-0.11.0.yaml b/packages/dolos/dolos-0.11.0.yaml new file mode 100644 index 0000000..a4d9da3 --- /dev/null +++ b/packages/dolos/dolos-0.11.0.yaml @@ -0,0 +1,40 @@ +name: dolos +version: 0.11.0 +description: Dolos is a Cardano data node +dependencies: + - cardano-config >= 20240515 +installSteps: + - file: + filename: daemon.toml + source: files/daemon.toml.gotmpl + - docker: + containerName: dolos + image: ghcr.io/txpipe/dolos:v0.11.0 + command: + - dolos + - daemon + binds: + - '{{ .Paths.DataDir }}:/etc/dolos' + - '{{ .Paths.DataDir }}/data:/data' + - '{{ .Paths.ContextDir }}/config/{{ .Context.Network }}:/config' + - '{{ .Paths.ContextDir }}/dolos-ipc:/ipc' + ports: + - "30013" + - "50051" + pullOnly: false +outputs: + - name: grpc + description: Dolos gRPC service + value: 'http://localhost:{{ index (index .Ports "dolos") "50051" }}' + - name: relay + description: Dolos Ouroboros Node-to-Node service + value: 'localhost:{{ index (index .Ports "dolos") "30013" }}' + - name: socket-path + description: Path to the Dolos Ouroboros Node-to-Client UNIX socket + value: '{{ .Paths.ContextDir }}/dolos-ipc/dolos.socket' +tags: + - docker + - linux + - darwin + - amd64 + - arm64 diff --git a/packages/dolos/files/daemon.toml.gotmpl b/packages/dolos/files/daemon.toml.gotmpl new file mode 100644 index 0000000..1e561eb --- /dev/null +++ b/packages/dolos/files/daemon.toml.gotmpl @@ -0,0 +1,59 @@ +# https://dolos.txpipe.io/configuration +[upstream] +network_magic = {{ .Context.NetworkMagic }} +{{- if eq .Context.Network "mainnet" }} +peer_address = "backbone.{{ .Context.Network }}.cardanofoundation.org:3001" +is_testnet = false +{{ else }} +peer_address = "{{ .Context.Network }}-node.play.dev.cardano.org:3001" +is_testnet = true +{{- end }} + +[storage] +path = "/data/db" +wal_size = 1000 + +[relay] +listen_address = "[::]:30013" +magic = {{ .Context.NetworkMagic }} + +[sync] +pull_batch_size = 100 + +[submit] +prune_height = 200 +# validate_phase_1 = false +# validate_phase_2 = false + +[genesis] +byron_path = "/config/byron-genesis.json" +shelley_path = "/config/shelley-genesis.json" +alonzo_path = "/config/alonzo-genesis.json" + +[mithril] +{{- if eq .Context.Network "mainnet" }} +aggregator = "https://aggregator.release-mainnet.api.mithril.network/aggregator" +{{- else if eq .Context.Network "preprod" }} +aggregator = "https://aggregator.release-preprod.api.mithril.network/aggregator" +{{- else if eq .Context.Network "preview" }} +aggregator = "https://aggregator.prerelease-preview.api.mithril.network/aggregator" +{{ else }} +aggregator = "https://aggregator.prerelease-sanchonet.api.mithril.network/aggregator" +{{- end }} +{{- if eq .Context.Network "mainnet" }} +genesis_key = "5b3139312c36362c3134302c3138352c3133382c31312c3233372c3230372c3235302c3134342c32372c322c3138382c33302c31322c38312c3135352c3230342c31302c3137392c37352c32332c3133382c3139362c3231372c352c31342c32302c35372c37392c33392c3137365d" +{{ else }} +genesis_key = "5b3132372c37332c3132342c3136312c362c3133372c3133312c3231332c3230372c3131372c3139382c38352c3137362c3139392c3136322c3234312c36382c3132332c3131392c3134352c31332c3233322c3234332c34392c3232392c322c3234392c3230352c3230352c33392c3233352c34345d" +{{- end }} + +[serve.grpc] +listen_address = "[::]:50051" + +[serve.ouroboros] +listen_path = "/ipc/dolos.socket" +magic = {{ .Context.NetworkMagic }} + +[logging] +max_level = "debug" +include_pallas = false +include_grpc = false diff --git a/packages/kupo/kupo-2.8.0.yaml b/packages/kupo/kupo-2.8.0.yaml new file mode 100644 index 0000000..0d494c0 --- /dev/null +++ b/packages/kupo/kupo-2.8.0.yaml @@ -0,0 +1,49 @@ +name: kupo +version: 2.8.0 +description: Kupo is fast, lightweight and configurable chain-index for the Cardano blockchain +dependencies: + - cardano-config >= 20240515 + - cardano-node >= 8.7.3 +installSteps: + - docker: + containerName: kupo + image: cardanosolutions/kupo:v2.8.0 + command: + - kupo + - --node-socket + - /ipc/node.socket + - --host + - 0.0.0.0 + - --port + - '1442' + - --log-level + - Info + - --node-config + - /config/config.json + - --match + - '*' + - --defer-db-indexes + - --since + - origin + - --workdir + - '/db' + binds: + - '{{ .Paths.ContextDir }}/node-ipc:/ipc' + - '{{ .Paths.DataDir }}/db:/db' + - '{{ .Paths.ContextDir }}/config/{{ .Context.Network }}:/config' + ports: + - "1442" + pullOnly: false +outputs: + - name: url + description: Kupo API URL + value: 'http://localhost:{{ index (index .Ports "kupo") "1442" }}' + - name: health_url + description: Kupo health URL + value: 'http://localhost:{{ index (index .Ports "kupo") "1442" }}/health' +tags: + - docker + - linux + - darwin + - amd64 + - arm64 diff --git a/packages/mithril-client/files/mithril-client.sh.gotmpl b/packages/mithril-client/files/mithril-client.sh.gotmpl new file mode 100644 index 0000000..d4eb15d --- /dev/null +++ b/packages/mithril-client/files/mithril-client.sh.gotmpl @@ -0,0 +1,73 @@ +#!/bin/bash + +declare -a _darwin_allowed_paths=( + "/Users" + "/Volumes" + "/private" + "/tmp" + "/var/folders" +) + +# setup options +_options=(${@}) +for i in ${!_options[@]}; do + j=$((i+1)) + k=${_options[i]} + v=${_options[j]} + _found=false + # remap absolute paths to /host in the container + if [[ ${k} =~ ^/ ]]; then + k="/host${k}" + _options[i]=${k}; + continue + fi + case ${k} in + --aggregator-endpoint) AGGREGATOR_ENDPOINT=${v}; _found=true ;; + --genesis-verification-key) GENESIS_VERIFICATION_KEY=${v}; _found=true ;; + esac + if [[ ${_found} == true ]]; then + _options[i]=""; + _options[j]=""; + fi +done + +_network="{{ .Context.Network }}" + +case ${_network} in + mainnet|preprod) _path=release-${_network} ;; + preview) _path=pre-release-${_network} ;; + sanchonet) _path=testing-${_network} ;; +esac +AGGREGATOR_ENDPOINT=${AGGREGATOR_ENDPOINT:-https://aggregator.${_path}.api.mithril.network/aggregator} +if [[ -z ${GENESIS_VERIFICATION_KEY} && -f ${GENESIS_VERIFICATION_KEY_PATH} ]]; then + GENESIS_VERIFICATION_KEY=$(<${GENESIS_VERIFICATION_KEY_PATH}) +fi + +_docker_args=() +if [[ $(uname -s) == Darwin ]]; then + for _path in "${_darwin_allowed_paths[@]}"; do + _docker_args+=( "-v" "${_path}:/host${_path}" ) + done +else + _docker_args+=( "-v" "/:/host" ) +fi + +# flatten options into args +for i in ${_options[@]}; do + _args+=" ${i}" +done +_args=$(echo ${_args} | sed -e 's/^ //') + +# Run mithril-client-cli via Docker +# We map the host filesystem into the container +docker run \ + -ti \ + --rm \ + -u $(id -u):$(id -g) \ + -w /host$(pwd) \ + --entrypoint /bin/bash \ + -e AGGREGATOR_ENDPOINT="${AGGREGATOR_ENDPOINT}" \ + -e GENESIS_VERIFICATION_KEY="${GENESIS_VERIFICATION_KEY}" \ + "${_docker_args[@]}" \ + ghcr.io/blinklabs-io/mithril-client:{{ .Package.Version }} \ + -c "GENESIS_VERIFICATION_KEY=\${GENESIS_VERIFICATION_KEY:-\$(= 20240515 + - cardano-node >= 8.9.3 +installSteps: + - docker: + containerName: ogmios + image: cardanosolutions/ogmios:v6.4.0 + command: + - ogmios + - --log-level + - info + - --host + - 0.0.0.0 + - --port + - "1337" + - --node-socket + - /ipc/node.socket + - --node-config + - /config/{{ .Context.Network }}/cardano-node/config.json + binds: + - '{{ .Paths.ContextDir }}/node-ipc:/ipc' + - '{{ .Paths.ContextDir }}/config/{{ .Context.Network }}:/config' + ports: + - "1337" + pullOnly: false +outputs: + - name: url + description: Ogmios WebSocket & HTTP server URL + value: 'http://localhost:{{ index (index .Ports "ogmios") "1337" }}' + - name: health_url + description: Ogmios health URL + value: 'http://localhost:{{ index (index .Ports "ogmios") "1337" }}/health' +tags: + - docker + - linux + - darwin + - amd64 + - arm64 diff --git a/packages/ogmios/ogmios-6.5.0.yaml b/packages/ogmios/ogmios-6.5.0.yaml new file mode 100644 index 0000000..d3c2019 --- /dev/null +++ b/packages/ogmios/ogmios-6.5.0.yaml @@ -0,0 +1,41 @@ +name: ogmios +version: 6.5.0 +description: Ogmios, a WebSocket & HTTP server for Cardano, providing a bridge between Cardano nodes and clients. +dependencies: + - cardano-config = 20240702 + - cardano-node >= 9.0.0 +installSteps: + - docker: + containerName: ogmios + image: cardanosolutions/ogmios:v6.5.0 + command: + - ogmios + - --log-level + - info + - --host + - 0.0.0.0 + - --port + - "1337" + - --node-socket + - /ipc/node.socket + - --node-config + - /config/{{ .Context.Network }}/cardano-node/config.json + binds: + - '{{ .Paths.ContextDir }}/node-ipc:/ipc' + - '{{ .Paths.ContextDir }}/config/{{ .Context.Network }}:/config' + ports: + - "1337" + pullOnly: false +outputs: + - name: url + description: Ogmios WebSocket & HTTP server URL + value: 'http://localhost:{{ index (index .Ports "ogmios") "1337" }}' + - name: health_url + description: Ogmios health URL + value: 'http://localhost:{{ index (index .Ports "ogmios") "1337" }}/health' +tags: + - docker + - linux + - darwin + - amd64 + - arm64