Hi, anybody else can guide me how to install successfully algorand indexer using specific algod node?
I have posted this issue to the indexer github:
Hi, anybody else can guide me how to install successfully algorand indexer using specific algod node?
I have posted this issue to the indexer github:
I’ve answered on the issue, but just for completeness:
I think you’re missing the daemon
argument:
$ ./algorand-indexer daemon -v
2.8.0 compiled at 2021-11-29T19:26:17+0000 from git hash 06e7ca8eec01f907474a50cc2072581c0e662ccb
$ ./algorand-indexer daemon -h
run indexer daemon. Serve api on HTTP.
Usage:
indexer daemon [flags]
Flags:
-d, --algod string path to algod data dir, or $ALGORAND_DATA
--algod-net string host:port of algod
--algod-token string api access token for algod
--allow-migration allow migrations to happen even when no algod connected
--dev-mode allow performance intensive operations like searching for accounts at a particular round
-g, --genesis string path to genesis.json (defaults to genesis.json in algod data dir if that was set)
-h, --help help for daemon
--metrics-mode string configure the /metrics endpoint to [ON, OFF, VERBOSE] (default "OFF")
--no-algod disable connecting to algod for block following
--read-timeout duration set the maximum duration for reading the entire request (default 5s)
-S, --server string host:port to serve API on (default :8980) (default ":8980")
-t, --token string an optional auth token, when set REST calls must use this token in a bearer format, or in a 'X-Indexer-API-Token' header
--write-timeout duration set the maximum duration to wait before timing out writes to a http response, breaking connection (default 30s)
Global Flags:
--cpuprofile string file to record cpu profile to
-n, --dummydb use dummy indexer db
-f, --logfile string file to write logs to, if unset logs are written to standard out
-l, --loglevel string verbosity of logs: [error, warn, info, debug, trace] (default "info")
--pidfile string file to write daemon's process id to
-P, --postgres string connection string for postgres database
-v, --version print version and exit
thanks.
i have moved to the indexer.yaml configuration file, and it seems to be working with it
Any thoughts where i could be getting 404 error?
i have this in settings:
postgres-connection-string: "host=postgresql-postgresql-ha-pgpool.algorand-indexer-testnet port=5432 user=postgres password=..dbname=..sslmode=disable"
algod-address: "http://algo-set-service.algorand-testnet:4161"
algod-token: ".."
genesis: /app/genesis/testnet/genesis.json
api-token: ".."
metrics-mode: true
When i do
curl http://algo-set-service.algorand-testnet:4161/v1/testnet-v1.0/block/0 --output x.tmp
i get the first block successfuly
are there any other more verbose logs i could access?
for the record my
algorand-indexer daemon -v
shows
2.8.0 compiled at 2021-11-29T16:42:46+0000 from git hash 06e7ca8eec01f907474a50cc2072581c0e662ccb
The same effect is when i use environmental variables
apiVersion: apps/v1
kind: Deployment
metadata:
name: algorand-indexer
namespace: algorand-indexer-testnet
spec:
selector:
matchLabels:
app: algorand-indexer
replicas: 1
template:
metadata:
labels:
app: algorand-indexer
spec:
containers:
- name: algorand-indexer
image: scholtz2/algorand-indexer:2.8.0-stable
command: [ "/bin/bash", "-c", "--" ]
args: [ "while true; do sleep 30; done;" ]
env:
- name: INDEXER_POSTGRES_CONNECTION_STRING
value: ".."
- name: INDEXER_ALGOD_ADDRESS
value: "http://algo-set-service.algorand-testnet:4161"
- name: INDEXER_ALGOD_TOKEN
value: ".."
- name: INDEXER_API_TOKEN
value: ".."
- name: INDEXER_DEV_MODE
value: "1"
- name: INDEXER_METRICS_MODE
value: "1"
- name: INDEXER_GENESIS
value: "/app/genesis/testnet/genesis.json"
When I tried to insert wrong address to the algod server, it shows the address where it tries to go…
http://x:4161/v2/blocks/0?format=msgpack
the issue is that the algod does not serve v2 blocks for some reason…
Version:
algo@relaynode-ss-1:/app$ goal --version
12885032963
3.2.3.stable [rel/stable] (commit #d2289a52)
Config:
algo@relaynode-ss-1:/app$ cat data/config.json
{
"Version": 19,
"Archival": true,
"NetAddress": ":4161",
"EnableMetricReporting": true,
"EnableLedgerService": true,
"EnableBlockService": true
}
Can the issue be that the 2.8.0 indexer does not communicate to 3.2.3 algod properly?
NetAddress
is for relays.
You need to use EndpointAdress
instead, which by default use port 8080.
See Node configuration settings - Algorand Developer Portal
curl http://algo-set-service.algorand-testnet:4161/v2/testnet-v1.0/block/0 --output xx.tmp
works fine
curl http://algo-set-service.algorand-testnet:4161/v2/block/0?format=msgpack --output xx.tmp
works fine
curl http://algo-set-service.algorand-testnet:4161/v2/blocks/0?format=msgpack --output xx.tmp
also works fine…
so i am at square zero
/v2/block
is not the algod REST endpoint.
It is something else (maybe the relay endpoint).
The algod API REST endpoint that is used by the indexer (and all the SDKs) is: /v2/blocks
. See v2 - Algorand Developer Portal
You need to use the port 8080
or the port indicated by EndpointAddress
.
4161/4160 are ports that other relays connect to (specified by NetAddress
). They are not usable by SDKs and indexers.
Thanks. the connection to algod works great now…
However i have this issue now:
{"error":"AddBlock() err: TxWithRetry() err: attemptTx() err: AddBlock() adding block round 1 but next round to account is 0","level":"error","msg":"adding block 1 to database failed","time":"2022-01-10T20:33:32Z"}
init script
echo "starting indexer"
date
algorand-indexer import
sleep 1
algorand-indexer daemon
sleep 1
algorand-indexer import
sleep 1
algorand-indexer daemon
while true; do echo "hello indexer" `date`; sleep 600;done
seemed to solve the issue for now
thanks @fabrice for great help with troubleshooting my issues