From 9ef02bf8f0b973b3519886819bdd95f6a5fad609 Mon Sep 17 00:00:00 2001 From: Shreerang Kale Date: Thu, 24 Oct 2024 15:55:38 +0530 Subject: [PATCH] Add README for laconic-shopify-faucet stack --- .../stacks/laconic-shopify-faucet/README.md | 116 +++++++++++++++++- .../stacks/laconic-shopify-faucet/stack.yml | 2 +- 2 files changed, 116 insertions(+), 2 deletions(-) diff --git a/stack-orchestrator/stacks/laconic-shopify-faucet/README.md b/stack-orchestrator/stacks/laconic-shopify-faucet/README.md index ea93e17..965dc07 100644 --- a/stack-orchestrator/stacks/laconic-shopify-faucet/README.md +++ b/stack-orchestrator/stacks/laconic-shopify-faucet/README.md @@ -1 +1,115 @@ -# Laconic Shopify Faucet +# 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= + ``` + +## 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 index 0038b49..86be391 100644 --- a/stack-orchestrator/stacks/laconic-shopify-faucet/stack.yml +++ b/stack-orchestrator/stacks/laconic-shopify-faucet/stack.yml @@ -2,7 +2,7 @@ version: "1.0" name: laconic-shopify-faucet description: "Faucet for shopify app" repos: - - git.vdb.to/cerc-io/laconic-faucet@shopify-faucet + - git.vdb.to/cerc-io/laconic-faucet@shopify containers: - cerc/laconic-shopify-faucet pods: