traceflow-indexer
v0.1.1
Published
TraceFlow is an indexer-in-a-box for Mantle. This repo contains the CLI that scaffolds a full stack (indexer, Postgres schema, REST API, Docker Compose) from a contract ABI.
Downloads
4
Readme
TraceFlow
TraceFlow is an indexer-in-a-box for Mantle. This repo contains the CLI that scaffolds a full stack (indexer, Postgres schema, REST API, Docker Compose) from a contract ABI.
Install
npm install -g traceflow-indexerQuick start
- Create a project:
traceflow init traceflow-project
cd traceflow-project- Review
.env, run migrations, add a contract, and start dev:
npm install
npm run migrate
traceflow add-contract --name MyContract --address 0x... --abi ./abis/MyContract.json
npm run devCLI commands
traceflow init [dir]- scaffold a new project indirtraceflow add-contract --name --address --abi- add a contract and generate event tables/typestraceflow config get- print current config and .env overridestraceflow config set --rpc-url --chain-id --start-block --confirmations --database-url- update config/envtraceflow config push --from-env- push .env values to the running APItraceflow config pull --write- fetch settings from the API into .env/configtraceflow dev- run indexer + API locallytraceflow up- run the full stack with Docker Compose
API endpoints
GET /healthGET /statusGET /metricsGET /logsGET /contractsPOST /contractsGET /events?contract=...&event=...&fromBlock=...&toBlock=...&txHash=...&address=...&limit=...GET /tx/:hashGET /tx/:hash/receiptGET /address/:address/activityGET /settingsPATCH /settings
Notes
- The generated project lives in
templates/base. - Event tables are created per contract:
event_<contract>_<event>. - Use
START_BLOCK=latestto start indexing from the current block. - The dashboard is served from the API at
http://localhost:3000. - Use the dashboard “Runtime Settings” panel or
traceflow config setto update RPC/chain/start block settings. - Add contracts directly in the dashboard by pasting name, address, and ABI.
Developing locally
npm install
npm run build
npm link