Scan all nft from EVM-compatible blockchain node
Output: TODO: fill here
$ yarn install
Prepare kafka auth file, put it here:
secrets/kafka.keystore.jks
Create and edit the .env
file:
cp .env.example .env
# development
$ yarn start
# watch mode
$ yarn start:dev
# production mode
$ yarn start:prod
# unit tests
$ yarn test
# e2e tests
$ yarn test:e2e
# test coverage
$ yarn test:cov
This is how you operate this service:
TODO
Open graphql interface and run the mutation:
scanBlockRange(
from_block: Float!
to_block: Float!
chain: String!
block_per_step: Float!
): Boolean
Let's say you wanna scan block 100-1000 and 3000-4000 parallel.
Approach to run scan in multiple threads.
- Run 2 mutation:
- scanBlockRange(100, 1000, "ETH", 50)
- scanBlockRange(3000, 4000, "ETH", 50)
This will start 2 threads in a same process
- Start 2 node process with different port on a single machine or multiple vps:
pm2 start nft-blockscan-1
> Run the mutation against this processpm2 start nft-blockscan-2
> Run the mutation against this process
Open the graphql interface and run the mutation:
scanFromBlock(
chain: String
from_block: Float!
): Boolean
- This will scan from from_block to future
- If you don't fill in from_block field, this will scan from the (lastest block - 10) to the future
Open the graphql interface and run the query:
query {
getBlocksFailed{
blockRange,
singleBlock
}
}
- This will return a list of blocks failed and reason.
- Then you can use the
scanBlockRange
api to rescan these blocks.