The INTMAX2 Explorer API is designed to support the INTMAX2 Explorer, providing seamless and efficient access to blockchain data.
Before running any service, make sure to:
# Install dependencies
yarn
# Copy environment variables
cp .env.example .env
# Build shared packages
yarn build:sharedStart the API or watcher service in development mode:
# api
yarn workspace api dev
# watcher
yarn workspace watcher dev
# finalizer
yarn workspace finalizer devIf your development workflow involves Firestore, you can start a local emulator:
gcloud emulators firestore start
# Set the FIRESTORE_EMULATOR_HOST variable in the same terminal where you will run your application.
export FIRESTORE_EMULATOR_HOST="HOST:PORT"Deployments are automated via Cloud Build when changes are pushed or merged into specific branches.
| Branch | Environment |
|---|---|
dev |
Development |
stage |
Staging(Testnet) |
main |
Production(Mainnet) |
Build and run the project in a Docker container:
docker build -f docker/Dockerfile -t intmax2-explorer-api .
docker run --rm -p 3000:3000 --env-file .env intmax2-explorer-api workspace api startRun Redis in a Docker container with data persistence enabled.
docker run -d --rm \
--name redis \
-p 6379:6379 \
-v redis-data:/data \
redis redis-server --appendonly yesThe project uses Vitest for testing. Run tests with the following commands:
# Run all tests
yarn test
# Run tests in watch mode
yarn test --watch
# Run tests with coverage report
yarn coverageThe API uses API keys for authentication and rate limiting. To generate a secure API key for development or production use:
node -e "console.log('ak_' + require('crypto').randomBytes(32).toString('base64url'))"See the documentation for details on available endpoints and how to use the API. This guide will help you integrate INTMAX2 blockchain data into your applications.
Use the following explorers to browse blocks, transactions, and other on-chain data: