- README.md
- Pre-requisites
- Getting Started
- Advanced Configuration
- Setting Up Allocations
- Setting Up Cost Models
- Tips and Tricks
- Troubleshooting <- you are here
First off, I strongly recommend having either graph-pino
or pino-pretty
installed for this.
You will need NPM installed for them to work and be viewable in a more human-esque manner, so for that, we'll be using NVM (Node Version Manager) to make things easier.
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
# restart or open a new shell/terminal
nvm install node
# restart or open a new shell/terminal
To install graph-pino
, you can simply do:
npm install -g --registry https://registry.npmjs.org/ @graphprotocol/graph-pino
To install pino-pretty
, you can simply do:
npm install -g pino-pretty
And you're done. These two will greatly help you read through the indexer-agent
and indexer-service
logs to easily find errors and warning messages that might occur.
docker logs indexer-agent --tail 10 -f | graph-pino
journalctl -fu indexer-agent -n 10 -f | graph-pino
docker logs indexer-agent --tail 10 -f | pino-pretty -c -t
journalctl -fu indexer-agent -n 10 -f | pino-pretty -c -t
❗ Note: pino-pretty and graph-pino only work for logs that output json strings (ie. indexer agent and service)
The following examples strip the colors out of pino-pretty, sends the stdout to /dev/null and print the logs into a file without showing you the logs on screen.
docker logs indexer-service 2>&1 | pino-pretty -c -t | sed -r "s/[[:cntrl:]]\[[0-9]{1,3}m//g" | tee service.log &> /dev/null &
journalctl CONTAINER_NAME=indexer-service -o cat 2>&1 | pino-pretty -c -t | sed -r "s/[[:cntrl:]]\[[0-9]{1,3}m//g" | tee service.log &> /dev/null &
If you want to extract specific dates from your logs you can do as follows, where -S
is the date/hour since, and -U
is the date/hour until.
journalctl CONTAINER_NAME=indexer-service -S "20:22:00" -U "20:55:00" -o cat 2>&1 | pino-pretty -c -t | sed -r "s/[[:cntrl:]]\[[0-9]{1,3}m//g" | tee service.log &> /dev/null &