stack-orchestrator/stack_orchestrator/data/stacks/merkl-sushiswap-v3
Prathamesh Musale 7a9796ffe2 Update subgraph watcher versions and instructions to use deployments (#775)
Part of https://www.notion.so/Setup-watchers-on-sandman-34b5514a10634c6fbf3ec338967c871c

Reviewed-on: cerc-io/stack-orchestrator#775
Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
Co-committed-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
2024-05-03 19:24:41 +00:00
..
README.md Update subgraph watcher versions and instructions to use deployments (#775) 2024-05-03 19:24:41 +00:00
stack.yml Update subgraph watcher versions and instructions to use deployments (#775) 2024-05-03 19:24:41 +00:00

Merkl SushiSwap v3 Watcher

Setup

Clone required repositories:

laconic-so --stack merkl-sushiswap-v3 setup-repositories --git-ssh --pull

Build the container images:

laconic-so --stack merkl-sushiswap-v3 build-containers

Deploy

Create a spec file for the deployment:

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:

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:

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

Start the deployment

laconic-so deployment --dir merkl-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:3007/graphql

    # Example query
    {
      _meta {
        block {
          number
          timestamp
        }
        hasIndexingErrors
      }
    
      factories {
        id
        poolCount
      }
    }
    

Clean up

Stop all the merkl-sushiswap-v3 services running in background:

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

# Run 'start' to restart the deployment

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

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

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