stack-orchestrator/stack_orchestrator/data/stacks/ajna
Nabarun 44faf36837
Some checks failed
Lint Checks / Run linter (push) Successful in 45s
Publish / Build and publish (push) Successful in 1m35s
Webapp Test / Run webapp test suite (push) Successful in 4m29s
Deploy Test / Run deploy test suite (push) Successful in 5m29s
Smoke Test / Run basic test suite (push) Successful in 4m51s
Fixturenet-Laconicd-Test / Run an Laconicd fixturenet test (push) Successful in 9m18s
Fixturenet-Eth-Plugeth-Arm-Test / Run an Ethereum plugeth fixturenet test (push) Failing after 33s
Fixturenet-Eth-Plugeth-Test / Run an Ethereum plugeth fixturenet test (push) Successful in 53m4s
K8s Deploy Test / Run deploy test suite on kind/k8s (push) Successful in 10m6s
Database Test / Run database hosting test on kind/k8s (push) Successful in 11m4s
Container Registry Test / Run contaier registry hosting test on kind/k8s (push) Successful in 4m14s
Update ajna-watcher-ts version for using new subgraph (#786)
Part of https://www.notion.so/Run-ajna-finance-subgraph-watcher-87748d78cd7a471b8d71f50d5fdc2657

Reviewed-on: #786
Co-authored-by: Nabarun <nabarun@deepstacksoft.com>
Co-committed-by: Nabarun <nabarun@deepstacksoft.com>
2024-03-26 14:52:57 +00:00
..
README.md Add a Ajna watcher stack (#781) 2024-03-21 07:17:01 +00:00
stack.yml Update ajna-watcher-ts version for using new subgraph (#786) 2024-03-26 14:52:57 +00:00

Ajna Watcher

Setup

Clone required repositories:

laconic-so --stack ajna setup-repositories --git-ssh --pull

Build the container images:

laconic-so --stack ajna build-containers

Deploy

Create a spec file for the deployment:

laconic-so --stack ajna deploy init --output ajna-spec.yml

Ports

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

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

Create a deployment

Create a deployment from the spec file:

laconic-so --stack ajna deploy create --spec-file ajna-spec.yml --deployment-dir ajna-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 ajna-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
      }
    
      accounts {
        id
        txCount
        tokensDelegated
        rewardsClaimed
      }
    }
    

Clean up

Stop all the ajna services running in background:

# Only stop the docker containers
laconic-so deployment --dir ajna-deployment stop

# Run 'start' to restart the deployment

To stop all the ajna services and also delete data:

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

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