Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs/readme #12

Merged
merged 4 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
POSTGRES_HOST=db
POSTGRES_USER=db_user
POSTGRES_DB=starknet_metadata
POSTGRES_PASSWORD=
IPFS_NODE_URI=https://ipfs.io
IPFS_TIMEOUT=3
GRPC_BIND=starknet-mainnet-grpc.dipdup.net:80
NODE_URL=
SEQUENCER_URL=https://alpha-mainnet.starknet.io/feeder_gateway
DATASOURCE=node
DATASOURCE_RPS=3
MULTICALL_CONTRACT=0x001f35d1765eff5b7edf84516c100e176800c0b09ba7fac25362a39f6aa3e609
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,3 @@
# Dependency directories (remove the comment below to include it)
vendor/
*.csv
.env*
96 changes: 94 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,94 @@
# starknet-metadata
Metadata indexer for starknet
# Starknet metadata indexer

A DipDup Vertical component intended to indexing starknet tokens metadata

## Features

* Receiving metadata through IPFS and HTTP
* Receiving data through embedded IPFS node
* Indexing `ERC20`, `ERC721` and `ERC1155` tokens

## Public instances

Public deployments with reasonable rate limits are available for testing and prototyping:
* [Starknet metadata](https://ide.dipdup.io/?resource=starknet-metadata.dipdup.net/v1/graphql) `https://starknet-metadata.dipdup.net/v1/graphql`

## Usage examples

### Receiving ERC20 tokens metadata

```gql
query ERC20_token_metadata {
token_metadata(limit: 100, where: { type: { _eq: "erc20" } }) {
created_at
metadata
status
token_id
uri
type
updated_at
contract {
hash
}
}
}
```

### Receiving certain contract tokens metadata

```gql
query Contract_token_metadata {
token_metadata(
limit: 100
where: {
contract: {
hash: {
_eq: "\\x01b10f6d79aa4b556a6c5a067596ca02d8dbf6566f1fbceee136bdaadd9fedc8"
}
}
}
) {
metadata
contract {
hash
}
uri
created_at
token_id
type
updated_at
}
}
```

### Indexer status
To make sure the indexer works fine you can query status table

```gql
query State {
state {
last_time
last_height
name
}
}
```

## Self hosted mode

* Create `.env` file relying on [.env.example](https://github.com/dipdup-io/starknet-metadata/blob/master/.env.example)
* Get Starknet node url endpoint for example on [Blast API](https://blastapi.io/public-api/starknet) and fill up `NODE_URL` variable
* Run `docker compose up --build`

## About

DipDup Vertical for Starknet is a federated API including the following services:

- [x] Generic Starknet indexer
- [x] Starknet ID indexer
- [x] Token metadata indexer
- [ ] Starknet search engine (Q3)
- [ ] Chain/dapp/contract analytics
- [ ] Aggregated market data

Project is supported by Starkware and Starknet Foundation via [OnlyDust platform](https://app.onlydust.com/p/dipdup)
Loading