diff --git a/stack-orchestrator/compose/docker-compose-laconic-shopify-faucet.yml b/stack-orchestrator/compose/docker-compose-laconic-shopify-faucet.yml deleted file mode 100644 index 0efa442..0000000 --- a/stack-orchestrator/compose/docker-compose-laconic-shopify-faucet.yml +++ /dev/null @@ -1,29 +0,0 @@ -services: - faucet: - restart: unless-stopped - image: cerc/laconic-shopify-faucet:local - command: ["bash", "-c", "./start-faucet.sh"] - environment: - CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG} - CERC_LACONICD_RPC_ENDPOINT: ${CERC_LACONICD_RPC_ENDPOINT:-http://laconicd:26657} - CERC_FAUCET_KEY: ${CERC_FAUCET_KEY} - CERC_LACONICD_CHAIN_ID: ${CERC_LACONICD_CHAIN_ID:-laconic_9000-1} - CERC_LACONICD_PREFIX: ${CERC_LACONICD_PREFIX:-laconic} - CERC_LACONICD_GAS_PRICE: ${CERC_LACONICD_GAS_PRICE:-1} - volumes: - - faucet-data:/app/db - - ../config/laconic-shopify-faucet/start-faucet.sh:/app/start-faucet.sh - - ../config/laconic-shopify-faucet/config-template.toml:/app/environments/config-template.toml - ports: - - 3000 - healthcheck: - test: ["CMD", "nc", "-vz", "127.0.0.1", "3000"] - interval: 10s - timeout: 5s - retries: 10 - start_period: 5s - extra_hosts: - - "host.docker.internal:host-gateway" - -volumes: - faucet-data: diff --git a/stack-orchestrator/compose/docker-compose-laconic-shopify.yml b/stack-orchestrator/compose/docker-compose-laconic-shopify.yml index 4a18469..8b0a45a 100644 --- a/stack-orchestrator/compose/docker-compose-laconic-shopify.yml +++ b/stack-orchestrator/compose/docker-compose-laconic-shopify.yml @@ -33,8 +33,8 @@ services: CERC_LACONICD_GAS_PRICE: ${CERC_LACONICD_GAS_PRICE:-1} volumes: - faucet-data:/app/db - - ../config/laconic-shopify-faucet/start-faucet.sh:/app/start-faucet.sh - - ../config/laconic-shopify-faucet/config-template.toml:/app/environments/config-template.toml + - ../config/laconic-shopify/start-faucet.sh:/app/start-faucet.sh + - ../config/laconic-shopify/config-template.toml:/app/environments/config-template.toml healthcheck: test: ["CMD", "nc", "-vz", "127.0.0.1", "3000"] interval: 10s diff --git a/stack-orchestrator/config/laconic-shopify-faucet/config-template.toml b/stack-orchestrator/config/laconic-shopify/config-template.toml similarity index 100% rename from stack-orchestrator/config/laconic-shopify-faucet/config-template.toml rename to stack-orchestrator/config/laconic-shopify/config-template.toml diff --git a/stack-orchestrator/config/laconic-shopify-faucet/start-faucet.sh b/stack-orchestrator/config/laconic-shopify/start-faucet.sh similarity index 100% rename from stack-orchestrator/config/laconic-shopify-faucet/start-faucet.sh rename to stack-orchestrator/config/laconic-shopify/start-faucet.sh diff --git a/stack-orchestrator/config/laconic-shopify/start-shopify.sh b/stack-orchestrator/config/laconic-shopify/start-shopify.sh index d7ec38e..72fd3b2 100755 --- a/stack-orchestrator/config/laconic-shopify/start-shopify.sh +++ b/stack-orchestrator/config/laconic-shopify/start-shopify.sh @@ -18,4 +18,4 @@ export FETCH_ORDER_DELAY=$CERC_FETCH_ORDER_DELAY export FAUCET_URL=$CERC_FAUCET_URL export ITEMS_PER_ORDER=$CERC_ITEMS_PER_ORDER -yarn start \ No newline at end of file +yarn start diff --git a/stack-orchestrator/stacks/laconic-shopify-faucet/README.md b/stack-orchestrator/stacks/laconic-shopify-faucet/README.md deleted file mode 100644 index 8f875c7..0000000 --- a/stack-orchestrator/stacks/laconic-shopify-faucet/README.md +++ /dev/null @@ -1,121 +0,0 @@ -# laconic-shopify-faucet - -Instructions for running the laconic faucet - -## Setup - -* Clone the stack repo: - - ```bash - laconic-so fetch-stack git.vdb.to/cerc-io/testnet-laconicd-stack - ``` - -* Clone the laconic-faucet respository: - - ```bash - laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-shopify-faucet setup-repositories - ``` - -* Build the container image: - - ```bash - laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-shopify-faucet build-containers - ``` - - This should create the `cerc/laconic-shopify-faucet` image locally - -## Create a deployment - -* Create a spec file for the deployment: - - ```bash - laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-shopify-faucet deploy init --output laconic-shopify-faucet-spec.yml - ``` - -* Edit `network` in the spec file to map container ports to host ports as required: - - ```bash - network: - ports: - faucet: - - '3000:3000' - ``` - -* Create a deployment from the spec file: - - ```bash - laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-shopify-faucet deploy create --spec-file laconic-shopify-faucet-spec.yml --deployment-dir laconic-shopify-faucet-deployment - ``` - -## Configuration - -* Inside the `laconic-shopify-faucet-deployment` deployment directory, open `config.env` file and set following env variables: - - ```bash - # Private key of a funded faucet account - CERC_FAUCET_KEY= - - # Optional - - # laconicd RPC endpoint (default: http://laconicd:26657) - CERC_LACONICD_RPC_ENDPOINT= - - # laconicd chain id (default: laconic_9000-1) - CERC_LACONICD_CHAIN_ID= - - # laconicd address prefix (default: laconic) - CERC_LACONICD_PREFIX= - - # laconicd gas price (default: 1) - CERC_LACONICD_GAS_PRICE= - ``` - -## Start the deployment - - ```bash - laconic-so deployment --dir laconic-shopify-faucet-deployment start - ``` - -## Check status - -* To list down and monitor the running container: - - ```bash - # With status - docker ps - - # Check logs for a container - docker logs -f - ``` - -## Run - -* Request tokens from the faucet for an account: - - ```bash - curl -X POST http://localhost:3000/faucet \ - -H "Content-Type: application/json" \ - -d '{"address": ""}' - - # Expected output: - # {"success":true,"txHash":""} - ``` - -## Clean up - -* Stop the `laconic-shopify-faucet` service running in the background: - - ```bash - # Stop the docker container - laconic-so deployment --dir laconic-shopify-faucet-deployment stop - ``` - -* To stop the service and also delete data: - - ```bash - # Stop the docker containers - laconic-so deployment --dir laconic-shopify-faucet-deployment stop --delete-volumes - - # Remove deployment directory (deployment will have to be recreated for a re-run) - rm -r laconic-shopify-faucet-deployment - ``` diff --git a/stack-orchestrator/stacks/laconic-shopify-faucet/stack.yml b/stack-orchestrator/stacks/laconic-shopify-faucet/stack.yml deleted file mode 100644 index 86be391..0000000 --- a/stack-orchestrator/stacks/laconic-shopify-faucet/stack.yml +++ /dev/null @@ -1,9 +0,0 @@ -version: "1.0" -name: laconic-shopify-faucet -description: "Faucet for shopify app" -repos: - - git.vdb.to/cerc-io/laconic-faucet@shopify -containers: - - cerc/laconic-shopify-faucet -pods: - - laconic-shopify-faucet diff --git a/stack-orchestrator/stacks/laconic-shopify/stack.yml b/stack-orchestrator/stacks/laconic-shopify/stack.yml index 0df9771..761caed 100644 --- a/stack-orchestrator/stacks/laconic-shopify/stack.yml +++ b/stack-orchestrator/stacks/laconic-shopify/stack.yml @@ -9,4 +9,3 @@ containers: - cerc/laconic-shopify-faucet pods: - laconic-shopify - - laconic-shopify-faucet