Skip to content

pinax-network/antelope-token-api

Repository files navigation

Antelope Token API

.github/workflows/bun-test.yml

Token balances, supply and transfers from the Antelope blockchains

REST API

Method Path Description
GET
text/html
/ Swagger API playground
GET
application/json
/supply Antelope Tokens total supply
GET
application/json
/balance Antelope Tokens balance changes
GET
application/json
/transfers Antelope Tokens transfers
GET
text/plain
/health Performs health checks and checks if the database is accessible
GET
application/json
/head Information about the current head block in the database
GET
text/plain
/metrics Prometheus metrics for the API
GET
application/json
/openapi OpenAPI specification
GET
application/json
/version API version and commit hash

Requirements

Quick start

Install Bun

$ bun install
$ bun dev

Tests

$ bun lint
$ bun test

For Linux x86

$ wget https://github.com/pinax-network/antelope-token-api/releases/download/v2.0.0/antelope-token-api
$ chmod +x ./antelope-token-api
$ ./antelope-token-api --help                                                                                                       
Usage: antelope-token-api [options]

Token balances, supply and transfers from the Antelope blockchains

Options:
  -V, --version            output the version number
  -p, --port <number>      HTTP port on which to attach the API (default: "8080", env: PORT)
  --hostname <string>      Server listen on HTTP hostname (default: "localhost", env: HOSTNAME)
  --host <string>          Database HTTP hostname (default: "http://localhost:8123", env: HOST)
  --database <string>      The database to use inside ClickHouse (default: "default", env: DATABASE)
  --username <string>      Database user (default: "default", env: USERNAME)
  --password <string>      Password associated with the specified username (default: "", env: PASSWORD)
  --max-limit <number>     Maximum LIMIT queries (default: 10000, env: MAX_LIMIT)
  -v, --verbose <boolean>  Enable verbose logging (choices: "true", "false", default: false, env: VERBOSE)
  -h, --help               display help for command

.env Environment variables

# API Server
PORT=8080
HOSTNAME=localhost

# Clickhouse Database
HOST=http://127.0.0.1:8123
DATABASE=default
USERNAME=default
PASSWORD=
TABLE=
MAX_LIMIT=500

# Logging
VERBOSE=true

Docker environment

  • Pull from GitHub Container registry

For latest release

docker pull ghcr.io/pinax-network/antelope-token-api:latest

For head of develop branch

docker pull ghcr.io/pinax-network/antelope-token-api:develop
  • Build from source
docker build -t antelope-token-api .
  • Run with .env file
docker run -it --rm --env-file .env ghcr.io/pinax-network/antelope-token-api

Contributing

See CONTRIBUTING.md.