Skip to content
Jaynti Kanani edited this page Mar 11, 2019 · 1 revision

Checkpoint Related Endpoints

Generate new checkpoint

curl -X GET \
  http://localhost:1317/checkpoint/<startBlock>/<endBlock> \
  -H 'cache-control: no-cache' \
  -H 'postman-token: 9b98abc0-bdaa-772a-38d4-7c29351b87a4'

Propose new checkpoint

curl -X POST \
  http://localhost:1317/checkpoint/new \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/json' \
  -H 'postman-token: ccb714f8-7197-3f72-d4a3-97c6d654f53b' \
  -d '{
	"proposer":"0x0cdf0edd304a8e1715d5043d0afe3d3322cc6e3b",
	"rootHash":"0xb2160bdf78e2dd513763b7767d510cad84eba764b9ec0e00a0110fadaf14b179",
	"startBlock":201,
	"endBlock":204
}'

Submit ACK for checkpoint

curl -X POST \
  http://localhost:1317/checkpoint/ack \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/json' \
  -H 'postman-token: b800a79b-158b-8590-ba2f-aedb1fd1942a' \
  -d '{
	"HeaderBlock" : 20000
}'

Submit no-ack for checkpoint

curl -X POST \
  http://localhost:1317/checkpoint/no-ack \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/json' \
  -H 'postman-token: c1144a01-7ddd-b2b3-05eb-dbe752a2a064'

Get next n proposers

curl -X GET \
  http://localhost:1317/staking/proposer/<n> \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/json' \
  -H 'postman-token: 20244272-9c28-fcc9-43f8-12274a7567c1'

Get checkpoint in buffer

curl -X GET \
  http://localhost:1317/checkpoint/buffer \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/json' \
  -H 'postman-token: e93a16fa-30d3-e446-9d83-68dc2585cc7b'

Get number of checkpoints received

curl -X GET \
  http://localhost:1317/checkpoint/count \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/json' \
  -H 'postman-token: 8e1a8cfc-ed50-64eb-d28e-cfe36998ccdb'

Get checkpoint details per header index (obtained from root-chain contract)

curl -X GET \
  http://localhost:1317/checkpoint/headers/20000 \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/json' \
  -H 'postman-token: 1978b961-01a4-6f5d-620a-4aaad010822d'

Get last no-ack time

curl -X GET \
  http://localhost:1317/checkpoint/last-no-ack \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/json' \
  -H 'postman-token: 7ee0ab9c-ed2b-3189-3271-333ab96c2398'

Staking Related Endpoints

Add new validator

curl -X POST \
  http://localhost:1317/staking/validators \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/json' \
  -H 'postman-token: 7b3bf53f-e812-b6e4-8777-d9dabaf0d2fe' \
  -d '{
	"address":"0xb3a26d246ecccb7430d6e05aadc3e7825dc4a94d",
	"pubkey":"0x04fececa1972967146b10296b3bbbc68b220022ad01d715a769680bbb39b741e20b59e6a2d33c03d979fcd15b2786333ca803ec7e876dbfa74beb4e6267aa839bf",
	"startEpoch":1,
	"endEpoch":0,
	"amount":0
}'

Update Signer

curl -X PUT \
  http://localhost:1317/staking/validators \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/json' \
  -H 'postman-token: cfbd208c-9f13-935e-c760-82d6432d52b5' \
  -d '{
	"address":"0xb3a26d246ecccb7430d6e05aadc3e7825dc4a94d",
	"pubkey":"0x04fececa1972967146b10296b3bbbc68b220022ad01d715a769680bbb39b741e20b59e6a2d33c03d979fcd15b2786333ca803ec7e876dbfa74beb4e6267aa839bf",
	"amount":0
}'

Validator Exit

curl -X DELETE \
  http://localhost:1317/staking/validators \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/json' \
  -H 'postman-token: 17d61f06-f7fe-7e5a-0dae-c79a2dc805fc' \
  -d '{
	"address":"0xb3a26d246ecccb7430d6e05aadc3e7825dc4a94d"
}'

Get Validator Information using Validator Address

curl -X GET \
  http://localhost:1317/staking/validator/0xb3a26d246ecccb7430d6e05aadc3e7825dc4a94d \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/json' \
  -H 'postman-token: 53153d65-6c2d-ddeb-44ae-485dc0abfa42'

Get Current Validator Set

curl -X GET \
  http://localhost:1317/staking/validator-set \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/json' \
  -H 'postman-token: f9fbba89-c993-2ff0-049a-8d0246c4afab'

Note: You must have Ethers in your account while submitting checkpoint.