ADD: api endpoint to query the latest block heights

When a new observer starts, or when an exist observer restart, it will need to continue to observe binance chain from where it stopped last time.

Additionally when a new signer starts or restarts, it also needs to know the latest signed block height.

  1. extend TxIn to add block height of binance chain
  2. update statechain logic to save last finalised block height of binance chain it received.
  3. update statechain logic to save last finalised block height of signed statechain txoutarray.
  4. add an api endpoint, like /swapservice/lastblock that returns:
{
 "lastobservedin" : "12345",
 "lastsignedout" : "1233",
 "statechain" : "1234"
}

Note: Add the block height from the statechain, since the Signer will need this to be aware of unsigned transaction arrays, of which there may be multiple.

Edited Sep 18, 2019 by JP
Assignee Loading
Time tracking Loading