This project is a template indexer for indexing data of ERC-7818 and ERC-7858 tokens, compatible with ERC-20 and ERC-721 tokens.
- Node.js version 20.x (Please make sure you are using Node.js version 20.x)
- Docker
Clone this repository to your local machine:
git clone https://github.com/Kiwari-Labs/kiwari-indexer.gitInstall the project dependencies:
yarn installCreate a .env file in the root directory of the project to store your environment variables:
touch .envIn the config.json file, define the necessary variables like so:
{
"network": "Your network name",
"factoryAddress": "Your factory contract address", // You only need to set the value when you want to index token data deployed through the factory.
"startBlock": "The block number from which you want to start indexing.",
"contractAddress": "Your contract address", // You only need to set the value when you want to index token data that was not deployed through the factory.
}Now, you can build and run the Docker container using the following command:
docker-compose up --buildThis will build the Docker image and start the container to run the indexer.
Once the Docker container is up and running, you need to initialize and deploy the indexer:
Deploy the local environment (without factory)
yarn deploy-local:erc7818-without-factoryDeploy the local environment (with factory)
yarn deploy-local:erc7818-with-factoryOnce these commands are executed successfully, your indexer should be up and running, indexing data for the specified contract.
