Skip to content

Commit

Permalink
Merge pull request #76 from HorizenOfficial/development
Browse files Browse the repository at this point in the history
1.1.0 to master
  • Loading branch information
paolocappelletti authored Nov 21, 2023
2 parents 7662e57 + f5ceb66 commit 62a4351
Show file tree
Hide file tree
Showing 72 changed files with 2,212 additions and 52 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
# Changelog
## 1.1.0
* SDK dependency updated to version 0.9.0 (see [SDK changelog](https://github.com/HorizenOfficial/Sidechains-SDK/blob/master/CHANGELOG.md))
* Fork configuration to enable Native<>Real smart contract interoperability
* Added endpoints documentation

## 1.0.1
* SDK dependency updated to version 0.8.1

## 1.0.1
* SDK dependency updated to version 0.8.1
Expand Down
6 changes: 3 additions & 3 deletions bootstraptool/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>io.horizen</groupId>
<artifactId>bootstraptool</artifactId>
<version>1.0.1</version>
<version>1.1.0</version>
<inceptionYear>2023</inceptionYear>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand All @@ -16,12 +16,12 @@
<dependency>
<groupId>io.horizen</groupId>
<artifactId>sidechains-sdk-account_sctools</artifactId>
<version>0.8.1</version>
<version>0.9.0</version>
</dependency>
<dependency>
<groupId>io.horizen</groupId>
<artifactId>eon</artifactId>
<version>1.0.1</version>
<version>1.1.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
Expand Down
75 changes: 75 additions & 0 deletions doc/api/block/best.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
[&lt; EON API Documentation](/doc/api/index.md)
### block/best

Returns best sidechain block and height in active chain

**Parameters**

No parameters

**Example request**

curl -sX POST 'http://127.0.0.1:9085/block/best' -H 'Content-Type: application/json' -H 'accept: application/json'

**Example response**

{
"result" : {
"block" : {
"header" : {
"version" : 2,
"parentId" : "f903f9ad5f5236d55104701ec56d0b8166774faac5850f76fd4f7e01b7a447fa",
"timestamp" : 1687640542,
"forgingStakeInfo" : {
"blockSignPublicKey" : {
"publicKey" : "5e64c00f26a66e43029240a502417cfadee5caebbfc10d32bfe475d1215e80af"
},
"vrfPublicKey" : {
"publicKey" : "5b4293e3e9dd823d512409bd70ec41802466d92420c6ae944ffe7e388532c21200"
},
"stakeAmount" : 100000000
},
"forgingStakeMerklePath" : "0800a5d76ef1d740504e91c5d5c9acf98ddfa2bd92ac24115c82829b9715e39f36b00188cdbc0e54bd0b991a455ec668170ffd898e9b7dea8ea86c030af32afc5b9a0f00039b9b4e818a6a1fcedef08bb70e406bd66708017ae1d6a21afa86c93e3afce4010ac631d99b7a1063dd0a99839c9b76f2b11106eaed0dd4c14a1b96e1d58b103f",
"vrfProof" : {
"vrfProof" : "e650b28a892c853dfdd41ab6633772050d598e83fb551542ab1691baec90092f80ef904e7bcfa1d8985d137c9ba6a9b71e858ea65fb64d1cce0bb13cd38fd4ce373bfef444d762f3c4a3e1a4f3446085502ba5336574fcd537fd6313b28bcef43c"
},
"vrfOutput" : {
"bytes" : "0eced5bf9063ae048a7f699c5a8ea544ab4d2f2d9e8cc13c3a85177bbef33339"
},
"sidechainTransactionsMerkleRootHash" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"mainchainMerkleRootHash" : "0000000000000000000000000000000000000000000000000000000000000000",
"stateRoot" : "cb18d6a817a1b46fb8ade500081b9fe563e940914e2c37fe9c52bedc116b183d",
"receiptsRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"forgerAddress" : {
"address" : "52e2ab93d8d893575c70b72ba59d1da8b7f2c146"
},
"baseFee" : 20000000000,
"gasUsed" : 0,
"gasLimit" : 10000000,
"ommersMerkleRootHash" : "0000000000000000000000000000000000000000000000000000000000000000",
"ommersCumulativeScore" : 0,
"feePaymentsHash" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"logsBloom" : {
"bytes" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
},
"signature" : {
"signature" : "99eb78f2b3356fa6f6f2223b47d03f1c7e1f8a86e7896e195ecf1f1c49dedc85a2c360fea781bcea2bc5d58fde19d3e2f2501959cff206cee891bc654e301700"
},
"id" : "0b8176408f25d94f8a2bfbc2fce233a1f8c23935e79a3a8f6c419bd4a89dfc4e"
},
"sidechainTransactions" : [ ],
"mainchainBlockReferencesData" : [ ],
"mainchainHeaders" : [ ],
"ommers" : [ ],
"timestamp" : 1687640542,
"parentId" : "f903f9ad5f5236d55104701ec56d0b8166774faac5850f76fd4f7e01b7a447fa",
"id" : "0b8176408f25d94f8a2bfbc2fce233a1f8c23935e79a3a8f6c419bd4a89dfc4e",
"size" : 919
},
"height" : 408032
}





25 changes: 25 additions & 0 deletions doc/api/block/currentHeight.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[&lt; EON API Documentation](/doc/api/index.md)
### block/currentHeight

Return here best sidechain block height in active chain

**Parameters**

No parameters

**Example request**

curl -sX POST 'http://127.0.0.1:9085/block/currentHeight' -H 'Content-Type: application/json' -H 'accept: application/json'

**Example response**

{
"result" : {
"height" : 449138
}
}





44 changes: 44 additions & 0 deletions doc/api/block/findBlockInfoById.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
[&lt; EON API Documentation](/doc/api/index.md)
### block/findBlockInfoById

Returns SidechainBlockInfo by its id and if the block is in the active chain or not

**Parameters**

| Name | Type | Required | Description |
| -------- | ------- | ------- | ------- |
| blockId | String | yes | Block ID |

**Example request**

curl -sX POST 'http://127.0.0.1:9085/block/findBlockInfoById' -H 'Content-Type: application/json' -H 'accept: application/json' -d '{"blockId":"f4d983c008a5352c44a188d9a8d8490a85d2777b00c52976848787ef042f89c6"}'

**Example response**

{
"result" : {
"blockInfo" : {
"height" : 329027,
"score" : 329027,
"parentId" : "4c7ad72fcbfaf74eab72fd3e082d14efc0e4479f0e581eb454446f373b311d11",
"timestamp" : 1686155566,
"semanticValidity" : "Valid",
"mainchainHeaderBaseInfo" : [ ],
"mainchainReferenceDataHeaderHashes" : [ ],
"withdrawalEpochInfo" : {
"epoch" : 411,
"lastEpochIndex" : 38
},
"vrfOutputOpt" : {
"bytes" : "04bdfb773c6a8ef6197c588d25323bf9d3a789476fed797d823911e55dbc0729"
},
"lastBlockInPreviousConsensusEpoch" : "868e9f17953d0d3b29f1e49c7bea6969404b51bc2207f1a32e70230a5d71c7f5"
},
"isInActiveChain" : true
}
}





77 changes: 77 additions & 0 deletions doc/api/block/findById.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
[&lt; EON API Documentation](/doc/api/index.md)
### block/findById

Returns the block with the specified ID, together with its height in the blockchain

**Parameters**

| Name | Type | Required | Description |
| -------- | ------- | ------- | ------- |
| blockId | String | yes | Block ID |

**Example request**

curl -sX POST 'http://127.0.0.1:9085/block/findById' -H 'Content-Type: application/json' -H 'accept: application/json' -d '{"blockId":"f4d983c008a5352c44a188d9a8d8490a85d2777b00c52976848787ef042f89c6"}'

**Example response**

{
"result" : {
"blockHex" : "024c7ad72fcbfaf74eab72fd3e082d14efc0e4479f0e581eb454446f373b311d11dcc485c80cbbb1c23b424a4529f68bc3caceac208140bd053685bab6c6e2fe67f7a7efd73370ec662c19fcab36d755f81cf4b08b0fd23cee3578358f49d19540660a40320c808084af5f08010d9f9e9e8f56a6ec5418304652ad96890b37bca65310e7a32456a75824873b0f00f9c6e8a22d2d401dbf2c97751bb3e33b1f9171cba5978a4cfee0c04fbf8b4ad4016d669978445d55e67aa9d0f19a1d92f7b18415f45b16b9d748ecadec29bdf3fe010ac631d99b7a1063dd0a99839c9b76f2b11106eaed0dd4c14a1b96e1d58b103f14f5db1650cf20fa98f0736781c1edc70afa4b182fa027a8a62c97770ea4271f001c3e39a850a74aa351dc323f921ba215122389027dacaa3b79c030cf6c90582cbc68f594067f0ac55e4292e936732059b727763e3e46d806d62f86227b1fc31f04bdfb773c6a8ef6197c588d25323bf9d3a789476fed797d823911e55dbc072956e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421000000000000000000000000000000000000000000000000000000000000000072b4a0894e9f54c3ac21961e00d40d029cb47e433d349c28de8de779c831a36456e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b42129d52220a66ab8ee0547b4f3312c9448aa645f920a04a817c8000200080098968000000000000000000000000000000000000000000000000000000000000000000056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b42100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c1e8339e025433b9d08f797e199339d86bdf2ef933a432b9b44f999a924e9de91bd76bf605d467874af9d163cd9b63aa467ed89a58b8e625b1a10d321567b30c00000000",
"block" : {
"header" : {
"version" : 2,
"parentId" : "4c7ad72fcbfaf74eab72fd3e082d14efc0e4479f0e581eb454446f373b311d11",
"timestamp" : 1686155566,
"forgingStakeInfo" : {
"blockSignPublicKey" : {
"publicKey" : "bbb1c23b424a4529f68bc3caceac208140bd053685bab6c6e2fe67f7a7efd733"
},
"vrfPublicKey" : {
"publicKey" : "70ec662c19fcab36d755f81cf4b08b0fd23cee3578358f49d19540660a40320c80"
},
"stakeAmount" : 100000000
},
"forgingStakeMerklePath" : "08010d9f9e9e8f56a6ec5418304652ad96890b37bca65310e7a32456a75824873b0f00f9c6e8a22d2d401dbf2c97751bb3e33b1f9171cba5978a4cfee0c04fbf8b4ad4016d669978445d55e67aa9d0f19a1d92f7b18415f45b16b9d748ecadec29bdf3fe010ac631d99b7a1063dd0a99839c9b76f2b11106eaed0dd4c14a1b96e1d58b103f",
"vrfProof" : {
"vrfProof" : "14f5db1650cf20fa98f0736781c1edc70afa4b182fa027a8a62c97770ea4271f001c3e39a850a74aa351dc323f921ba215122389027dacaa3b79c030cf6c90582cbc68f594067f0ac55e4292e936732059b727763e3e46d806d62f86227b1fc31f"
},
"vrfOutput" : {
"bytes" : "04bdfb773c6a8ef6197c588d25323bf9d3a789476fed797d823911e55dbc0729"
},
"sidechainTransactionsMerkleRootHash" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"mainchainMerkleRootHash" : "0000000000000000000000000000000000000000000000000000000000000000",
"stateRoot" : "72b4a0894e9f54c3ac21961e00d40d029cb47e433d349c28de8de779c831a364",
"receiptsRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"forgerAddress" : {
"address" : "29d52220a66ab8ee0547b4f3312c9448aa645f92"
},
"baseFee" : 20000000000,
"gasUsed" : 0,
"gasLimit" : 10000000,
"ommersMerkleRootHash" : "0000000000000000000000000000000000000000000000000000000000000000",
"ommersCumulativeScore" : 0,
"feePaymentsHash" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"logsBloom" : {
"bytes" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
},
"signature" : {
"signature" : "c1e8339e025433b9d08f797e199339d86bdf2ef933a432b9b44f999a924e9de91bd76bf605d467874af9d163cd9b63aa467ed89a58b8e625b1a10d321567b30c"
},
"id" : "f4d983c008a5352c44a188d9a8d8490a85d2777b00c52976848787ef042f89c6"
},
"sidechainTransactions" : [ ],
"mainchainBlockReferencesData" : [ ],
"mainchainHeaders" : [ ],
"ommers" : [ ],
"timestamp" : 1686155566,
"parentId" : "4c7ad72fcbfaf74eab72fd3e082d14efc0e4479f0e581eb454446f373b311d11",
"id" : "f4d983c008a5352c44a188d9a8d8490a85d2777b00c52976848787ef042f89c6",
"size" : 919
},
"height" : 329027
}




27 changes: 27 additions & 0 deletions doc/api/block/findIdByHeight.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[&lt; EON API Documentation](/doc/api/index.md)
### block/findIdByHeight

Returns a sidechain block Id by its height in the active chain

**Parameters**

| Name | Type | Required | Description |
| -------- | ------- | ------- | ------- |
| height | int | yes | Height in the blockchain |

**Example request**

curl -sX POST 'http://127.0.0.1:9085/block/findIdByHeight' -H 'Content-Type: application/json' -H 'accept: application/json' -d '{"height":"100"}'

**Example response**

{
"result" : {
"blockId" : "56dbfa664a959c5d0ab79ecf8eb25b5f87f1b102f653608c3d9d05b4a6315f04"
}






32 changes: 32 additions & 0 deletions doc/api/block/findLastIds.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[&lt; EON API Documentation](/doc/api/index.md)
### block/findLastIds

Returns an array with the ids of the last x blocks

**Parameters**

| Name | Type | Required | Description |
| -------- | ------- | ------- | ------- |
| number | int | yes | Retrieves the last x number of block ids |

**Example request**

curl -sX POST 'http://127.0.0.1:9085/block/findLastIds' -H 'Content-Type: application/json' -H 'accept: application/json' -d '{"number":"5"}'

**Example response**

{
"result" : {
"lastBlockIds" :
[ "fe9294509662cef1a781086af1e3ab2f7252f334554be70404105763f3a0cfe0",
"38b5b6c4a5d8f74b5a80ad01cf3e2880af9ca648f3b6f88f0b38b2a2f038d9c3",
"6693ade391f6ef16ccc20e7e8ea2214c6f1a451dd1c0cd4fba1f4d7086ce126c",
"d0fcf4b95e28e43181477796c04158f0853449cb65cb6c6b4623e2674f44bd4a",
"0fd13ee2e29b1f9de094268aafe0acb5243948453b4dbac499417d6cb48348eb"
]
}





35 changes: 35 additions & 0 deletions doc/api/block/forgingInfo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[&lt; EON API Documentation](/doc/api/index.md)
### block/forgingInfo

Returns forging info, including:
- conensus slots epoch lengh and number of slots in epoch
- current epoch and slot based on best block in the history and based on the current clock
- forging enabled (yes/no)

**Parameters**

No parameters

**Example request**

curl -sX POST 'http://127.0.0.1:9085/block/forgingInfo' -H 'Content-Type: application/json' -H 'accept: application/json'

**Example response**

{
"result" : {
"consensusSecondsInSlot" : 12,
"consensusSlotsInEpoch" : 720,
"bestBlockEpochNumber" : 1079,
"bestBlockSlotNumber" : 300,
"currentEpochNumber" : 1774,
"currentSlotNumber" : 8922,
"forgingEnabled" : false
}
}






29 changes: 29 additions & 0 deletions doc/api/block/generate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[&lt; EON API Documentation](/doc/api/index.md)
### block/generate

Tries to generate a new block by epoch and slot number. Returns id of generated sidechain block.\
**This endpoint can be used only in REGTEST mode, to manually force block production**

**Parameters**

| Name | Type | Required | Description |
| -------- | ------- | ------- | ------- |
| epochNumber | int | yes | Epoch Number |
| slotNumber | int | yes | Slot number ID |

**Example request**

curl -sX POST 'http://127.0.0.1:9085/block/generate' -H 'Content-Type: application/json' -H 'accept: application/json' -d '{"epochNumber":"1", "slotNumber":"100"}'

**Example response**

{
"result": {
"blockId": "7f25d35aadae65062033757e5049e44728128b7405ff739070e91d753b419094"
}
}





Loading

0 comments on commit 62a4351

Please sign in to comment.