Add a laconic-console stack with registry CLI

This commit is contained in:
Prathamesh Musale 2024-06-19 17:23:29 +05:30
parent bdddada3da
commit 50194b6bbe
6 changed files with 68 additions and 0 deletions

View File

@ -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

View File

@ -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 <<EOF > $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

View File

@ -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"]

View File

@ -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}

View File

@ -0,0 +1 @@
# laconic-console

View File

@ -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