Skip to content

Commit 3c8fa09

Browse files
docs: Update graphman usage documentation
Signed-off-by: Maksim Dimitrov <[email protected]>
1 parent 17e9e61 commit 3c8fa09

File tree

1 file changed

+24
-8
lines changed

1 file changed

+24
-8
lines changed

docs/graphman.md

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -371,21 +371,27 @@ Inspect all blocks after block `13000000`:
371371

372372
Remove the call cache of the specified chain.
373373

374-
If block numbers are not mentioned in `--from` and `--to`, then all the call cache will be removed.
374+
Either remove entries in the range `--from` and `--to`, remove stale contracts which have not been accessed for a specified duration `--ttl_days`, or remove the entire cache with `--remove-entire-cache`. Removing the entire cache can reduce indexing performance significantly and should generally be avoided.
375375

376-
USAGE:
377-
graphman chain call-cache <CHAIN_NAME> remove [OPTIONS]
376+
Usage: graphman chain call-cache <CHAIN_NAME> remove [OPTIONS]
377+
378+
Options:
379+
--remove-entire-cache
380+
Remove the entire cache
381+
382+
--ttl-days <TTL_DAYS>
383+
Remove stale contracts based on call_meta table
378384

379-
OPTIONS:
380385
-f, --from <FROM>
381386
Starting block number
382387

383-
-h, --help
384-
Print help information
385-
386388
-t, --to <TO>
387389
Ending block number
388390

391+
-h, --help
392+
Print help (see a summary with '-h')
393+
394+
389395
### DESCRIPTION
390396

391397
Remove the call cache of a specified chain.
@@ -404,6 +410,12 @@ the first block number will be used as the starting block number.
404410
The `to` option is used to specify the ending block number of the block range. In the absence of `to` option,
405411
the last block number will be used as the ending block number.
406412

413+
#### `--remove-entire-cache`
414+
The `--remove-entire-cache` option is used to remove the entire call cache of the specified chain.
415+
416+
#### `--ttl-days <TTL_DAYS>`
417+
The `--ttl-days` option is used to remove stale contracts based on the `call_meta.accessed_at` field. For example, if `--ttl-days` is set to 7, all calls to a contract that has not been accessed in the last 7 days will be removed from the call cache.
418+
407419
### EXAMPLES
408420

409421
Remove the call cache for all blocks numbered from 10 to 20:
@@ -412,5 +424,9 @@ Remove the call cache for all blocks numbered from 10 to 20:
412424

413425
Remove all the call cache of the specified chain:
414426

415-
graphman --config config.toml chain call-cache ethereum remove
427+
graphman --config config.toml chain call-cache ethereum remove --remove-entire-cache
428+
429+
Remove stale contracts from the call cache that have not been accessed in the last 7 days:
430+
431+
graphman --config config.toml chain call-cache ethereum remove --ttl-days 7
416432

0 commit comments

Comments
 (0)