Giter Site home page Giter Site logo

4ban-old / eos-demux-js-api-example Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 4.0 265 KB

Example of API for getting history of transactions (saved actions) from MongoDB

License: MIT License

JavaScript 95.47% CSS 0.90% HTML 3.63%
eos eosio demux eos-contracts eos-blockchain blockchain demuxjs express nodejs

eos-demux-js-api-example's Introduction

demux-api

The API example for getting the data from MongoDB.

There are 2 identical routes to demonstrate easy modifications to use different models and functions.

Usage

To run the API service: npm start

Current running configurations:

http://{server_address}:3000/

Default pagination parameters:

  • skip = 0
  • limit = 10

By default sorted in descending order by blockNumber field (recent transactions first)

API examples:

Method URL Description
GET / List of available API
GET /col1 List of available APIs for account 1
GET /col1/{accountName} History for account 1. First 10 transactions
GET /col1/{accountName}?skip=10 History for account 1. Second page (i.e next 10 transactions)
GET /col1/{accountName}?limit=100 History for account 1. First 100 transactions
GET /col1/{accountName}?skip=100&limit=100 History for account 1. Second page (i.e. next 100 transactions)
GET /col1/stats/{accountName} Stats for account 1
GET /col2 List of available APIs for account 2
GET /col2/{accountName} History for account 2. First 10 transactions
GET /col2/{accountName}?skip=10 History for account 2. Second page (i.e next 10 transactions)
GET /col2/{accountName}?limit=100 History for account 2. First 100 transactions
GET /col2/{accountName}?skip=100&limit=100 History for account 2. Second page (i.e. next 100 transactions)
GET /col2/stats/{accountName} Stats for account 2

Install

Install dependencies: npm install Fill the .env file.

# Mainnet API
MONGODB_URL=mongodb://{server_address}:27017/DBname
PORT=3000

Credentials

MONGODB_USER={username}
MONGODB_PASS={password}

Additional

The example of the service that fill the DB go to demux-js service example

eos-demux-js-api-example's People

Contributors

4ban avatar dependabot[bot] avatar

Stargazers

 avatar

Watchers

 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.