Giter Club home page Giter Club logo

self-service-support's Introduction

self-service-support

Provides APIs intended for use in self-service support tools or pages.

Installation

Ensure that you have NodeJs v14:

node -v
# v14.17.0

Obtain a copy of this project and install its dependencies:

git clone	[email protected]:bguiz/self-service-support.git
cd self-service-support
npm install

Install global dependencies

npm install --global pm2 node-dev

Set up environment variables.

For development:

cp .sample.env .env
# edit .env to save with appropriate values for env vars

For production deployment:

less .sample.env
# set the env vars in the secret management utils used in deployment

Run

You can start the server in 3 different ways.

For development (with hot-reload enabled, via node-dev):

npm run dev

For a "plain" run of the server:

npm run start

For a production deployment of the server:

npm run prod

ALternatively, use the Dockerfile provided.

Note: Use npm run to see all the run scripts.

APIs

Health Check

Issue the following HTTP request:

GET /api/status

RSK Token Bridge - Options

Issue the following HTTP request:

GET /api/v1/rsk-token-bridge/options?fromNetwork=ethereum-mainnet&txHash=0x3985fe2ad509a4588501494a715957506f401364112bd55090529686aa538962&walletName=metamask
Accept: application/json

Use a different Accept header of text/html to get a HTML fragment instead of JSON:

GET /api/v1/rsk-token-bridge/options?fromNetwork=ethereum-mainnet&txHash=0x3985fe2ad509a4588501494a715957506f401364112bd55090529686aa538962&walletName=metamask
Accept: application/json

Query Parameters:

  • fromNetwork: One of the following
    • rsk-mainnet
    • rsk-testnet
    • ethereum-mainnet
    • ethereum-testnet
  • txHash: Any valid transaction hash for the selected network
  • walletName: One of the following
    • metamask
    • nifty
    • liquality

Query to work out if given addresses are users of various protocols

GET /api/v1/rsk-address-report/protocol-usage?address=0x8Be2E5Fe4348Ea38777a7c175Abb89050770E854&months=7
Accept: application/json

Query Parameters:

  • address: RSK wallet address
  • months: number of months back from now

Query to work out how many accounts are active

An account is deemed to be active if it has sent a transaction within the past ${days} number of days.

GET /api/v1/rsk-activity-report/all?days=365
Accept: application/json

Query

Counts the number of deployment transactions, and unique addresses making them within a specified date range.

GET /api/v1/rsk-activity-report/developer-activity?startDate=2022.04.01&endDate=2022.05.01&chain=rsk_testnet
Accept: application/json

Query Parameters:

  • startDate: Get stats from and including this date
  • endDate: Get stats up to and including this date
  • chain: Possible values are rsk_mainnet and rsk_testnet

Author

Brendan Graetz

Licence

GPL-3.0

self-service-support's People

Contributors

bguiz avatar shenshin avatar rafaiovlabs avatar lucasvuotto 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.