Giter Club home page Giter Club logo

shakedex-api's Introduction

Discord

shakedex-api

A web portal for shakedex swap proofs.

Currently in use at https://www.shakedex.com.

Usage

Prerequisites

  1. Node.js v12+
  2. Postgres v12+
  3. An HSD full node with --index-tx enabled.

Installation

  1. Clone the repo.
  2. Run npm install.
  3. Run npm i -g db-migrate to install the database migration tool.
  4. Run DATABASE_URL=<your database url> db-migrate up to run database migrations.
  5. Create a .env file with the environment variables described below.
  6. Run source .env && npm run start.

Environment Variables

Name Use Default
PORT The port Express listens on. 8080
HSD_HOST The HSD host to get chain state from.
HSD_NETWORK The HSD network to get chain state from. regtest
HSD_API_KEY An API key to authenticate with HSD.
HSD_WALLET_ID A wallet ID for use with HSD. This is required by the shakedex API, but the server doesn't need any wallet functionality. primary
DATABASE_URL A Postgres database URL.

Deployment

Elastic Beanstalk configuration files are included if you are using AWS to deploy the app. The configuration files fix an issue with bcrypto and node-gyp, automatically run migrations upon deploy, and define a web process in the Procfile to start the app.

UI/API

The UI is hosted at URLs that do not start with /api. API urls are the following:

GET /api/v1/auctions

Query Params: page, per_page

Gets a list of auctions.

GET /api/v1/auctions/:auction_id

Gets a specific auction.

GET /api/v1/auctions/:auction_id/download

Download's an auctions swap proofs for fulfillment with the shakedex CLI.

POST /api/v1/auctions

Body Params: An auction object. See this file in shakedex for what this looks like.

Security

Please don't report security bugs on GitHub. Instead, send an e-mail to [email protected].

shakedex-api's People

Contributors

kurumiimari avatar

Watchers

James Cloos avatar  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.