Skip to content

A Phoenix-powered web application serving an HTTP API for Operate.

License

Notifications You must be signed in to change notification settings

operate-bsv/op_api

Repository files navigation

Operate | API

A Phoenix-powered web application serving an HTTP API for Operate.

About Operate

Operate is a toolset to help developers build applications, games and services on top of Bitcoin (SV). It lets you write functions, called "Ops", and enables transactions to become small but powerful programs, capable of delivering new classes of services layered over Bitcoin.

More infomation:

Endpoints

Endpoint Parameters

GET /ops

Retrieves a list of all Ops.

Query params

  • fn - If present, the Op function is included in the response.

GET /ops/{ref}

Retrieves a single Op.

Path params

  • ref - Either the Op reference, SHA-256 hash or txid.

Query params

  • fn - If present, the Op function is included in the response.

GET /ops/{ref}/fn

Retrieves the raw Op function.

Path params

  • ref - Either the Op reference, SHA-256 hash or txid.

GET /ops/{ref}/versions

Retrieves a list of all Op versions.

Path params

  • ref - Either the Op reference, SHA-256 hash or txid.

Query params

  • fn - If present, the Op function is included in the response.

GET /tapes/{txid}

Retrieves a single Tape and responds with an array of tape cells.

Path params

  • txid - The transaction ID of the tape.

POST /tapes/{txid}

Runs the Tape and responds with the tape result.

Path params

  • txid - The transaction ID of the tape.

Developing

To run the API locally:

  • Install dependencies with mix deps.get
  • Create and migrate your database with mix ecto.setup
  • Start Phoenix endpoint with mix phx.server
  • Visit http://localhost:4000/ops from your browser.

The Pheonix application itself is purely a read-only web API. It is intended to be used in conjunction with Operate | Planaria which indexes the blockchain.

License

MIT License.

© Copyright 2019 Chronos Labs Ltd.

About

A Phoenix-powered web application serving an HTTP API for Operate.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published