diff --git a/stack-orchestrator/compose/docker-compose-laconic-console.yml b/stack-orchestrator/compose/docker-compose-laconic-console.yml new file mode 100644 index 0000000..8cde253 --- /dev/null +++ b/stack-orchestrator/compose/docker-compose-laconic-console.yml @@ -0,0 +1,10 @@ +services: + cli: + image: cerc/laconic2-registry-cli:local + environment: + CERC_LACONICD_RPC_ENDPOINT: ${CERC_LACONICD_RPC_ENDPOINT:-http://laconicd:26657} + CERC_LACONICD_GQL_ENDPOINT: ${CERC_LACONICD_GQL_ENDPOINT:-http://laconicd:9473/api} + CERC_CHAIN_ID: ${CERC_CHAIN_ID:-laconic_9000-1} + CERC_LOGLEVEL: ${CERC_LOGLEVEL:-info} + volumes: + - ../config/laconic-console/create-config.sh:/app/create-config.sh diff --git a/stack-orchestrator/config/laconic-console/create-config.sh b/stack-orchestrator/config/laconic-console/create-config.sh new file mode 100755 index 0000000..c80be8a --- /dev/null +++ b/stack-orchestrator/config/laconic-console/create-config.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +if [[ -n "$CERC_SCRIPT_DEBUG" ]]; then + set -x +fi + +set -e + +# Create the required config file +config_file="/app/config.yml" +cat < $config_file +services: + registry: + rpcEndpoint: ${CERC_LACONICD_RPC_ENDPOINT} + gqlEndpoint: ${CERC_LACONICD_GQL_ENDPOINT} + userKey: ${CERC_USER_KEY} + bondId: ${CERC_BOND_ID} + chainId: ${CERC_CHAIN_ID} + gas: 200000 + fees: 200000photon +EOF diff --git a/stack-orchestrator/container-build/cerc-laconic2-registry-cli/Dockerfile b/stack-orchestrator/container-build/cerc-laconic2-registry-cli/Dockerfile new file mode 100644 index 0000000..63e1ea8 --- /dev/null +++ b/stack-orchestrator/container-build/cerc-laconic2-registry-cli/Dockerfile @@ -0,0 +1,18 @@ +# [Choice] Node.js version (use -bullseye variants on local arm64/Apple Silicon): 18, 16, 14, 18-bullseye, 16-bullseye, 14-bullseye, 18-buster, 16-buster, 14-buster +ARG VARIANT=18-bullseye +FROM node:${VARIANT} + +RUN apt-get update \ + && apt-get -y install --no-install-recommends python3 jq bash curl + +WORKDIR /app + +COPY . . + +RUN echo "Installing dependencies and building laconic-registry-cli" && \ + yarn && yarn build + +# Globally install the cli binary +RUN yarn global add file:$PWD + +CMD ["bash", "-c", "tail -f /dev/null"] diff --git a/stack-orchestrator/container-build/cerc-laconic2-registry-cli/build.sh b/stack-orchestrator/container-build/cerc-laconic2-registry-cli/build.sh new file mode 100755 index 0000000..8ead4b6 --- /dev/null +++ b/stack-orchestrator/container-build/cerc-laconic2-registry-cli/build.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +# Build cerc/laconic2-registry-cli +source ${CERC_CONTAINER_BASE_DIR}/build-base.sh + +# See: https://stackoverflow.com/a/246128/1701505 +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) + +docker build -t cerc/laconic2-registry-cli:local ${build_command_args} -f ${SCRIPT_DIR}/Dockerfile ${SCRIPT_DIR} diff --git a/stack-orchestrator/stacks/laconic-console/README.md b/stack-orchestrator/stacks/laconic-console/README.md new file mode 100644 index 0000000..00e0cf7 --- /dev/null +++ b/stack-orchestrator/stacks/laconic-console/README.md @@ -0,0 +1 @@ +# laconic-console diff --git a/stack-orchestrator/stacks/laconic-console/stack.yml b/stack-orchestrator/stacks/laconic-console/stack.yml new file mode 100644 index 0000000..57adcc3 --- /dev/null +++ b/stack-orchestrator/stacks/laconic-console/stack.yml @@ -0,0 +1,9 @@ +version: "1.0" +name: laconic-console +description: "Laconic registry CLI and console" +repos: + - git.vdb.to/cerc-io/laconic-regsitry-cli@laconic2 +containers: + - cerc/laconic2-registry-cli +pods: + - laconic-console