johnkozan / frenscan-substream

Self-hosted DAO focused blockchain explorer built with Streamingfast Substreams

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Frenscan Substream

License

A DAO focused blockchain explorer, built on StreamingFast Substreams.

Install Dependencies

  1. Install substreams cli
  2. Install postgres sink
  3. Optionally install Docker and docker-compose to run a PostresQL database container.

Quick Start

  1. Obtain a StreamingFast API Key and set the SUBSTREAMS_API_TOKEN with the sftoken command.
  2. Create a frens.yaml file to define the DAO to be indexed, or copy one from the examples/ directory. See frens.yaml section for specification.
cp examples/citydao.yaml ./frens.yaml
  1. Start the database:
docker-compose up
  1. Build the substream:
make build
  1. Prepare the database:
make setup_postgres
  1. Start indexing:
make sink_postgres

frens.yaml

WARNING This project is a work in progress and the file format is subject to change

frens.yaml is a file which enumerates all of the Ethereum accounts belonging to a dApp or DAO. The file has two main sections: treasury_accounts and tokens_issued.

---
version: 0.1.0                 # frens.yaml specification version
name: DAO Name
treasury_accounts:
  - name: Treasury account
    address: 0x........
    network: mainnet           # Optional, defaults to mainnet
tokens_issued:
  - name: DAO Token
    address: 0x.......
    network: mainnet           # Optional, defaults to mainnet
    schema: erc20              # Supported: erc20, erc721, erc1155

Issues / Current limitations

  • This substream was written before StreamingFast released the ETH Balance changes substream and ERC20 Balance change substream. This substream will be re-written to take adavantage of these.
  • There is no UI for the substream data at this time.
  • Only one network is currently supported
  • Roll-back of forked blocks in not currently supported. The postgres-sink tails the chain head by 12 blocks in order to avoid forks.

License

Apache

About

Self-hosted DAO focused blockchain explorer built with Streamingfast Substreams

License:Apache License 2.0


Languages

Language:Rust 91.5%Language:PLpgSQL 8.1%Language:Makefile 0.2%Language:Shell 0.1%