Update docs and work around GQL client caching in ipld-eth-client (#138)

This commit is contained in:
nikugogoi 2022-07-04 15:36:47 +05:30 committed by GitHub
parent c919d784bf
commit 4b256016da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 51 additions and 5 deletions

View File

@ -90,6 +90,13 @@
* In the [config file](./environments/local.toml) update the `database` connection settings.
* In `graph-watcher` repo, follow the instructions in [Setup](../../README.md#setup) for installing and building packages.
```bash
# After setup
yarn && yarn build
```
* Run the watcher:
```bash
@ -380,3 +387,15 @@
* Open IPFS WebUI http://127.0.0.1:5001/webui and search for IPLDBlocks using their CIDs.
* The state should have auto indexed data and also custom property `transferCount` according to code in [hooks](./src/hooks.ts) file `handleEvent` method.
## Reset / Clean up
* To close down services in stack-orchestrator, hit `ctrl + c` in the terminal where it was run.
* To stop and remove stack-orchestrator services running in background run:
```bash
cd stack-orchestrator
docker-compose -f ./docker/latest/docker-compose-db-sharding.yml down -v --remove-orphans
```

View File

@ -102,11 +102,15 @@ export class EthClient {
}
async getBlockByHash (blockHash?: string): Promise<any> {
const { block } = await this._graphqlClient.query(ethQueries.getBlockByHash, { blockHash });
block.number = parseInt(block.number, 16);
block.timestamp = parseInt(block.timestamp, 16);
const result = await this._graphqlClient.query(ethQueries.getBlockByHash, { blockHash });
return { block };
return {
block: {
...result.block,
number: parseInt(result.block.number, 16),
timestamp: parseInt(result.block.timestamp, 16)
}
};
}
async getLogs (vars: Vars): Promise<any> {

View File

@ -79,9 +79,10 @@
* In the [config file](./environments/local.toml) update the `database` connection settings.
* In `graph-watcher` repo, install and build packages:
* In `graph-watcher` repo, follow the instructions in [Setup](../../README.md#setup) for installing and building packages.
```bash
# After setup
yarn && yarn build
```
@ -247,3 +248,25 @@
```
The data is fetched from watcher database as it is already indexed.
## Reset / Clean up
* Reset and clear deployments in MobyMask repo:
```bash
cd packages/hardhat
# Remove previous deployments in local network if any
cd deployments
git clean -xdf
```
* To close down services in stack-orchestrator, hit `ctrl + c` in the terminal where it was run.
* To stop and remove stack-orchestrator services running in background run:
```bash
cd stack-orchestrator
docker-compose -f ./docker/latest/docker-compose-db-sharding.yml down -v --remove-orphans
```