Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

graphman commands to fetch / clear the call cache #3559

Closed
azf20 opened this issue May 16, 2022 · 1 comment
Closed

graphman commands to fetch / clear the call cache #3559

azf20 opened this issue May 16, 2022 · 1 comment
Assignees
Labels
area/graphman enhancement New feature or request

Comments

@azf20
Copy link
Contributor

azf20 commented May 16, 2022

Currently if indexers want to inspect & maybe clear the Ethereum call cache, they need to access and alter Postgres directly. This is error prone. There could be a dedicated graphman command to streamline this process:

graphman chain cache-get <chain> <contract_address> [--block <number>|--from <number> --to <number>] to print what’s in the call cache
graphman chain cache-remove <same args as cache_get>

Example existing process, when the call cache is found to be malformed:

# graphman rewind

# prerequisites
have graph nodes at least v0.23.1 and configured with the config toml files

# stop index node containers, keep query node
docker stop index-node-0 index-node-1 indexer-agent indexer-service

# connect to query-node-0 container
./shell query-node-0

# rewind subgraphs
graphman rewind <IPFS_hash> <block_hash> <block_number>


# delete eth call cache

# connect to postgres container
./shell postgres

# connect to your graph-node database
psql <db_name> <db_user>

# find ethereum chain namespace in the db
select * from chains;

# navigate to the namespace
set search_path to chain1;

# find latest block number in the call_cache table
select block_number from call_cache order by block_number desc limit 1;

# delete eth_call_cache to make sure you don't write the same identical data

DELETE FROM call_cache where block_number between X and Y;

or

DELETE FROM `call_cache` WHERE block_number >=X and id<= Y;
@tilacog tilacog self-assigned this May 16, 2022
@neysofu
Copy link
Member

neysofu commented Nov 9, 2022

Closed by #4066.

@neysofu neysofu closed this as completed Nov 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/graphman enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants