Update merkl-sushiswap-v3 stack instructions to use deployments
This commit is contained in:
parent
8b0936957d
commit
597c870253
@ -16,26 +16,55 @@ laconic-so --stack merkl-sushiswap-v3 build-containers
|
|||||||
|
|
||||||
## Deploy
|
## Deploy
|
||||||
|
|
||||||
### Configuration
|
Create a spec file for the deployment:
|
||||||
|
|
||||||
Create and update an env file to be used in the next step:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# External Filecoin (ETH RPC) endpoint to point the watcher
|
|
||||||
CERC_ETH_RPC_ENDPOINT=
|
|
||||||
```
|
|
||||||
|
|
||||||
### Deploy the stack
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
laconic-so --stack merkl-sushiswap-v3 deploy --cluster merkl_sushiswap_v3 --env-file <PATH_TO_ENV_FILE> up
|
laconic-so --stack merkl-sushiswap-v3 deploy init --output merkl-sushiswap-v3-spec.yml
|
||||||
|
```
|
||||||
|
|
||||||
|
### Ports
|
||||||
|
|
||||||
|
Edit `network` in the spec file to map container ports to host ports as required:
|
||||||
|
|
||||||
|
```
|
||||||
|
...
|
||||||
|
network:
|
||||||
|
ports:
|
||||||
|
merkl-sushiswap-v3-watcher-db:
|
||||||
|
- '5432'
|
||||||
|
merkl-sushiswap-v3-watcher-job-runner:
|
||||||
|
- 9002:9000
|
||||||
|
merkl-sushiswap-v3-watcher-server:
|
||||||
|
- 127.0.0.1:3007:3008
|
||||||
|
- 9003:9001
|
||||||
|
```
|
||||||
|
|
||||||
|
### Create a deployment
|
||||||
|
|
||||||
|
Create a deployment from the spec file:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
laconic-so --stack merkl-sushiswap-v3 deploy create --spec-file merkl-sushiswap-v3-spec.yml --deployment-dir merkl-sushiswap-v3-deployment
|
||||||
|
```
|
||||||
|
|
||||||
|
### Configuration
|
||||||
|
|
||||||
|
Inside deployment directory, open the `config.env` file and set following env variables:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# External Filecoin (ETH RPC) endpoint to point the watcher to
|
||||||
|
CERC_ETH_RPC_ENDPOINT=https://example-lotus-endpoint/rpc/v1
|
||||||
|
```
|
||||||
|
|
||||||
|
### Start the deployment
|
||||||
|
|
||||||
|
```bash
|
||||||
|
laconic-so deployment --dir merkl-sushiswap-v3-deployment start
|
||||||
```
|
```
|
||||||
|
|
||||||
* To list down and monitor the running containers:
|
* To list down and monitor the running containers:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
laconic-so --stack merkl-sushiswap-v3 deploy --cluster merkl_sushiswap_v3 ps
|
|
||||||
|
|
||||||
# With status
|
# With status
|
||||||
docker ps -a
|
docker ps -a
|
||||||
|
|
||||||
@ -43,39 +72,23 @@ laconic-so --stack merkl-sushiswap-v3 deploy --cluster merkl_sushiswap_v3 --env-
|
|||||||
docker logs -f <CONTAINER_ID>
|
docker logs -f <CONTAINER_ID>
|
||||||
```
|
```
|
||||||
|
|
||||||
* Open the GQL playground at http://localhost:3007/graphql
|
|
||||||
|
|
||||||
```graphql
|
|
||||||
{
|
|
||||||
_meta {
|
|
||||||
block {
|
|
||||||
number
|
|
||||||
timestamp
|
|
||||||
}
|
|
||||||
hasIndexingErrors
|
|
||||||
}
|
|
||||||
|
|
||||||
factories {
|
|
||||||
id
|
|
||||||
poolCount
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
## Clean up
|
## Clean up
|
||||||
|
|
||||||
Stop all the services running in background:
|
Stop all the merkl-sushiswap-v3 services running in background:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
laconic-so --stack merkl-sushiswap-v3 deploy --cluster merkl_sushiswap_v3 down
|
# Only stop the docker containers
|
||||||
|
laconic-so deployment --dir merkl-sushiswap-v3-deployment stop
|
||||||
|
|
||||||
|
# Run 'start' to restart the deployment
|
||||||
```
|
```
|
||||||
|
|
||||||
Clear volumes created by this stack:
|
To stop all the merkl-sushiswap-v3 services and also delete data:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# List all relevant volumes
|
# Stop the docker containers
|
||||||
docker volume ls -q --filter "name=merkl_sushiswap_v3"
|
laconic-so deployment --dir merkl-sushiswap-v3-deployment stop --delete-volumes
|
||||||
|
|
||||||
# Remove all the listed volumes
|
# Remove deployment directory (deployment will have to be recreated for a re-run)
|
||||||
docker volume rm $(docker volume ls -q --filter "name=merkl_sushiswap_v3")
|
rm -r merkl-sushiswap-v3-deployment
|
||||||
```
|
```
|
||||||
|
Loading…
Reference in New Issue
Block a user