Add steps to setup faucet deployment
This commit is contained in:
parent
1e1055d1cb
commit
e52f06d84b
@ -64,6 +64,8 @@
|
|||||||
* Create a spec file for the deployment:
|
* Create a spec file for the deployment:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
cd /srv/laconicd
|
||||||
|
|
||||||
laconic-so --stack ~/cerc/fixturenet-laconicd-stack/stack-orchestrator/stacks/fixturenet-laconicd deploy init --output stage0-spec.yml
|
laconic-so --stack ~/cerc/fixturenet-laconicd-stack/stack-orchestrator/stacks/fixturenet-laconicd deploy init --output stage0-spec.yml
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -130,6 +132,123 @@
|
|||||||
|
|
||||||
## faucet
|
## faucet
|
||||||
|
|
||||||
|
* Stack: <https://git.vdb.to/cerc-io/testnet-laconicd-stack/src/branch/main/stack-orchestrator/stacks/laconic-faucet>
|
||||||
|
|
||||||
|
* Source repo: <https://git.vdb.to/cerc-io/laconic-faucet>
|
||||||
|
|
||||||
|
* Target dir: `/srv/faucet/laconic-faucet-deployment`
|
||||||
|
|
||||||
|
* Cleanup an existing deployment if required:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd /srv/faucet
|
||||||
|
|
||||||
|
# Stop the deployment
|
||||||
|
laconic-so deployment --dir laconic-faucet-deployment stop
|
||||||
|
|
||||||
|
# Remove the deployment dir
|
||||||
|
sudo rm -rf laconic-faucet-deployment
|
||||||
|
|
||||||
|
# Remove the existing spec file
|
||||||
|
rm laconic-faucet-spec.yml
|
||||||
|
```
|
||||||
|
|
||||||
|
### Setup
|
||||||
|
|
||||||
|
* Clone the stack repo:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
laconic-so fetch-stack git.vdb.to/cerc-io/testnet-laconicd-stack --pull
|
||||||
|
|
||||||
|
# This should clone the testnet-laconicd-stack repo at `/home/dev/cerc/testnet-laconicd-stack`
|
||||||
|
```
|
||||||
|
|
||||||
|
* Clone required repositories:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-faucet setup-repositories --pull
|
||||||
|
|
||||||
|
# This should clone the laconicd repo at `/home/dev/cerc/laconic-faucet
|
||||||
|
```
|
||||||
|
|
||||||
|
* Build the container images:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-faucet build-containers --force-rebuild
|
||||||
|
|
||||||
|
# This should create the "cerc/laconic-faucet" Docker image
|
||||||
|
```
|
||||||
|
|
||||||
|
### Deployment
|
||||||
|
|
||||||
|
* Create a spec file for the deployment:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd /srv/faucet
|
||||||
|
|
||||||
|
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:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# laconic-faucet-spec.yml
|
||||||
|
network:
|
||||||
|
ports:
|
||||||
|
faucet:
|
||||||
|
- '127.0.0.1:4000: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
|
||||||
|
```
|
||||||
|
|
||||||
|
* Update the configuration:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Get the faucet account key from stage0 deployment
|
||||||
|
export FAUCET_ACCOUNT_PK=$(laconic-so deployment --dir /srv/laconicd/stage0-deployment exec laconicd "echo y | laconicd keys export alice --keyring-backend test --unarmored-hex --unsafe")
|
||||||
|
|
||||||
|
cat <<EOF > laconic-faucet-deployment/config.env
|
||||||
|
CERC_FAUCET_KEY=$FAUCET_ACCOUNT_PK
|
||||||
|
EOF
|
||||||
|
```
|
||||||
|
|
||||||
|
### Start
|
||||||
|
|
||||||
|
* Start the deployment:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
laconic-so deployment --dir laconic-faucet-deployment start
|
||||||
|
```
|
||||||
|
|
||||||
|
* Check status:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# List down the containers and check health status
|
||||||
|
docker ps -a | grep laconicd
|
||||||
|
|
||||||
|
# Follow logs for laconicd container, check that new blocks are getting created
|
||||||
|
laconic-so deployment --dir laconic-faucet-deployment logs faucet -f
|
||||||
|
```
|
||||||
|
|
||||||
|
* Verify that endpoint is now publicly accessible:
|
||||||
|
|
||||||
|
* <https://faucet.laconic.com> is pointed to the faucet endpoint
|
||||||
|
|
||||||
|
* Check faucet:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
curl -X POST https://faucet.laconic.com/faucet
|
||||||
|
|
||||||
|
# Expected output:
|
||||||
|
# {"error":"address is required"}
|
||||||
|
```
|
||||||
|
|
||||||
|
## laconic-console
|
||||||
|
|
||||||
## testnet-onboarding-app
|
## testnet-onboarding-app
|
||||||
|
|
||||||
## laconic-wallet-web
|
## laconic-wallet-web
|
||||||
|
Loading…
Reference in New Issue
Block a user