sushiswap-watcher-ts/stacks/stack-orchestrator/stacks/sushiswap-v3
2024-06-14 11:26:06 +05:30
..
README.md Fix mount paths for mounted files 2024-06-14 11:26:06 +05:30
stack.yml Update sushiswap watcher image name 2024-06-13 17:44:10 +05:30

SushiSwap v3 Watcher

Clone the stack repo

laconic-so fetch-stack git.vdb.to/cerc-io/sushiswap-watcher-ts

Build the container image

laconic-so --stack ~/cerc/sushiswap-watcher-ts/stacks/stack-orchestrator/stacks/sushiswap-v3 build-containers

Create a spec file for the deployment

laconic-so --stack ~/cerc/sushiswap-watcher-ts/stacks/stack-orchestrator/stacks/sushiswap-v3 deploy init --output sushiswap-v3-spec.yml

Ports

Edit network in the spec file to map container ports to host ports as required:

...
network:
  ports:
    sushiswap-v3-watcher-db:
     - 15432:5432
    sushiswap-v3-watcher-job-runner:
     - 9000:9000
    sushiswap-v3-watcher-server:
     - 3008:3008
     - 9001:9001

Create a deployment from the spec file

laconic-so --stack ~/cerc/sushiswap-watcher-ts/stacks/stack-orchestrator/stacks/sushiswap-v3 deploy create --spec-file sushiswap-v3-spec.yml --deployment-dir sushiswap-v3-deployment

Configuration

Inside deployment directory, open the config.env file and set following env variables:

# External Filecoin (ETH RPC) endpoint to point the watcher to
CERC_ETH_RPC_ENDPOINTS=https://example-lotus-endpoint-1/rpc/v1,https://example-lotus-endpoint-2/rpc/v1

Start the deployment

laconic-so deployment --dir sushiswap-v3-deployment start
  • To list down and monitor the running containers:

    # With status
    docker ps -a
    
    # Check logs for a container
    docker logs -f <CONTAINER_ID>
    
  • Open the GQL playground at http://localhost:3008/graphql

    # Example query
    query {
      _meta {
        block {
          hash
          number
          timestamp
        }
        deployment
        hasIndexingErrors
      }
    

Clean up

Stop all the sushiswap-v3 services running in background:

# Only stop the docker containers
laconic-so deployment --dir sushiswap-v3-deployment stop

# Run 'start' to restart the deployment

To stop all the sushiswap-v3 services and also delete data:

# Stop the docker containers
laconic-so deployment --dir sushiswap-v3-deployment stop --delete-volumes

# Remove deployment directory (deployment will have to be recreated for a re-run)
rm -r sushiswap-v3-deployment