TypeScript implementation of the 0x Standard Relayer API for the OrderStream network.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
dist
src
.dockerignore
.env
.gitignore
Dockerfile
LICENSE
README.md
docker-compose.yml
docker.env
package.json
template.env
tsconfig.json
yarn.lock

README.md

OrderStream -> Standard Relayer API

GitHub release

Although this software has been run and tested, assume this package is unstable until a v0.1.0 tag is published.

An implementation of the 0x Standard Relayer API for the OrderStream relay network.

The orderstream-sra software provides a simple way to build a 0x limit order book from the OrderStream. It is also intended to be an example of how to use the OrderStream network to derive and construct order books.

Intro

The orderstream-sra package is a 2nd-layer database and API middleware package intended to be deployed with a connection to an OrderStream full node, or one of Paradigm's public endpoints –– and a MongoDB backend.

It connects to an OS node's order event-stream, filters/parses/validates 0x orders, inserts them into a MongoDB collection, and then provides access via a simple set of API endpoints defined by the 0x Standard Relayer API (v2) spec.

Try It Out

A live (development) version of the software is deployed on Zaidan, Paradigm's primary API server for hosted access to the OS network.

You can try it out at: https://sra.zaidan.io/v2/

An example of 0x instant configured with orderstream-sra (via Zaidan) can be found here.

Run

The orderstream-sra package is intended to be run using Docker compose. Doing so creates/pulls images for the Node.JS runtime supporting the main API implementation, as well as a MongoDB daemon service on a separate container.

All necessary configuration is defined in ./docker.env, and you should be able to deploy a working setup (using docker) with minimal modifications. You simply need to set a WEB3_URL provider variable. The supplied docker environment file is pre-configured for a local Ethereum HTTP JSONRPC endpoint. You can use any HTTP web3 provider.

Build and run the docker images with:

cd orderstream-sra
docker-compose up --build -d

(More instructions coming soon.)

Develop

If you want to help develop orderstream-sra, or wish to make/test modifications of your own, you will need to configure your development environment.

You must run a MongoDB server (mongod) either remotely or on your machine, and then configure the provided .env file template with your database URL, as well as the endpoint of an OrderStream node.

The supplied .env template will work out-of-the box if you use the default mongod binding of mongodb://localhost:27017.