https://github.com/bard/gs-index
Composable command-line blockchain indexer for Gitcoin's Grants Stack
https://github.com/bard/gs-index
blockchain eventsourcing
Last synced: 4 months ago
JSON representation
Composable command-line blockchain indexer for Gitcoin's Grants Stack
- Host: GitHub
- URL: https://github.com/bard/gs-index
- Owner: bard
- Created: 2023-12-15T13:02:13.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-12-15T23:10:56.000Z (over 2 years ago)
- Last Synced: 2025-02-14T03:28:55.105Z (over 1 year ago)
- Topics: blockchain, eventsourcing
- Language: Rust
- Homepage: https://bard.github.io/gitcoin-hackathon-2023-presentation/
- Size: 86.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# gs-index
Command-line indexer for [Allo (v1)](https://github.com/gitcoinco/grants-stack-allo-contracts-v1) events. Built for Gitcoin's December 2023 hackathon ([presentation](https://bard.github.io/gitcoin-hackathon-2023-presentation/)). Companion to [gs-log](https://github.com/bard/gs-log).
## Features
- accepts events as JSON on stdin for easy composition: file, network, direct pipe from [gs-log](https://github.com/bard/gs-log), etc
- outputs SQL (Postgres dialect)
## Download
Download the binary for your platform from [Releases](https://github.com/bard/gs-index/releases).
## Examples
Index historical data into a local database:
```sh
$ cat event_log.ndjson | gs-index | psql mydb
```
Index historical plus live data into a local database:
```sh
$ gs-log --chains 58008:origin..ongoing | gs-index | psql mydb
```
Index historical plus live data and keep a log to easily resume in case of interruption:
```sh
$ gs-log --chains 58008:origin..ongoing | \
tee -a event_ndjson.log | \
gs-index | \
psql mydb
# ... later ...
$ cat event_ndjson | \
gs-log --resume | \
tee -a event_ndjson.log | \
gs-index | \
psql mydb
```
## Development
Running tests in watch mode:
```sh
# start db for integration tesnts
$ docker-compose up -d
$ cargo watch --watch src --ignore snapshots --clear -x test
```
## Status
Work in progress. Event support:
- [x] ProjectCreated
- [x] MetadataUpdated
- [x] OwnerAdded
- [x] OwnerRemoved
- [x] RoundCreated
- [x] NewProjectApplication
- [ ] MatchAmountUpdated
- [ ] RoundMetaPtrUpdated
- [ ] ApplicationMetaPtrUpdated
- [ ] ProjectsMetaPtrUpdated
- [ ] ApplicationStatusesUpdated
- [ ] VotingContractCreatedV1
- [ ] VotingContractCreated
- [ ] Voted
- [ ] PayoutContractCreated
- [ ] ApplicationInReviewUpdated