Giter VIP home page Giter VIP logo

api's People

Contributors

0x0d01 avatar apemon avatar bomu-bomu avatar crossknight avatar dependabot[bot] avatar jirapusnon avatar krissdap avatar niponchi avatar oatsaysai avatar panikt avatar phirasit avatar re7eal avatar taneekpet avatar tansinee avatar yzi-afk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

api's Issues

/ndid/initNDID should not respond with array of [success_status, height]

/ndid/initNDID, if success, will respond with [true, <height>]. Instead, it should respond with success status (true/false) only.

As I have investigated, the issue seems to be caused by

init = await tendermint.transact(
.

Since tendermint.transact() returns an array, the line should destructure the returned array and return only success status instead of the whole array.

So it should be something like:

const [ result, height ] = tendermint.transact(
...
init = result;
return init; 

Callback request status to RP has duplicate response_valid_list

I have two IDP, AS nodes and RP create request with data request (min_idp=1, min_as=2)
two IDP nodes are respond request at the same time and final callback request status to RP has duplicate response_valid_list like this.

response_valid_list: [ { idp_id: 'idp2', valid_proof: true, valid_ial: true },
{ idp_id: 'idp2', valid_proof: true, valid_ial: true } ]

Master Public Key is not registered when start up a new node in docker

Reproduce Steps

  • Start up a new node in docker
  • Query to function GetNodeMasterPublicKey via Tendermint RPC

Current Result

  • Get {"master_public_key":""}

Expected Result

  • Get {"master_public_key":"<key_in_pem_format>"}

Cause

  • Typo in start up script start-api.sh when setting path to MASTER_PUBLIC_KEY_PATH

No defaultMqBindingPort for ndid role, cause process exit if no MQ_BINDING_PORT set

from mq.js

export const defaultMqBindingPort = (() => {
  if (process.env.ROLE === 'as') return 5557;
  if (process.env.ROLE === 'idp') return 5555;
  if (process.env.ROLE === 'rp') return 5556;
})();

If we not set MQ_BINDING_PORT before start process as ndid role, the process will be crashed with

/home/circleci/project/node_modules/zeromq/lib/index.js:451
  this._zmq.bindSync(addr);
            ^
Error: Invalid argument
    at exports.Socket.Socket.bindSync (/home/circleci/project/node_modules/zeromq/lib/index.js:451:13)
    at Object.<anonymous> (/home/circleci/project/src/mq/index.js:12:17)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/home/circleci/project/src/core/rp.js:10:1)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/home/circleci/project/src/routes/rp.js:4:1)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)

Wait for blockchain sync on start

Issue

When starting a new tendermint node, it will sync/replay all the transactions.

Possible Solution

Track chain sync status by checking the result returned from calling /status to tendermint.

Configurable callback retry timeout

Add CALLBACK_RETRY_TIMEOUT as an environment variable for configurable callback retry timeout.

This config applies ONLY to callback retries that have not set a pre-retry hook function (shouldRetry function). The timeout value is in seconds. Default is 600 seconds or 10 minutes.

Request status was reject when reject before accept

Scenario:
Create Request with
min_idp: 1
idp_id_list: [idp1, idp2]
mode: 3

When reject at idp1 and accept at idp2, the request was rejected.

I think this case the request status should be completed by 1 IdP accept.

Wait for genesis block to be committed and signed on start

Issue

Having to wait for ABCI app output:

Commit
Commit

before starting api server.

Possible Solution

Listen for 'NewBlock' event from tendermint and check if height >= 2 (Genesis block committed and signed) before receiving/processing any requests.

GET /utility/requests/:request_id response with error 500 when request_id does not exist

error: Responded Internal Server Error with HTTP code 500 { responseBody: 
api-idp-1_1  |    { error: 
api-idp-1_1  |       { code: 10000,
api-idp-1_1  |         message: 'Cannot destructure property `special` of \'undefined\' or \'null\'.',
api-idp-1_1  |         stack: 'CustomError: Cannot get request details from blockchain\n    at Object.getRequestDetail (/api/src/tendermint/ndid.js:410:11)\n    at <anonymous>\n    at process._tickCallback (internal/process/next_tick.js:188:7)\nCaused By: TypeError: Cannot destructure property `special` of \'undefined\' or \'null\'.\n    at Object.getRequestDetail (/api/src/tendermint/ndid.js:396:5)\n    at <anonymous>\n    at process._tickCallback (internal/process/next_tick.js:188:7)' } } }

Hash algorithm unsafe

I mentioned this to @taneekpek at Barcamp. I would like to propose that bcrypt is used as a hash algorithm instead of sha256.

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.