This project is a monorepo that contains the following packages:
@kadena-indexer/indexer
: The indexer package, which is responsible for scanning and storing blocks for Kadena blockchain.@kadena-indexer/terraform
: The Terraform configuration for provisioning the infrastructure required to run the indexer and the node.
wget https://releases.hashicorp.com/terraform/1.7.3/terraform_1.7.3_linux_amd64.zip
unzip terraform_1.7.3_linux_amd64.zip
sudo mv terraform /usr/local/bin/
terraform version
Create an .env
file using the .env.template
as a reference and set the environment variables accordingly.
Initialize your Terraform workspace, which will download the provider and initialize it with the values provided in the terraform.`tfvars`` file.
terraform init
Plan and apply the Terraform configuration to provision your AWS resources:
yarn terraform plan
yarn terraform apply
If you want to destroy the infrastructure created, you can use the following command:
yarn terraform destroy
Set up the indexer with the following commands:
yarn && yarn indexer build
Scan for and store historical blocks.
yarn indexer dev:backfill
Listen for new blocks and store them in real-time.
yarn indexer dev:streaming
Scan for and store any blocks that were missed.
yarn indexer dev:missing
For testing workflows locally, act is required. Install it using Homebrew:
brew install act
If you want to run the terraform workflow manually, you can use the following command:
yarn run-terraform-workflow
If you want to run the indexer workflow manually, you can use the following command:
yarn run-indexer-workflow