From d1ff89dbdfc9cf6c836820b014a5bbeb784f7742 Mon Sep 17 00:00:00 2001 From: Severin Ulrich Date: Sun, 5 Mar 2023 15:56:01 +0100 Subject: [PATCH 1/2] feat: Add Dockerfile, DockerCompose with 2 sample .env --- .env.mainnet.example | 10 ++++++++++ .env.testnet.example | 9 +++++++++ Dockerfile | 16 ++++++++++++++++ docker-compose.yml | 12 ++++++++++++ 4 files changed, 47 insertions(+) create mode 100644 .env.mainnet.example create mode 100644 .env.testnet.example create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/.env.mainnet.example b/.env.mainnet.example new file mode 100644 index 0000000..3dcc8b9 --- /dev/null +++ b/.env.mainnet.example @@ -0,0 +1,10 @@ +MNEMONIC="" # change me + +NETWORK=mainnet + +# RPC Endpoint (default unless defined) +# https://docs.kujira.app/validators/community-tooling +# https://docs.mintthemoon.xyz/kujira/resources/ +# +# RPC_ENDPOINT=https://kujira.rpc.ghostinnet.com +# RPC_ENDPOINT=https://kujira-rpc.ibs.team diff --git a/.env.testnet.example b/.env.testnet.example new file mode 100644 index 0000000..19b21c5 --- /dev/null +++ b/.env.testnet.example @@ -0,0 +1,9 @@ +MNEMONIC="" # change me + +NETWORK=testnet + +# RPC Endpoint (default unless defined) +# https://docs.kujira.app/validators/community-tooling +# https://docs.mintthemoon.xyz/kujira/resources/ +# +# RPC_ENDPOINT=https://test-rpc-kujira.mintthemoon.xyz diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f2d40db --- /dev/null +++ b/Dockerfile @@ -0,0 +1,16 @@ +FROM node:19 + +ENV TERM=xterm +RUN mkdir /usr/src/app +WORKDIR /usr/src/app + +COPY package*.json ./ +RUN yarn install + +#COPY .eslintrc ./ +COPY tsconfig.json ./ +COPY src ./src + +#RUN yarn build + +CMD ["yarn", "start"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..9387d8a --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,12 @@ +version: '3.9' + +services: + crank: + build: . + image: kujira-crank + container_name: kujira-crank + env_file: + - .env + restart: always + stdin_open: true + tty: true From b745865e73f14dd8c5308db338af8a5cbf695b5f Mon Sep 17 00:00:00 2001 From: Severin Ulrich Date: Sun, 5 Mar 2023 16:01:08 +0100 Subject: [PATCH 2/2] fix: update README --- README.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 19ac6f7..55c89cc 100644 --- a/README.md +++ b/README.md @@ -4,10 +4,22 @@ This crank app uses a single "orchestrator" account, and sets up feegrants to al Long-term this will be replaced by the on-chain scheduler. Until then, this app allows us to understand the dynamics of these crankers before committing to the scheduler. -## Setup +## Setup 1. Ensure that you have `MNEMONIC` available on your env for the orchestrator account 1. `yarn` 1. `NETWORK=mainnet yarn start` NB: On first start, all the feegrants will be created which can take some time + +### using Docker Compose + +```sh +# create .env and config your mnemonic + +# build and start +docker-compose up + +# force rebuild with +docker-compose up --build +```