Skip to content
Doris Chia-ching Lin edited this page Dec 5, 2020 · 15 revisions

API Contract

GET api/load-blocks

response
{
 [
  {
    data: "placeholder",
    previousHash: "0",
    hash: "osrrtme",
    nonce: 0,
          timeStamp: "",
          workProven: false,
  },
 ]    
}

PUT /api/update-block

request-body
{
  "data":<str>
  "hash":<str>
}
response
{
 [
  {
     "previousHash": <str>
     "hash":<str>
     "data": <str>
     "nonce": <int>
     "timeStamp":"string"
     workProven: <bool>,
  }
 ]    
}

POST api/create-block

request-body
{
  data:<str>
}
response
{
 [
  {
     "previousHash": <str>
     "hash":<str>
     "data": <str>
     "nonce": <int>
     "timeStamp":"string"
     workProven: <bool>,
  }
 ]    
}

PUT /api/mine-block

request-body
{
  "hash":<str>
}
response
{
 [
  {
     "previousHash": <str>
     "hash":<str>
     "data": <str>
     "nonce": <int>
     "timeStamp":"string"
     workProven: <bool>,
  },
  ...
 ]    
}

Clone this wiki locally