2024-07-16 07:07:21 +00:00
|
|
|
# laconic-faucet
|
|
|
|
|
2024-07-17 07:11:39 +00:00
|
|
|
Instructions for running the laconic faucet
|
2024-07-16 07:07:21 +00:00
|
|
|
|
|
|
|
## Setup
|
|
|
|
|
|
|
|
* Clone the stack repo:
|
|
|
|
|
|
|
|
```bash
|
2024-07-17 04:30:46 +00:00
|
|
|
laconic-so fetch-stack git.vdb.to/cerc-io/testnet-laconicd-stack
|
2024-07-16 07:07:21 +00:00
|
|
|
```
|
|
|
|
|
2024-07-17 04:30:46 +00:00
|
|
|
* Clone the laconic-faucet respository:
|
2024-07-16 07:07:21 +00:00
|
|
|
|
|
|
|
```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
|
2024-07-17 07:11:39 +00:00
|
|
|
# Private key of faucet
|
2024-07-16 07:07:21 +00:00
|
|
|
CERC_FAUCET_KEY=
|
2024-07-17 07:11:39 +00:00
|
|
|
|
|
|
|
# Optional
|
|
|
|
|
|
|
|
# laconicd RPC endpoint (default: http://laconicd:26657)
|
|
|
|
CERC_LACONICD_RPC_ENDPOINT=
|
|
|
|
|
|
|
|
# laconicd chain id (default: laconic_9000-1)
|
|
|
|
CERC_LACONICD_CHAIN_ID=
|
|
|
|
|
|
|
|
# Amount of tokens to transfer on a single request (default: 1000000)
|
|
|
|
CERC_TRANSFER_AMOUNT=
|
|
|
|
|
|
|
|
# Daily limit for transfer amount for an address (default: 3000000) (3 requests per day)
|
|
|
|
CERC_DAILY_LIMIT=
|
2024-07-16 07:07:21 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
## 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 <CONTAINER_ID>
|
|
|
|
```
|
|
|
|
|
2024-07-17 07:11:39 +00:00
|
|
|
## Run
|
|
|
|
|
|
|
|
* Request tokens from the faucet for an account:
|
2024-07-16 07:07:21 +00:00
|
|
|
|
|
|
|
```bash
|
|
|
|
curl -X POST http://localhost:3000/faucet \
|
2024-07-17 07:11:39 +00:00
|
|
|
-H "Content-Type: application/json" \
|
|
|
|
-d '{"address": "<laconicd_address>"}'
|
2024-07-16 07:07:21 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
## Clean up
|
|
|
|
|
|
|
|
* Stop the `laconic-faucet` service running in the background:
|
|
|
|
|
|
|
|
```bash
|
2024-07-17 07:11:39 +00:00
|
|
|
# Stop the docker container
|
2024-07-16 07:07:21 +00:00
|
|
|
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
|
|
|
|
```
|