Installation and usage of the platform

REST API: information about a consensus algorithm in use

https://img.shields.io/badge/auth-required-orange.svg

The methods of the consensus group are provided to obtain information about the consensus algorithm used.

GET /consensus/algo

The method returns the name of the consensus algorithm used.

Response example:

GET /consensus/algo:
{
    "consensusAlgo": "Leased Proof-of-Stake (LPoS)"
}

GET /consensus/settings

The method returns the parameters of the consensus algorithm used, specified in the node configuration file.

Response example:

GET /consensus/settings:
{
    "consensusAlgo": "Proof-of-Authority (PoA)",
    "roundDuration": "25 seconds",
    "syncDuration": "5 seconds",
    "banDurationBlocks": 50,
    "warningsForBan": 3
}

GET /consensus/minersAtHeight/{height}

The method returns the queue of miners at {height}.

This method is only available when PoA or CFT consensus algorithm is used.

The method verifies if the passed height value is greater than 0 and less than the current blockchain height.

Response example:

GET /consensus/minersAtHeight/{height}:
{
"miners": [
    "3Mx5sDq4NXef1BRzJRAofa3orYFxLanxmd7",
    "3N2EsS6hJPYgRn7WFJHLJNnrsm92sUKcXkd",
    "3N2cQFfUDzG2iujBrFTnD2TAsCNohDxYu8w",
    "3N6pfQJyqjLCmMbU7G5sNABLmSF5aFT4KTF",
    "3NBbipRYQmZFudFCoVJXg9JMkkyZ4DEdZNS"
],
"height": 1
}

GET /consensus/miners/{timestamp}

The method returns the queue of miners for {timestamp} (specified in Unix Timestamp format, in milliseconds).

This method is available when using the PoA consensus algorithm.

Response example:

GET /consensus/miners/{timestamp}:
{
    "miners": [
        "3Mx5sDq4NXef1BRzJRAofa3orYFxLanxmd7",
        "3N2EsS6hJPYgRn7WFJHLJNnrsm92sUKcXkd",
        "3N2cQFfUDzG2iujBrFTnD2TAsCNohDxYu8w",
        "3N6pfQJyqjLCmMbU7G5sNABLmSF5aFT4KTF",
        "3NBbipRYQmZFudFCoVJXg9JMkkyZ4DEdZNS"
    ],
    "timestamp": 1547804621000
}

GET /consensus/bannedMiners/{height}

The method returns the list of banned miners at {height}.

This method is only available when PoA or CFT consensus algorithm is used.

The method verifies if the passed height value is greater than 0 and less than the current blockchain height.

Response example:

GET /consensus/bannedMiners/{height}:
{
  "miners": [
      "3N6pfQJyqjLCmMbU7G5sNABLmSF5aFT4KTF",
      "3NBbipRYQmZFudFCoVJXg9JMkkyZ4DEdZNS"
  ],
  "height": 440
}

GET /consensus/basetarget/{signature}

The method returns the basetarget value of block creation by its {signature}. The method is available when using the PoS consensus algorithm.

GET /consensus/basetarget

The method returns the basetarget value of current block creation. The method is available when using the PoS consensus algorithm.

GET /consensus/generatingbalance/{address}

The method returns the generating balance available for the {address} node, including the funds leased to the participant.

This method is only available when using the PoS consensus algorithm.

GET /consensus/generationsignature/{signature}

The method returns the generating signature value of block creation by its {signature}. The method is available when using the PoS consensus algorithm.

GET /consensus/generationsignature

The method returns the generating signature value of current block creation. The method is available when using the PoS consensus algorithm.

See also