Skip to content

cortsf/cardano-indexer-playground

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

87 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Description

WIP Collection of easy to use scripts to quickly setup and experiment with multiple cardano chain indexers.

Usage

  1. init submodules in ./repos with: git submodule init && git submodule update
  2. Use build_<something>.sh scripts to build projects. Executables will be installed in ./bin
  3. Start node with start_node_<network>.sh. Check node sync % with ./check-node-sync-<network>.sh.
  4. (Optional) create database if needed
  5. Use start_<indexer>.sh scripts.
  6. Make queries.

Project structure

  • bin: Executables built with build_<something>.sh scripts (not tracked by git).
  • config: Config files for cardano node and indexers.
  • data: Data generated by cardano node and indexers (not tracked by git).
  • openapi-defs: Experimental clients generated from openAPI defs.
  • repos: git submodules.
  • results: Responses given after querying the indexers.

Useful information

Cardano-node config files

Mainnet era boundaries

Era bound SlotNo Block Hash
Last Byron Block 4492799 f8084c61b6a238acec985b59310b6ecec49c0ab8352249afd7268da5cff2a457
Last Shelley Block 16588737 4e9bbbb67e3ae262133d94c3da5bffce7b1127fc436e7433b87668dba34c354a
Last Allegra Block 23068793 69c44ac1dda2ec74646e4223bc804d9126f719b1c245dadc2ad65e8de1b276d7
Last Mary Block 39916796 e72579ff89dc9ed325b723a33624b596c08141c7bd573ecfff56a1f7229e4d09
POINT_A 51130917 7bbbdf882dc15f86ada3d5efe1457e0b4966cd4dbbe228c991c5343c2cd295f8
POINT_B 54780884 1a66b5db811147d3e9148545b52f1e39679bf4091b96c8a92a06bc443ef24819
  • POINT_A: Can be used to -efficiently- crawl a few tx's in address "smol_staking" (in process of confirmation)
  • POINT_A: Can be used to -efficiently- crawl a few tx's in address "smol_staking" (in process of confirmation)

Testnet era boundaries

Era bound SlotNo Block Hash
Last Byron block 1598399 7e16781b40ebf8b6da18f7b5e8ade855d6738095ef2f1c58c77e88b6e45997a4
Last Shelley block 13694363 b596f9739b647ab5af901c8fc6f75791e262b0aeba81994a1d622543459734f2
Last Allegra block 18014387 9914c8da22a833a777d8fc1f735d2dbba70b99f15d765b6c6ee45fe322d92d93
Last Mary block 36158304 2b95ce628d36c3f8f37a32c2942b48e4f9295ccfe8190bcbc1f012e1e97c79eb
Last Alonzo block 62510369 d931221f9bc4cae34de422d9f4281a2b0344e86aac6b31eb54e2ee90f44a09b9

Troubleshooting

Databases

Postgres

  services.postgresql = {
    enable = true;
    package = pkgs.postgresql_14;
    enableTCPIP = true;
    authentication = pkgs.lib.mkOverride 10 ''
       local all all trust
       host all all ::1/128 trust
     '';
    ensureDatabases = ["carp_mainnet" "carp_testnet" "ogmios_datum_cache"];
    ensureUsers = [
      {
        name = "carp";
        ensurePermissions = {
          "DATABASE carp_mainnet" = "ALL PRIVILEGES";
          "DATABASE carp_testnet" = "ALL PRIVILEGES";
        };
      }
      {
        name = "odc";
        ensurePermissions = {
          "DATABASE ogmios_datum_cache" = "ALL PRIVILEGES";
        };
      }
    ];
  };

Redis

  services.redis.servers = {
    scrolls = {
      enable = true;
      port=6379;
    };
  };

Redis-cli

  • Get all keys: KEYS *
  • Get type of key: TYPE
  • Get set members: SMEMBERS
  • Get string: GET
  • Clear database: FLUSHDB
  • Clear all databases: FLUSHALL

Notes

OpenAPI generated clients are experimental and (most likely) won't work.

Experiment notes

Scroll - smolAddress

[[reducers]] type = "UtxoByAddress" key_prefix = "c1" filter = ["addr1qxkwuk0fsg425h8tkfyurhj85gj0h9wy8trflh5dcey73cp5ngu35tg3rr3v0nh7gvtucgjvguwrkc3ef6p4wvsdpsssl5uzp4"] # smolStaking fulladdr (see below)

[intersect] type = "Point" value = [39916796, "e72579ff89dc9ed325b723a33624b596c08141c7bd573ecfff56a1f7229e4d09"] # Last mary block

result before slot 42700000:

127.0.0.1:6379> SMEMBERS "c1.addr1qxkwuk0fsg425h8tkfyurhj85gj0h9wy8trflh5dcey73cp5ngu35tg3rr3v0nh7gvtucgjvguwrkc3ef6p4wvsdpsssl5uzp4"

  1. "e1af9a709cf162a21ca78c9c7f3512a8915813cbd7be86f4665c6f84b98e4a1a#0"
  2. "60344374a074e641b7b31f6c6d316fe92be93b5480c3102e5bcd4261ec91e559#6"
  3. "72f7d40eb9d0e50b4af9d7f18e533314a9d3e56f7e037f0d97e9bd0215f4e8ad#9"
  4. "cd4daa21701fe658f5c6d8c81e825b205c6b465fd41af609da0230bf31baad06#2"
  5. "f78ae22661a25cf3990287cdb93f478ffd46f3b8c4ca9263b050cf3db6935551#0"
  6. "a471cb222ce051ad34388587638ee431e0cab801c535638349a61ddea1bc496c#0"

To-do (and probably, wont-do)

  • Proper nixification
  • Benchmarks

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published