From af525ab404a4d3fd4969c4a4a75d3f6bdb393ff5 Mon Sep 17 00:00:00 2001 From: Adw8 Date: Tue, 16 Jul 2024 12:37:21 +0530 Subject: [PATCH] Add setup and run instructions to the README --- .../stacks/laconic-faucet/README.md | 121 +++++++++++++++++- .../stacks/laconic-faucet/stack.yml | 2 +- 2 files changed, 121 insertions(+), 2 deletions(-) diff --git a/stack-orchestrator/stacks/laconic-faucet/README.md b/stack-orchestrator/stacks/laconic-faucet/README.md index 09f15aa..60d82c2 100644 --- a/stack-orchestrator/stacks/laconic-faucet/README.md +++ b/stack-orchestrator/stacks/laconic-faucet/README.md @@ -1 +1,120 @@ -# laconic-faucet \ No newline at end of file +# laconic-faucet + +Instructions for running the laconic faucet server + +## Prerequisites + +* Minimum hardware requirements: + + ```bash + RAM: 8-16GB + Disk space: 200GB + CPU: 2 cores + ``` + +## Setup + +* Clone the stack repo: + + ```bash + laconic-so fetch-stack git.vdb.to/cerc-io/laconic-testnet-faucet + ``` + +* Clone the laconic-faucet: + + ```bash + laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-faucet setup-repositories + ``` + +* Build the container image: + + ```bash + laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-faucet build-containers + ``` + + This should create the `cerc/laconic-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-faucet deploy init --output laconic-faucet-spec.yml + ``` + +* Edit `network` in the spec file to map container ports to host ports as required: + + ```bash + network: + ports: + laconic-faucet: + - '3000:3000' + ``` + +* Create a deployment from the spec file: + + ```bash + laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-faucet deploy create --spec-file laconic-faucet-spec.yml --deployment-dir laconic-faucet-deployment + ``` + + + +## Configuration + +* Inside the `laconic-faucet-deployment` deployment directory, open `config.env` file and set following env variables: + + ```bash + CERC_FAUCET_KEY= + ``` + +## Start the deployment +* To start the deployment: + + ```bash + laconic-so deployment --dir laconic-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 + ``` + +* Request tokens from the testnet faucet for your account if required + + ```bash + curl -X POST http://localhost:3000/faucet \ + -H "Content-Type: application/json" \ + -d '{"address": ""}' + ``` + +## Clean up + +* Stop the `laconic-faucet` service running in the background: + + ```bash + # Stop the docker containe + laconic-so deployment --dir laconic-faucet-deployment stop + ``` + +* To stop the service and also delete data: + + ```bash + # Stop the docker containers + laconic-so deployment --dir laconic-faucet-deployment stop --delete-volumes + + # Remove deployment directory (deployment will have to be recreated for a re-run) + rm -r laconic-faucet-deployment + ``` diff --git a/stack-orchestrator/stacks/laconic-faucet/stack.yml b/stack-orchestrator/stacks/laconic-faucet/stack.yml index 0e33375..9282689 100644 --- a/stack-orchestrator/stacks/laconic-faucet/stack.yml +++ b/stack-orchestrator/stacks/laconic-faucet/stack.yml @@ -2,7 +2,7 @@ version: "1.0" name: laconic-faucet description: "Faucet for laconicd" repos: - - github.com/deep-stack/laconic-testnet-faucet + - git.vdb.to/cerc-io/laconic-testnet-faucet containers: - cerc/laconic-faucet pods: