Git Product home page Git Product logo

mercury's Introduction

Mercury

Powered by

Mercury is an API that provides authenticated access to event logs stored in IPFS via Orbit-DB. [TODO]

TODOS

  • add request validation (yup)
  • security considerations
  • test coverage

Setup

  • First, install ipfs. When running the app, run the daemon with pubsub enabled

        ipfs daemon --enable-pubsub-experiment
  • navigate to the root directory and execute

        npm install

    and then

        npm start
  • by default, the API will run on port 3000.

REST API

Login

Add Event

  • URL: host:port/{address}/events
  • Description: Allow the user to publish an event to their event log.
  • Method: PATCH
  • headers:
    • Content-Type: application/json
    • Authorization: Bearer <token> : The JWT retrieved after logging in
  • payload: any string value
  • params:
    • address: The ethereum address to identify a unique docstore
    • docstoreName is the name of the docstore in which the data will be persisted. For more information, view the orbit db documentation.
    • id is the unique id of a resource in the specified docstore.

Retrieve Events

  • URL: host:port/{address}/events/{limit}
  • Description: Allow the user to read events from their event log.
  • Method: GET
  • headers:
    • Authorization: Bearer [token] : The JWT retrieved after logging in
  • params:
    • address: The ethereum address to identify a unique docstore
    • limit is the number of events to retrieve from the log

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.