From e06926ea692175056296dc0fc425bf040e57114d Mon Sep 17 00:00:00 2001 From: rabi-siddique Date: Tue, 24 Dec 2024 18:52:56 +0500 Subject: [PATCH 1/2] docs: indexing locally and running tests --- README.md | 49 ++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 42 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 74337600..a5b79a61 100644 --- a/README.md +++ b/README.md @@ -111,14 +111,49 @@ The fastest way to get support is by [searching our documentation](https://acade ### Locally -1. Start up an A3P instance: +1. Start up an A3P instance -```sh -docker run -p 26657:26657 -p 1317:1317 -p 9090:9090 ghcr.io/agoric/agoric-3-proposals:latest -``` + ```sh + docker run -p 26657:26657 -p 1317:1317 -p 9090:9090 ghcr.io/agoric/agoric-3-proposals:latest + ``` + +2. Start up the Indexer + After the A3P instance is up and running, initiate the indexer with the following command: + + ```sh + AGORIC_NET=docker yarn dev + ``` + +3. Accessing the GraphQL Interface + Once the indexer is operational, access the GraphQL interface to query indexed data: + + - Open a web browser and navigate to http://localhost:3000. + - Use the provided interface to write and execute your GraphQL queries. + +### Troubleshooting the Indexer + +If you encounter issues with the indexer: + +- Check the logs for any errors or warnings that might indicate what is wrong. Use the command: + + ```sh + docker logs + ``` + + Replace with the actual ID of your Docker container involved in indexing. + +- If restarting the indexer is necessary, first delete the `.data` folder in the root directory to avoid conflicts or corruption of data: + + ```sh + rm -rf .data + ``` + +## Testing -2. Browse it with [vstorage viewer](https://vstorage.agoric.net/?endpoint=http%3A%2F%2Flocalhost%3A26657) +When a PR is created, tests associated with indexing are automatically triggered in the following workflows: -3. Update tests to verify some observations you've made in the vstorage viewer +- `.github/workflows/pr.yaml` +- `.github/workflows/liquidation.yaml` +- `.github/workflows/vaults-and-reserve-metrics-testing.yml` -4. Run `yarn test` +These tests are scheduled to run daily and can also be manually triggered at any time from the GitHub Actions tab on GitHub. From 0a174c0ff6d40ff2e038ca508ed7aaa0295224c9 Mon Sep 17 00:00:00 2001 From: rabi-siddique Date: Thu, 26 Dec 2024 10:07:06 +0500 Subject: [PATCH 2/2] docs: add comment for a3p service in Docker Compose --- README.md | 6 ++---- project.ts | 7 +++++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a5b79a61..ebbd434f 100644 --- a/README.md +++ b/README.md @@ -134,14 +134,12 @@ The fastest way to get support is by [searching our documentation](https://acade If you encounter issues with the indexer: -- Check the logs for any errors or warnings that might indicate what is wrong. Use the command: +- Check the logs of indexer for any errors or warnings that might indicate what is wrong. Use the command: ```sh - docker logs + docker logs -f agoric-subql-subquery-node-1 ``` - Replace with the actual ID of your Docker container involved in indexing. - - If restarting the indexer is necessary, first delete the `.data` folder in the root directory to avoid conflicts or corruption of data: ```sh diff --git a/project.ts b/project.ts index 5ed79c5d..f3618ed5 100644 --- a/project.ts +++ b/project.ts @@ -44,6 +44,13 @@ const networkConfig = { chaintypes: chainTypesU18, startBlock: 1, }, + /* + This configuration is specifically for the "ci" profile for the agd container. + The reason for using the "ci" profile is because the URL http://host.docker.internal:26657 + is not accessible in CI environments. Therefore, we added the a3p service to the Docker + Compose file and assigned it a "ci" profile to ensure it only runs in CI. In the CI environment, + we then use the address http://agd:26657 +*/ ci: { chainId: 'agoriclocal', endpoint: ['http://a3p:26657'],