Getting started with Indexer 2.0

I’m getting started with the new 2.0 indexer/API. I’ve got an writer/updater running now that’s ingesting blocks from a fully-synced betanet archival node. On another node, I’ve got a read-only indexer running. On either node, whenever I attempt any REST call using curl, I just get a 404. (I am not using the “token” flag on either instance.)

curl "localhost:8980/transactions?limit=1"
curl "localhost:8980/accounts"
curl "localhost:8980/accounts?asset-id=2645725"
curl "localhost:8980/accounts/SWDDMAMGYEENYHYSBZGVQGA6HA56XHQVICEVISH5WJL4ZXINN3AD37JHFU"

On the command line I get back:

{"message":"Not Found"}

And in the log file I get:

{"level":"info","msg":"127.0.0.1:46654 - - [2020-06-03 21:21:25.407852511 +0000 UTC m=+2509.706013170] \"GET /transactions?limit=1 HTTP/1.1\" 404 24 \"curl/7.58.0\" 297.108µs","time":"2020-06-03T21:21:25Z"}

The updater is pushing out a steady stream of log messages such as:

will start from round >43965

So I assume it’s doing it’s thing.

Perhaps I cannot get any results until the indexer updater is caught up?

Not quite the right urls, try these:
curl http://localhost:8980/health
curl ‘http://localhost:8980/v2/transactions?limit=2

Yep! Adding the /v2 in the URL did the trick. I think the examples in the README on the GitHub need an update.

Ah, yup. Noted. Should get fixed soon. Thanks for trying it out!

The docker-compose up path throws connection errors for the db - caveat this could entirely be my fault.

Starting indexer_indexer_1    ... done
Starting indexer_indexer-db_1 ... done
Attaching to indexer_indexer_1, indexer_indexer-db_1
indexer_1     | Importing test data.
indexer_1     | could not init db, dial tcp 172.19.0.2:5432: connect: connection refused
indexer-db_1  | 
indexer-db_1  | PostgreSQL Database directory appears to contain a database; Skipping initialization
indexer-db_1  | 
indexer-db_1  | 2020-06-04 12:18:57.218 UTC [1] LOG:  starting PostgreSQL 12.3 (Debian 12.3-1.pgdg100+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit
indexer-db_1  | 2020-06-04 12:18:57.219 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
indexer-db_1  | 2020-06-04 12:18:57.219 UTC [1] LOG:  listening on IPv6 address "::", port 5432
indexer-db_1  | 2020-06-04 12:18:57.222 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
indexer-db_1  | 2020-06-04 12:18:57.236 UTC [26] LOG:  database system was shut down at 2020-06-04 12:12:18 UTC
indexer-db_1  | 2020-06-04 12:18:57.240 UTC [1] LOG:  database system is ready to accept connections
indexer-db_1  | 2020-06-04 12:18:57.609 UTC [33] FATAL:  password authentication failed for user "algorand"
indexer-db_1  | 2020-06-04 12:18:57.609 UTC [33] DETAIL:  Password does not match for user "algorand".
indexer-db_1  | 	Connection matched pg_hba.conf line 95: "host all all all md5"
indexer_indexer_1 exited with code 1
indexer-db_1  | 2020-06-04 12:18:58.121 UTC [34] FATAL:  password authentication failed for user "algorand"
indexer-db_1  | 2020-06-04 12:18:58.121 UTC [34] DETAIL:  Password does not match for user "algorand".
indexer-db_1  | 	Connection matched pg_hba.conf line 95: "host all all all md5"```