Skip to content

sentioxyz/initia2aptos

Repository files navigation

initia2aptos

Description

A bridge API that maps Initia blockchain data to Aptos-compatible formats.

Installation

pnpm install

Usage

# Start the server
pnpm start

# Development mode
pnpm dev

# Start with custom options
pnpm start -- --port 4000 --cache-enabled true --cache-duration "10 minutes"

# Start with debug mode enabled (logs all requests)
pnpm start -- --debug

Command Line Options

  • -p, --port <number> - Port to run the server on (default: 3000)
  • -c, --chain-id <string> - Chain ID for Initia (default: echelon-1)
  • -e, --endpoint <url> - Indexer endpoint URL
  • --cache-enabled <boolean> - Enable API response caching (default: true)
  • --cache-duration <string> - Cache duration in plain English (default: "5 minutes")
  • -d, --debug - Enable debug mode with request logging

API Endpoints

Main Endpoints

  • /v1 - Returns Initia node info in Aptos format
  • /v1/blocks/by_height/:height - Returns block data by height in Aptos format
  • /v1/accounts/:address/modules - Returns account modules

Cache Management Endpoints

When caching is enabled, the following endpoints are available:

  • /api/cache/performance - Returns cache performance statistics
  • /api/cache/index - Returns the current cache index
  • /api/cache/clear - Clears the entire cache
  • /api/cache/clear/:target - Clears a specific target

Testing

Run the tests with:

pnpm test

Run tests with coverage:

pnpm test:coverage

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published