Lightning network official REST API documentation [Chinese version]

Lightning Network (Raiden Network) is under expansion program chain Ethernet Square block chain, Restful API official Chinese version of the document provided by the Wise Raiden node network access address:http://cw.hubwiz.com/card/c/raiden-api/

Raiden API access end node URL usually contains version information, in order to support access to different versions of the API, all API access URL prefixes are: /api/<version>/.

If you want to quickly master the development block chain applications, we recommended Ebizal network block chain application development tutorial series , covering Bitcoin, Ethernet Square, eos, super fabric books and other tendermint block chain, as well as java, go , nodejs, python, php, c #, dart and other development languages.

1, API request / response JSON encoded data

API access requests and responses are encoded using JSON. The following are the common API objects.

1.1 channel / Channel

Example channel object as follows:

{
   "channel_identifier": 21,
   "token_network_identifier": "0x2a65Aca4D5fC5B5C859090a6c34d164135398226",
   "partner_address": "0x61C808D82A3Ac53231750daDc13c777b59310bD9",
   "token_address": "0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8",
   "balance": 25000000,
   "total_deposit": 35000000,
   "state": "opened",
   "settle_timeout": 500,
   "reveal_timeout": 40
}

Channel object contains the following fields:

  • channel_identifier: channel identification, integer
  • partner_address: other address, EIP55 encoded address string, used to open a passage
  • token_address: token address, EIP555 encoded address string token, for the transaction on the channel
  • token_network_identifier: network identifier token, EIP55 network identifier encoded token
  • balance: balance available tokens, integer
  • total_deposit: channel amount has been deposited contracts, integer
  • state: The current status of the channel, a string, a value may include: opened- Channel turned closed- channel is closed settled- and the channel is closed liquidated
  • settle_timeout: Liquidation Channel Timeout number of blocks, integer
  • reveal_timeout: The maximum number of blocks allowed disclosed timeout, integers

1.2 Channel Event / Event

Channel encoding a JSON object events, the event parameters as the properties of the event object. In order to facilitate the distinction between different types of events, the event object in the additionally added event_typeand block_numberattributes.

2, API error message

For API request is unsuccessful, it will return the corresponding http status codes, such as 409 or 400 Bad Request conflict, etc., but also comes with errors in the field json object returned, you can use to get more information about the error. However, it should be noted that, if Raiden can not handle the incoming request and an exception is thrown, it will return http status code 500, it is not json object is then returned, but only a string message Internal server error. This is because we rely on other development library to implement API, we are unable to handle normal response message when an exception occurs.

In any case, we believe that the 500 error is Raiden bug, if you encountered this phenomenon, please give us feedback.

3, access terminal node

The following access Raiden end nodes, may be selected in the development of:

Original link: Ethernet network API documentation Square lightning - Wise Net

Guess you like

Origin blog.51cto.com/13692892/2428939