Coder Social home page Coder Social logo

ordinals-api's Introduction

Ordinals API

A service that indexes Bitcoin Ordinals data and exposes it via REST API endpoints.

Table of Contents

Features

  • Complete ordinal inscription ingestion
    • Genesis block and transaction information
    • Transfer history
    • Current location and ownership information
  • Satoshi ordinal notation endpoints
  • Easy to use REST JSON endpoints with ETag caching
  • Run modes for auto-scaling

API Reference

See the Ordinals API Reference for more information.

Quick Start

System Requirements

The Ordinals API is a microservice that has hard dependencies on other systems. Before you start, you'll need to have access to:

  1. A Chainhook node with a fully indexed Ordinals .redb database.
  2. A local writeable Postgres database for data storage

Running the API

Clone the repo.

Create an .env file and specify the appropriate values to configure the local API server, postgres DB and Chainhook node reachability. See env.ts for all available configuration options.

Build the app (NodeJS v18+ is required)

npm install
npm run build

Start the service

npm run start

Run Modes

To better support auto-scaling server configurations, this service supports three run modes specified by the RUN_MODE environment variable:

  • default: Runs all background jobs and the API server. Use this when you're running this service only on one instance. This is the default mode.
  • readonly: Runs only the API server. Use this in an auto-scaled cluster when you have multiple readonly instances and just one writeonly instance. This mode needs a writeonly instance to continue populating the DB.
  • writeonly: Use one of these in an auto-scaled environment so you can continue consuming new inscriptions. Use in conjunction with multiple readonly instances as explained above.

Stopping the API

When shutting down, you should always prefer to send the SIGINT signal instead of SIGKILL so the service has time to finish any pending background work and all dependencies are gracefully disconnected.

ordinals-api's People

Contributors

rafaelcr avatar semantic-release-bot avatar diwakergupta avatar janniks avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.