From a3167cf109962148ecc8c76e7928c6753a5f6b95 Mon Sep 17 00:00:00 2001 From: paolocappelletti Date: Thu, 28 Sep 2023 10:31:35 +0200 Subject: [PATCH 01/27] Bump version for storage version fix --- CHANGELOG.md | 2 ++ bootstraptool/pom.xml | 6 +++--- node/pom.xml | 4 ++-- pom.xml | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a2353a..86385b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,6 @@ # Changelog +## 1.0.1-SNAPSHOT +* SDK dependency updated to version 0.8.1 ## 1.0.0-SNAPSHOT * SDK dependency updated to version 0.8.0 diff --git a/bootstraptool/pom.xml b/bootstraptool/pom.xml index 45908f6..6295957 100644 --- a/bootstraptool/pom.xml +++ b/bootstraptool/pom.xml @@ -3,7 +3,7 @@ 4.0.0 io.horizen bootstraptool - 1.0.0-SNAPSHOT + 1.0.1-SNAPSHOT 2023 UTF-8 @@ -16,12 +16,12 @@ io.horizen sidechains-sdk-account_sctools - 0.8.0-SNAPSHOT + 0.8.1-SNAPSHOT io.horizen eon - 1.0.0-SNAPSHOT + 1.0.1-SNAPSHOT compile diff --git a/node/pom.xml b/node/pom.xml index bf6f477..da2092a 100644 --- a/node/pom.xml +++ b/node/pom.xml @@ -3,7 +3,7 @@ 4.0.0 io.horizen eon - 1.0.0-SNAPSHOT + 1.0.1-SNAPSHOT 2023 UTF-8 @@ -11,7 +11,7 @@ 11 3.8.1 3.1.1 - 0.8.0-SNAPSHOT + 0.8.1-SNAPSHOT diff --git a/pom.xml b/pom.xml index 8d65b65..36a8dcb 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 io.horizen eonproject - 1.0.0-SNAPSHOT + 1.0.1-SNAPSHOT pom 2023 From ba41cb9a71a6d74d9dad344a7ecd1d7c739d9d92 Mon Sep 17 00:00:00 2001 From: paolocappelletti Date: Tue, 10 Oct 2023 09:04:59 +0200 Subject: [PATCH 02/27] bump version to 1.1.0-snapshot --- CHANGELOG.md | 5 ++++- bootstraptool/pom.xml | 6 +++--- node/pom.xml | 4 ++-- pom.xml | 2 +- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b69558a..d207c98 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog -## 1.0.1-SNAPSHOT +## 1.1.0-SNAPSHOT +* SDK dependency updated to version 0.9.0 + +## 1.0.1 * SDK dependency updated to version 0.8.1 ## 1.0.0 diff --git a/bootstraptool/pom.xml b/bootstraptool/pom.xml index 6295957..c447697 100644 --- a/bootstraptool/pom.xml +++ b/bootstraptool/pom.xml @@ -3,7 +3,7 @@ 4.0.0 io.horizen bootstraptool - 1.0.1-SNAPSHOT + 1.1.0-SNAPSHOT 2023 UTF-8 @@ -16,12 +16,12 @@ io.horizen sidechains-sdk-account_sctools - 0.8.1-SNAPSHOT + 0.9.0-SNAPSHOT io.horizen eon - 1.0.1-SNAPSHOT + 1.1.0-SNAPSHOT compile diff --git a/node/pom.xml b/node/pom.xml index da2092a..23878e3 100644 --- a/node/pom.xml +++ b/node/pom.xml @@ -3,7 +3,7 @@ 4.0.0 io.horizen eon - 1.0.1-SNAPSHOT + 1.1.0-SNAPSHOT 2023 UTF-8 @@ -11,7 +11,7 @@ 11 3.8.1 3.1.1 - 0.8.1-SNAPSHOT + 0.9.0-SNAPSHOT diff --git a/pom.xml b/pom.xml index 36a8dcb..c51040d 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 io.horizen eonproject - 1.0.1-SNAPSHOT + 1.1.0-SNAPSHOT pom 2023 From 1b606677489a085d43765158cbbb168cb75987ba Mon Sep 17 00:00:00 2001 From: Luigi Varriale Date: Wed, 11 Oct 2023 14:21:28 +0200 Subject: [PATCH 03/27] first fix draft --- dockerfiles/evmapp/entrypoint.sh | 36 +++++++++++++++++++------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/dockerfiles/evmapp/entrypoint.sh b/dockerfiles/evmapp/entrypoint.sh index 2d51716..870bc66 100755 --- a/dockerfiles/evmapp/entrypoint.sh +++ b/dockerfiles/evmapp/entrypoint.sh @@ -115,16 +115,18 @@ if [ "${SCNODE_CERT_SIGNING_ENABLED:-}" = "true" ]; then exit 1 fi - if [ "${SCNODE_REMOTE_KEY_MANAGER_ENABLED:-}" = "true" ] && [ -z "${SCNODE_REMOTE_KEY_MANAGER_ADDRESS:-}" ]; then - echo "Error: When SCNODE_CERT_SIGNING_ENABLED=true and SCNODE_REMOTE_KEY_MANAGER_ENABLED=true SCNODE_REMOTE_KEY_MANAGER_ADDRESS needs to be set." - sleep 5 - exit 1 - fi + # Checking all REMOTE_KEY_MANAGER_ENABLED parameters when SCNODE_REMOTE_KEY_MANAGER_ENABLED=true + if [ "${SCNODE_REMOTE_KEY_MANAGER_ENABLED:-}" = "true" ]; then + # Checking KEY_MANAGER_REQUEST_TIMEOUT + if [ -z "${SCNODE_REMOTE_KEY_MANAGER_REQUEST_TIMEOUT:-}" ]; then + echo "Error: When SCNODE_CERT_SIGNING_ENABLED=true and SCNODE_REMOTE_KEY_MANAGER_ENABLED=true, 'SCNODE_REMOTE_KEY_MANAGER_REQUEST_TIMEOUT' variable is required to be set." + sleep 5 + exit 1 + else + REMOTE_KEY_MANAGER_REQUEST_TIMEOUT="$(echo -en "\n requestTimeout = ${SCNODE_REMOTE_KEY_MANAGER_REQUEST_TIMEOUT}")" + export REMOTE_KEY_MANAGER_REQUEST_TIMEOUT + fi - if [ "${SCNODE_REMOTE_KEY_MANAGER_ENABLED:-}" = "true" ] && [ -z "${SCNODE_REMOTE_KEY_MANAGER_REQUEST_TIMEOUT:-}" ]; then - echo "Error: When SCNODE_CERT_SIGNING_ENABLED=true and SCNODE_REMOTE_KEY_MANAGER_ENABLED=true SCNODE_REMOTE_KEY_MANAGER_REQUEST_TIMEOUT needs to be set." - sleep 5 - exit 1 elif [ "${SCNODE_REMOTE_KEY_MANAGER_ENABLED:-}" = "true" ] && [ -n "${SCNODE_REMOTE_KEY_MANAGER_REQUEST_TIMEOUT:-}" ]; then # setting SCNODE_REMOTE_KEY_MANAGER_REQUEST_TIMEOUT if provided REMOTE_KEY_MANAGER_REQUEST_TIMEOUT="" @@ -132,17 +134,22 @@ if [ "${SCNODE_CERT_SIGNING_ENABLED:-}" = "true" ]; then export REMOTE_KEY_MANAGER_REQUEST_TIMEOUT fi - if [ "${SCNODE_REMOTE_KEY_MANAGER_ENABLED:-}" = "true" ] && [ -z "${SCNODE_REMOTE_KEY_MANAGER_PARALLEL_REQUESTS:-}" ]; then - echo "Error: When SCNODE_CERT_SIGNING_ENABLED=true and SCNODE_REMOTE_KEY_MANAGER_ENABLED=true SCNODE_REMOTE_KEY_MANAGER_PARALLEL_REQUESTS needs to be set." - sleep 5 - exit 1 + # Checking KEY_MANAGER_PARALLEL_REQUESTS + if [ -z "${SCNODE_REMOTE_KEY_MANAGER_PARALLEL_REQUESTS:-}" ]; then + echo "Error: When SCNODE_CERT_SIGNING_ENABLED=true and SCNODE_REMOTE_KEY_MANAGER_ENABLED=true, 'SCNODE_REMOTE_KEY_MANAGER_PARALLEL_REQUESTS' variable is required to be set." + sleep 5 + exit 1 + else + REMOTE_KEY_MANAGER_PARALLEL_REQUESTS="$(echo -en "\n numOfParallelRequests = ${SCNODE_REMOTE_KEY_MANAGER_PARALLEL_REQUESTS}")" + export REMOTE_KEY_MANAGER_PARALLEL_REQUESTS + fi + if [ "${SCNODE_REMOTE_KEY_MANAGER_ENABLED:-}" = "true" ] && [ -n "${SCNODE_REMOTE_KEY_MANAGER_PARALLEL_REQUESTS:-}" ]; then # setting SCNODE_REMOTE_KEY_MANAGER_PARALLEL_REQUESTS if provided REMOTE_KEY_MANAGER_PARALLEL_REQUESTS="" REMOTE_KEY_MANAGER_PARALLEL_REQUESTS="$(echo -en "\n numOfParallelRequests = ${SCNODE_REMOTE_KEY_MANAGER_PARALLEL_REQUESTS}")" export REMOTE_KEY_MANAGER_PARALLEL_REQUESTS fi - fi # Checking REMOTE_KEY_MANAGER_ADDRESS and its connectivity if [ -z "${SCNODE_REMOTE_KEY_MANAGER_ADDRESS:-}" ]; then @@ -167,6 +174,7 @@ if [ "${SCNODE_CERT_SIGNING_ENABLED:-}" = "true" ]; then fi fi + if [ "${SCNODE_FORGER_ENABLED:-}" = "true" ] || [ "${SCNODE_CERT_SUBMITTER_ENABLED:-}" = "true" ]; then if [ -z "${SCNODE_WS_ZEN_FQDN:-}" ]; then echo "Error: Environment variable SCNODE_WS_ZEN_FQDN is required when SCNODE_FORGER_ENABLED=true or SCNODE_CERT_SUBMITTER_ENABLED=true." From c2a59e09edfe76efec7f1f570e1f045e0fbfbef4 Mon Sep 17 00:00:00 2001 From: Luigi Varriale Date: Wed, 11 Oct 2023 15:18:27 +0200 Subject: [PATCH 04/27] fix typo --- dockerfiles/evmapp/entrypoint.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dockerfiles/evmapp/entrypoint.sh b/dockerfiles/evmapp/entrypoint.sh index 870bc66..7235829 100755 --- a/dockerfiles/evmapp/entrypoint.sh +++ b/dockerfiles/evmapp/entrypoint.sh @@ -127,7 +127,7 @@ if [ "${SCNODE_CERT_SIGNING_ENABLED:-}" = "true" ]; then export REMOTE_KEY_MANAGER_REQUEST_TIMEOUT fi - elif [ "${SCNODE_REMOTE_KEY_MANAGER_ENABLED:-}" = "true" ] && [ -n "${SCNODE_REMOTE_KEY_MANAGER_REQUEST_TIMEOUT:-}" ]; then + if [ "${SCNODE_REMOTE_KEY_MANAGER_ENABLED:-}" = "true" ] && [ -n "${SCNODE_REMOTE_KEY_MANAGER_REQUEST_TIMEOUT:-}" ]; then # setting SCNODE_REMOTE_KEY_MANAGER_REQUEST_TIMEOUT if provided REMOTE_KEY_MANAGER_REQUEST_TIMEOUT="" REMOTE_KEY_MANAGER_REQUEST_TIMEOUT="$(echo -en "\n requestTimeout = ${SCNODE_REMOTE_KEY_MANAGER_REQUEST_TIMEOUT}")" @@ -171,7 +171,8 @@ if [ "${SCNODE_CERT_SIGNING_ENABLED:-}" = "true" ]; then exit 1 fi done - fi + fi + fi fi From 42c42e43f3a72627e93102f6315c92b0931d6dba Mon Sep 17 00:00:00 2001 From: Yuri Sibirski <31861444+ysibirski@users.noreply.github.com> Date: Wed, 11 Oct 2023 16:54:11 -0400 Subject: [PATCH 05/27] Entrypoint script more fixes (#70) --- dockerfiles/evmapp/entrypoint.sh | 54 ++++++++++++-------------------- 1 file changed, 20 insertions(+), 34 deletions(-) diff --git a/dockerfiles/evmapp/entrypoint.sh b/dockerfiles/evmapp/entrypoint.sh index 7235829..932db42 100755 --- a/dockerfiles/evmapp/entrypoint.sh +++ b/dockerfiles/evmapp/entrypoint.sh @@ -127,14 +127,7 @@ if [ "${SCNODE_CERT_SIGNING_ENABLED:-}" = "true" ]; then export REMOTE_KEY_MANAGER_REQUEST_TIMEOUT fi - if [ "${SCNODE_REMOTE_KEY_MANAGER_ENABLED:-}" = "true" ] && [ -n "${SCNODE_REMOTE_KEY_MANAGER_REQUEST_TIMEOUT:-}" ]; then - # setting SCNODE_REMOTE_KEY_MANAGER_REQUEST_TIMEOUT if provided - REMOTE_KEY_MANAGER_REQUEST_TIMEOUT="" - REMOTE_KEY_MANAGER_REQUEST_TIMEOUT="$(echo -en "\n requestTimeout = ${SCNODE_REMOTE_KEY_MANAGER_REQUEST_TIMEOUT}")" - export REMOTE_KEY_MANAGER_REQUEST_TIMEOUT - fi - - # Checking KEY_MANAGER_PARALLEL_REQUESTS + # Checking KEY_MANAGER_PARALLEL_REQUESTS if [ -z "${SCNODE_REMOTE_KEY_MANAGER_PARALLEL_REQUESTS:-}" ]; then echo "Error: When SCNODE_CERT_SIGNING_ENABLED=true and SCNODE_REMOTE_KEY_MANAGER_ENABLED=true, 'SCNODE_REMOTE_KEY_MANAGER_PARALLEL_REQUESTS' variable is required to be set." sleep 5 @@ -144,33 +137,26 @@ if [ "${SCNODE_CERT_SIGNING_ENABLED:-}" = "true" ]; then export REMOTE_KEY_MANAGER_PARALLEL_REQUESTS fi - if [ "${SCNODE_REMOTE_KEY_MANAGER_ENABLED:-}" = "true" ] && [ -n "${SCNODE_REMOTE_KEY_MANAGER_PARALLEL_REQUESTS:-}" ]; then - # setting SCNODE_REMOTE_KEY_MANAGER_PARALLEL_REQUESTS if provided - REMOTE_KEY_MANAGER_PARALLEL_REQUESTS="" - REMOTE_KEY_MANAGER_PARALLEL_REQUESTS="$(echo -en "\n numOfParallelRequests = ${SCNODE_REMOTE_KEY_MANAGER_PARALLEL_REQUESTS}")" - export REMOTE_KEY_MANAGER_PARALLEL_REQUESTS - fi - - # Checking REMOTE_KEY_MANAGER_ADDRESS and its connectivity - if [ -z "${SCNODE_REMOTE_KEY_MANAGER_ADDRESS:-}" ]; then - echo "Error: When SCNODE_CERT_SIGNING_ENABLED=true and SCNODE_REMOTE_KEY_MANAGER_ENABLED=true SCNODE_REMOTE_KEY_MANAGER_ADDRESS needs to be set." - sleep 5 - exit 1 - else - host="$(cut -d'/' -f 3 <<< "${SCNODE_REMOTE_KEY_MANAGER_ADDRESS}" | cut -d':' -f 1)" - port="$(cut -d ':' -f 3 <<< "${SCNODE_REMOTE_KEY_MANAGER_ADDRESS}")" - port="${port:-80}" - # make sure host and port are reachable - i=0 - while ! nc -z "${host}" "${port}" &> /dev/null; do - echo "Waiting for '${SCNODE_REMOTE_KEY_MANAGER_ADDRESS}' endpoint to be ready." + # Checking REMOTE_KEY_MANAGER_ADDRESS and its connectivity + if [ -z "${SCNODE_REMOTE_KEY_MANAGER_ADDRESS:-}" ]; then + echo "Error: When SCNODE_CERT_SIGNING_ENABLED=true and SCNODE_REMOTE_KEY_MANAGER_ENABLED=true SCNODE_REMOTE_KEY_MANAGER_ADDRESS needs to be set." sleep 5 - i="$((i+1))" - if [ "$i" -gt 48 ]; then - echo "Error: '${SCNODE_REMOTE_KEY_MANAGER_ADDRESS}' endpoint is not ready after 4 minutes." - exit 1 - fi - done + exit 1 + else + host="$(cut -d'/' -f 3 <<< "${SCNODE_REMOTE_KEY_MANAGER_ADDRESS}" | cut -d':' -f 1)" + port="$(cut -d ':' -f 3 <<< "${SCNODE_REMOTE_KEY_MANAGER_ADDRESS}")" + port="${port:-80}" + # make sure host and port are reachable + i=0 + while ! nc -z "${host}" "${port}" &> /dev/null; do + echo "Waiting for '${SCNODE_REMOTE_KEY_MANAGER_ADDRESS}' endpoint to be ready." + sleep 5 + i="$((i+1))" + if [ "$i" -gt 48 ]; then + echo "Error: '${SCNODE_REMOTE_KEY_MANAGER_ADDRESS}' endpoint is not ready after 4 minutes." + exit 1 + fi + done fi fi fi From 9dbf0ef435cee0f9fa129237ce32ddab0ae3e012 Mon Sep 17 00:00:00 2001 From: paolocappelletti <56390199+paolocappelletti@users.noreply.github.com> Date: Wed, 18 Oct 2023 14:06:53 +0200 Subject: [PATCH 06/27] removed 1.0.1 from CHANGELOG --- CHANGELOG.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d207c98..c29461c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,9 +2,6 @@ ## 1.1.0-SNAPSHOT * SDK dependency updated to version 0.9.0 -## 1.0.1 -* SDK dependency updated to version 0.8.1 - ## 1.0.0 * SDK dependency updated to version 0.8.0 * Fork configuration to enable decentralized governance (ZenDao) and change consensus parameters (consensus epoch slot time and lenght, acrive slot coefficient) From 8ad849b26e457b97a72c44bab23a80464fc68352 Mon Sep 17 00:00:00 2001 From: paolocappelletti Date: Tue, 7 Nov 2023 17:47:04 +0100 Subject: [PATCH 07/27] fork config un pregobi + release notes --- CHANGELOG.md | 3 +- doc/index.md | 3 +- doc/release/1.1.0.md | 8 ++++ .../io/horizen/eon/EonForkConfigurator.java | 37 ++++++++++++++++++- 4 files changed, 48 insertions(+), 3 deletions(-) create mode 100644 doc/release/1.1.0.md diff --git a/CHANGELOG.md b/CHANGELOG.md index c29461c..0c22d2a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog -## 1.1.0-SNAPSHOT +## 1.1.0 * SDK dependency updated to version 0.9.0 +* Fork configuration to enable Native<>Real smart contract interoperability ## 1.0.0 * SDK dependency updated to version 0.8.0 diff --git a/doc/index.md b/doc/index.md index 2638e57..d62199b 100644 --- a/doc/index.md +++ b/doc/index.md @@ -1,3 +1,4 @@ # EON Release Notes -## Version [1.0.0](/doc/release/1.0.0.md) \ No newline at end of file +## Version [1.1.0](/doc/release/1.1.0.md) +## Version [1.0.0](/doc/release/1.0.0.md) diff --git a/doc/release/1.1.0.md b/doc/release/1.1.0.md new file mode 100644 index 0000000..02406ea --- /dev/null +++ b/doc/release/1.1.0.md @@ -0,0 +1,8 @@ +# Release notes - version 1.1.0 +--- + +## Notes about new/updated Features +The 1.1.0 version has been updated to the 0.9.0 SDK version, which introduces the support to Native<>Real smart contract interoperability: refer to [SDK release notes](https://github.com/HorizenOfficial/Sidechains-SDK/tree/master/doc/release/0.9.0.md) for a detailed explanation. + +--- +Full [Changelog](/CHANGELOG.md) available. \ No newline at end of file diff --git a/node/src/main/java/io/horizen/eon/EonForkConfigurator.java b/node/src/main/java/io/horizen/eon/EonForkConfigurator.java index 041dabd..423c7d4 100644 --- a/node/src/main/java/io/horizen/eon/EonForkConfigurator.java +++ b/node/src/main/java/io/horizen/eon/EonForkConfigurator.java @@ -1,5 +1,6 @@ package io.horizen.eon; +import io.horizen.account.fork.ContractInteroperabilityFork; import io.horizen.account.fork.GasFeeFork; import io.horizen.account.fork.ZenDAOFork; import io.horizen.fork.*; @@ -25,6 +26,14 @@ public class EonForkConfigurator extends ForkConfigurator { static final int F2_TESTNET_FORKPOINT = 800; static final int F2_MAINNET_FORKPOINT = 1109; ///estimated start: Thu 19 Oct 2023 15:55 Milano time + //EON fork 3: Native <> Real smart contract interoperability + static final int F3_REGTEST_FORKPOINT = 7; + static final int F3_PREGOBI_TESTNET_FORKPOINT = 1815; //estimated start: Mon 13 Nov 2023 13:01 Milano time + static final int F3_GOBI_TESTNET_FORKPOINT = 500000000; ///TODO: to be estimated + static final int F3_TESTNET_FORKPOINT = 500000000; //not used + static final int F3_MAINNET_FORKPOINT = 500000000; ///TODO: to be estimated + + private final SidechainForkConsensusEpoch mandatorySidechainFork1; @@ -72,7 +81,15 @@ public EonForkConfigurator(Optional sidechainId) { F2_REGTEST_FORKPOINT, getFork2TestnetActivation(sidechainId), F2_MAINNET_FORKPOINT), - activeSlotCoefficientFork) + activeSlotCoefficientFork), + + new Pair<>( + new SidechainForkConsensusEpoch( + F3_REGTEST_FORKPOINT, + getFork3TestnetActivation(sidechainId), + F3_MAINNET_FORKPOINT), + new ContractInteroperabilityFork(true) + ) ); mandatorySidechainFork1 = new SidechainForkConsensusEpoch(0, 0, 0); @@ -114,6 +131,24 @@ private int getFork2TestnetActivation(Optional sidechainId){ } } + private int getFork3TestnetActivation(Optional sidechainId){ + if (sidechainId.isPresent()){ + switch (sidechainId.get()){ + case ApplicationConstants.PREGOBI_SIDECHAINID: + //Pre-Gobi (parallel testnet) fork configuration + return F3_PREGOBI_TESTNET_FORKPOINT; + case ApplicationConstants.GOBI_SIDECHAINID: + //Gobi (official testnet) fork configuration + return F3_GOBI_TESTNET_FORKPOINT; + default: + //any other testnet + return F3_TESTNET_FORKPOINT; + } + } else { + return F3_TESTNET_FORKPOINT; + } + } + @Override public SidechainForkConsensusEpoch fork1activation() { return mandatorySidechainFork1; From d8fd34e5521b2fab820be2ac5ea0c4f82f4298dd Mon Sep 17 00:00:00 2001 From: paolocappelletti Date: Tue, 24 Oct 2023 10:45:50 +0200 Subject: [PATCH 08/27] endpoints documentation - first part --- doc/api/block/best.md | 75 ++++++++++++++++ doc/api/block/currentHeight.md | 25 ++++++ doc/api/block/findBlockInfoById.md | 44 ++++++++++ doc/api/block/findById.md | 77 +++++++++++++++++ doc/api/block/findIdByHeight.md | 27 ++++++ doc/api/block/findLastIds.md | 32 +++++++ doc/api/block/forgingInfo.md | 35 ++++++++ doc/api/block/generate.md | 29 +++++++ doc/api/block/getFeePayments.md | 31 +++++++ doc/api/block/getForwardTransfers.md | 31 +++++++ doc/api/block/startForging.md | 23 +++++ doc/api/block/stopForging.md | 23 +++++ doc/api/index.md | 85 +++++++++++++++++++ .../mainchain/bestBlockReferenceInfo copy.md | 26 ++++++ doc/api/mainchain/bestBlockReferenceInfo.md | 26 ++++++ doc/api/mainchain/blockReferenceByHash.md | 24 ++++++ doc/api/mainchain/blockReferenceInfoBy.md | 26 ++++++ .../mainchain/genesisBlockReferenceInfo.md | 26 ++++++ .../mainchain/mainchainHeaderInfoByHash.md | 29 +++++++ doc/api/node/addToBlacklist.md | 27 ++++++ doc/api/node/allPeers.md | 42 +++++++++ doc/api/node/blacklistedPeers.md | 28 ++++++ doc/api/node/connect.md | 28 ++++++ doc/api/node/connectedPeers.md | 45 ++++++++++ doc/api/node/disconnect.md | 28 ++++++ doc/api/node/info.md | 53 ++++++++++++ doc/api/node/peer.md | 35 ++++++++ doc/api/node/removeFromBlacklist.md | 27 ++++++ doc/api/node/sidechainId.md | 26 ++++++ doc/api/node/stop.md | 23 +++++ doc/api/node/storageVersions.md | 31 +++++++ doc/index.md | 4 + 32 files changed, 1091 insertions(+) create mode 100644 doc/api/block/best.md create mode 100644 doc/api/block/currentHeight.md create mode 100644 doc/api/block/findBlockInfoById.md create mode 100644 doc/api/block/findById.md create mode 100644 doc/api/block/findIdByHeight.md create mode 100644 doc/api/block/findLastIds.md create mode 100644 doc/api/block/forgingInfo.md create mode 100644 doc/api/block/generate.md create mode 100644 doc/api/block/getFeePayments.md create mode 100644 doc/api/block/getForwardTransfers.md create mode 100644 doc/api/block/startForging.md create mode 100644 doc/api/block/stopForging.md create mode 100644 doc/api/index.md create mode 100644 doc/api/mainchain/bestBlockReferenceInfo copy.md create mode 100644 doc/api/mainchain/bestBlockReferenceInfo.md create mode 100644 doc/api/mainchain/blockReferenceByHash.md create mode 100644 doc/api/mainchain/blockReferenceInfoBy.md create mode 100644 doc/api/mainchain/genesisBlockReferenceInfo.md create mode 100644 doc/api/mainchain/mainchainHeaderInfoByHash.md create mode 100644 doc/api/node/addToBlacklist.md create mode 100644 doc/api/node/allPeers.md create mode 100644 doc/api/node/blacklistedPeers.md create mode 100644 doc/api/node/connect.md create mode 100644 doc/api/node/connectedPeers.md create mode 100644 doc/api/node/disconnect.md create mode 100644 doc/api/node/info.md create mode 100644 doc/api/node/peer.md create mode 100644 doc/api/node/removeFromBlacklist.md create mode 100644 doc/api/node/sidechainId.md create mode 100644 doc/api/node/stop.md create mode 100644 doc/api/node/storageVersions.md diff --git a/doc/api/block/best.md b/doc/api/block/best.md new file mode 100644 index 0000000..747e1b0 --- /dev/null +++ b/doc/api/block/best.md @@ -0,0 +1,75 @@ +[< EON API Documentation](/doc/api/index.md) +### block/best + +Returns best sidechain block id 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 + } + + + + + diff --git a/doc/api/block/currentHeight.md b/doc/api/block/currentHeight.md new file mode 100644 index 0000000..5e547e9 --- /dev/null +++ b/doc/api/block/currentHeight.md @@ -0,0 +1,25 @@ +[< 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 + } + } + + + + + diff --git a/doc/api/block/findBlockInfoById.md b/doc/api/block/findBlockInfoById.md new file mode 100644 index 0000000..e2f04bc --- /dev/null +++ b/doc/api/block/findBlockInfoById.md @@ -0,0 +1,44 @@ +[< 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 + } + } + + + + + diff --git a/doc/api/block/findById.md b/doc/api/block/findById.md new file mode 100644 index 0000000..5760679 --- /dev/null +++ b/doc/api/block/findById.md @@ -0,0 +1,77 @@ +[< 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 + } + + + + diff --git a/doc/api/block/findIdByHeight.md b/doc/api/block/findIdByHeight.md new file mode 100644 index 0000000..3ab2417 --- /dev/null +++ b/doc/api/block/findIdByHeight.md @@ -0,0 +1,27 @@ +[< EON API Documentation](/doc/api/findIdByHeight.md) +### block/findIdByHeight + +Returns a sidechain block Id by its height in the blockchain + +**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" + } + + + + + + diff --git a/doc/api/block/findLastIds.md b/doc/api/block/findLastIds.md new file mode 100644 index 0000000..f9e8529 --- /dev/null +++ b/doc/api/block/findLastIds.md @@ -0,0 +1,32 @@ +[< 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" + ] + } + + + + + diff --git a/doc/api/block/forgingInfo.md b/doc/api/block/forgingInfo.md new file mode 100644 index 0000000..ff9b629 --- /dev/null +++ b/doc/api/block/forgingInfo.md @@ -0,0 +1,35 @@ +[< 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 + } + } + + + + + + diff --git a/doc/api/block/generate.md b/doc/api/block/generate.md new file mode 100644 index 0000000..c879ce2 --- /dev/null +++ b/doc/api/block/generate.md @@ -0,0 +1,29 @@ +[< EON API Documentation](/doc/api/index.md) +### block/generate + +Tries to generate new block by epoch and slot number. Returns id of generated sidechain block. +**This endpoint can be used only in REGTEST mode** + +**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" + } + } + + + + + diff --git a/doc/api/block/getFeePayments.md b/doc/api/block/getFeePayments.md new file mode 100644 index 0000000..63c339b --- /dev/null +++ b/doc/api/block/getFeePayments.md @@ -0,0 +1,31 @@ +[< EON API Documentation](/doc/api/index.md) +### block/getFeePayments + +Returns info on the fee redistributed to forgers, at the end of each withdrawal epoch. +**This endpoint returns a non-empty result only for the last block of each withrawal epoch.** + +**Parameters** + +| Name | Type | Required | Description | +| -------- | ------- | ------- | ------- | +| blockId | String | yes | Block ID | + +**Example request** + + curl -sX POST 'http://127.0.0.1:9085/block/getFeePayments' -H 'Content-Type: application/json' -H 'accept: application/json' -d '{"blockId":"99e4a42fce9befd560cbbb515d9a692b7dd5d32a3491fa9325c43580c9f1b4fc"}' + +**Example response** + + { + "result" : { + "feePayments" : [ + { + "address" : "c49dedc85a2c360fea781bcea2bc5d58fde19", + "value" : 2000000 + } + ] + } + } + + + diff --git a/doc/api/block/getForwardTransfers.md b/doc/api/block/getForwardTransfers.md new file mode 100644 index 0000000..52674f1 --- /dev/null +++ b/doc/api/block/getForwardTransfers.md @@ -0,0 +1,31 @@ +[< EON API Documentation](/doc/api/index.md) +### block/getForwardTransfers + +Returns info on the forward transfer included a specific block (if any). + + +**Parameters** + +| Name | Type | Required | Description | +| -------- | ------- | ------- | ------- | +| blockId | String | yes | Block ID | + +**Example request** + + curl -sX POST 'http://127.0.0.1:9085/block/getForwardTransfers' -H 'Content-Type: application/json' -H 'accept: application/json' -d '{"blockId":"99e4a42fce9befd560cbbb515d9a692b7dd5d32a3491fa9325c43580c9f1b4fc"}' + +**Example response** + + { + "result" : { + "forwardTransfers" : [ + { + "to" : "c49dedc85a2c360fea781bcea2bc5d58fde19", + "value" : 2000000 + } + ] + } + } + + + diff --git a/doc/api/block/startForging.md b/doc/api/block/startForging.md new file mode 100644 index 0000000..55cde92 --- /dev/null +++ b/doc/api/block/startForging.md @@ -0,0 +1,23 @@ +[< EON API Documentation](/doc/api/index.md) +### block/startForging + +Start forging activity. + +**Parameters** + +No parameters + +**Example request** + + curl -sX POST 'http://127.0.0.1:9085/block/startForging' -H 'Content-Type: application/json' -H 'accept: application/json' + +**Example response** + + { + "result" : {} + } + + + + + diff --git a/doc/api/block/stopForging.md b/doc/api/block/stopForging.md new file mode 100644 index 0000000..466bd3b --- /dev/null +++ b/doc/api/block/stopForging.md @@ -0,0 +1,23 @@ +[< EON API Documentation](/doc/api/index.md) +### block/stopForging + +Stop forging activity. + +**Parameters** + +No parameters + +**Example request** + + curl -sX POST 'http://127.0.0.1:9085/block/stopForging' -H 'Content-Type: application/json' -H 'accept: application/json' + +**Example response** + + { + "result" : {} + } + + + + + diff --git a/doc/api/index.md b/doc/api/index.md new file mode 100644 index 0000000..a8a2010 --- /dev/null +++ b/doc/api/index.md @@ -0,0 +1,85 @@ +# EON API Documentation + +Following endpoints are available on EON node: + + +## Blocks endpoints +[/block/findById](/doc/api/block/findById.md) +[/block/findLastIds](/doc/api/block/findLastIds.md) +[/block/findIdByHeight](/doc/api/block/findIdByHeight.md) +[/block/best](/doc/api/block/best.md) +[/block/currentHeight](/doc/api/block/currentHeight.md) +[/block/findBlockInfoById](/doc/api/block/findBlockInfoById.md) +[/block/getFeePayments](/doc/api/block/getFeePayments.md) +[/block/getForwardTransfers](/doc/api/block/getForwardTransfers.md) +[/block/startForging](/doc/api/block/startForging.md) +[/block/stopForging](/doc/api/block/stopForging.md) +[/block/forgingInfo](/doc/api/block/forgingInfo.md) +[/block/generate](/doc/api/block/generate.md) + + +## Transaction endpoints +[/transaction/allTransactions](/doc/api/transaction/allTransactions.md) +[/transaction/createLegacyEIP155Transaction](/doc/api/transaction/createLegacyEIP155Transaction.md) +[/transaction/createEIP1559Transaction](/doc/api/transaction/createEIP1559Transaction.md) +[/transaction/createLegacyTransaction](/doc/api/transaction/createLegacyTransaction.md) +[/transaction/sendTransaction](/doc/api/transaction/sendTransaction.md) +[/transaction/signTransaction](/doc/api/transaction/signTransaction.md) +[/transaction/makeForgerStake](/doc/api/transaction/makeForgerStake.md) +[/transaction/spendForgingStake](/doc/api/transaction/spendForgingStake.md) +[/transaction/withdrawCoins](/doc/api/transaction/withdrawCoins.md) +[/transaction/createSmartContract](/doc/api/transaction/createSmartContract.md) +[/transaction/allWithdrawalRequests](/doc/api/transaction/allWithdrawalRequests.md) +[/transaction/allForgingStakes](/doc/api/transaction/allForgingStakes.md) +[/transaction/myForgingStakes](/doc/api/transaction/myForgingStakes.md) +[/transaction/decodeTransactionBytes](/doc/api/transaction/decodeTransactionBytes.md) +[/transaction/openForgerList](/doc/api/transaction/openForgerList.md) +[/transaction/allowedForgerList](/doc/api/transaction/allowedForgerList.md) +[/transaction/createKeyRotationTransaction](/doc/api/transaction/createKeyRotationTransaction.md) +[/transaction/invokeProxyCall](/doc/api/transaction/invokeProxyCall.md) +[/transaction/invokeProxyStaticCall](/doc/api/transaction/invokeProxyStaticCall.md) +[/transaction/sendKeysOwnership](/doc/api/transaction/sendKeysOwnership.md) +[/transaction/getKeysOwnership](/doc/api/transaction/getKeysOwnership.md) +[/transaction/removeKeysOwnership](/doc/api/transaction/removeKeysOwnership.md) +[/transaction/getKeysOwnerScAddresses](/doc/api/transaction/getKeysOwnerScAddresses.md) + +## Wallet endpoints + +[/wallet/createPrivateKey25519](/doc/api/wallet/createPrivateKey25519.md) +[/wallet/createPrivateKeySecp256k1](/doc/api/wallet/createPrivateKeySecp256k1.md) +[/wallet/createVrfSecret](/doc/api/wallet/createVrfSecret.md) +[/wallet/allPublicKeys](/doc/api/wallet/allPublicKeys.md) +[/wallet/getBalance](/doc/api/wallet/getBalance.md) +[/wallet/getTotalBalance](/doc/api/wallet/getTotalBalance.md) +[/wallet/getAllBalances](/doc/api/wallet/getAllBalances.md) +[/wallet/importSecret](/doc/api/wallet/importSecret.md) +[/wallet/exportSecret](/doc/api/wallet/exportSecret.md) +[/wallet/dumpSecrets](/doc/api/wallet/dumpSecrets.md) +[/wallet/importSecrets](/doc/api/wallet/importSecrets.md) + +## Mainchain related endpoints +[/mainchain/genesisBlockReferenceInfo](/doc/api/mainchain/genesisBlockReferenceInfo.md) +[/mainchain/bestBlockReferenceInfo](/doc/api/mainchain/bestBlockReferenceInfo.md) +[/mainchain/blockReferenceInfoBy](/doc/api/mainchain/blockReferenceInfoBy.md) +[/mainchain/blockReferenceByHash](/doc/api/mainchain/blockReferenceByHash.md) +[/mainchain/mainchainHeaderInfoByHash](/doc/api/mainchain/mainchainHeaderInfoByHash.md) + +## Node management endpoints + +[/node/allPeers](/doc/api/node/allPeers.md) +[/node/connectedPeers](/doc/api/node/connectedPeers.md) +[/node/peer](/doc/api/node/peer.md) +[/node/info](/doc/api/node/info.md) +[/node/sidechainId](/doc/api/sidechainId/sidechainId.md) +[/node/storageVersions](/doc/api/node/storageVersions.md) +[/node/connect](/doc/api/node/connect.md) +[/node/disconnect](/doc/api/node/disconnect.md) +[/node/addToBlacklist](/doc/api/node/addToBlacklist.md) +[/node/removeFromBlacklist](/doc/api/node/removeFromBlacklist.md) +[/node/blacklistedPeers](/doc/api/node/blacklistedPeers.md) +[/node/stop](/doc/api/node/stop.md) + + + + + diff --git a/doc/api/mainchain/bestBlockReferenceInfo copy.md b/doc/api/mainchain/bestBlockReferenceInfo copy.md new file mode 100644 index 0000000..a743070 --- /dev/null +++ b/doc/api/mainchain/bestBlockReferenceInfo copy.md @@ -0,0 +1,26 @@ +[< EON API Documentation](/doc/api/index.md) +### mainchain/bestBlockReferenceInfo + +Returns info about the most recent mainchain block reference included in the sidechain + +**Parameters** + +No parameters + +**Example request** + + curl -sX POST 'http://127.0.0.1:9085/mainchain/bestBlockReferenceInfo' -H 'Content-Type: application/json' -H 'accept: application/json' + +**Example response** + + { + "result" : { + "blockReferenceInfo" : { + "mainchainHeaderSidechainBlockId" : "2abcf1ffa5e99aadbe15a9387e70d485d64cdb5b1ae842fcc60e1f8b1f0c17da", + "mainchainReferenceDataSidechainBlockId" : "2abcf1ffa5e99aadbe15a9387e70d485d64cdb5b1ae842fcc60e1f8b1f0c17da", + "hash" : "00037532bda93d50f3348533dfccd6ce2865c083bd3843d6fe9c5bb0b3b2e034", + "parentHash" : "0000898ffe9dabd5435a772e8f3385193829f567acef873a3bf549ddee882a0c", + "height" : 1355909 + } + } + } \ No newline at end of file diff --git a/doc/api/mainchain/bestBlockReferenceInfo.md b/doc/api/mainchain/bestBlockReferenceInfo.md new file mode 100644 index 0000000..e566049 --- /dev/null +++ b/doc/api/mainchain/bestBlockReferenceInfo.md @@ -0,0 +1,26 @@ +[< EON API Documentation](/doc/api/index.md) +### mainchain/bestBlockReferenceInfo + +Returns info about the most recent mainchain block reference included in the sidechain. + +**Parameters** + +No parameters + +**Example request** + + curl -sX POST 'http://127.0.0.1:9085/mainchain/bestBlockReferenceInfo' -H 'Content-Type: application/json' -H 'accept: application/json' + +**Example response** + + { + "result" : { + "blockReferenceInfo" : { + "mainchainHeaderSidechainBlockId" : "2abcf1ffa5e99aadbe15a9387e70d485d64cdb5b1ae842fcc60e1f8b1f0c17da", + "mainchainReferenceDataSidechainBlockId" : "2abcf1ffa5e99aadbe15a9387e70d485d64cdb5b1ae842fcc60e1f8b1f0c17da", + "hash" : "00037532bda93d50f3348533dfccd6ce2865c083bd3843d6fe9c5bb0b3b2e034", + "parentHash" : "0000898ffe9dabd5435a772e8f3385193829f567acef873a3bf549ddee882a0c", + "height" : 1355909 + } + } + } \ No newline at end of file diff --git a/doc/api/mainchain/blockReferenceByHash.md b/doc/api/mainchain/blockReferenceByHash.md new file mode 100644 index 0000000..73928dc --- /dev/null +++ b/doc/api/mainchain/blockReferenceByHash.md @@ -0,0 +1,24 @@ +[< EON API Documentation](/doc/api/index.md) +### mainchain/blockReferenceByHash + +Returns a specific mainchain block reference by block hash. +Only mainchain blocks referenced by the sidechain are returned. + +**Parameters** + +| Name | Type | Required | Description | +| -------- | ------- | ------- | ------- | +| hash | string | no | Mainchain block hash to query | + +**Example request** + + curl -sX POST 'http://127.0.0.1:9085/mainchain/blockReferenceByHash' -H 'Content-Type: application/json' -H 'accept: application/json' -d '{"hash":"00037532bda93d50f3348533dfccd6ce2865c083bd3843d6fe9c5bb0b3b2e034"}' + + +**Example response** + + { + "result" : { + "blockHex" : "a2179e17030000000c2a88eedd49f53b3a87efac67f529381985338f2e775a43d5ab9dfe8f890000e637c8a29333a7afaad91a43d19f49244be39bf48da4afdadd819538cec0fe1a66d4012f66d4758b33d22889956ed49d95c112d891637f53e6f000c46ce9650d247c37655b8d061f4000001e2b000000000000000000000000000000000000000000000000000009fd40050026eaf1bc1298cba4a6d4008653d011f4c1d7b35300524ec6f9921ab69d98a652ba6b709e62d5d8f78114dd8205634b90ec79818361e774e6c4da1e58aab61fa507d6d09c78e521eb53eccdafa442e0ffb90ced1f05e415d552d0898d9df74a53c2949b241a7ef5eb3640db38699ab234de7ef75c1754e7d2c7d6da1f492c561c5b03a63fbf5a38931899ac116500657dbd213da9f4223a926233318f74d4d7526b51f7081da9ec0246e2b9ce0ead372db20043ffe16c99152473547536a6b1d9e092bd9359c4847a06e8fa5d3d42d805dd16d7f90613f82c15c1acd7128247d039c94bf47167189eecbc1cca9bac58ad969bdbf2e3de14f5f9cffa0679df33b01057d5e1a665c80edacf0d7c5aee1e5228f2d7882398e6ff0e89ea084e56ab5ea2c79f1e791288bc85468d07e329fae558de73cec9e7225bd47d22d96eed96d7861f38ece90c0360634ebceb1ca929010aff836c6b9571a56884a202e2be3dff0939068a0ba0d6c2ee1d4de19e5ac32091c62c6dbf28dda5740676ffca18145bcf85be14ebcefa5d167e289f0dcb0e42a075135755af56b6f1ae6bba979a52f134f40d0ec9aa73908da2c52f66445c0344e5561fd6fd8a9f11d59b03ff623f4178263370da2ddaf72c023e3112134710a38d9effeb43ced3feebc552a18737fd15b416ca1994b258ce33d977d3f5d349fff9ad23161bc80257fa5d09d576e9200d02bc9ac795f602e01724de09c8a78ed257562de9fd471c0579c1ca5ce67a27ed0425da59385c08ad469590aff5fce8e58fe518535e159539813a45f48b08dde88c66761f3a700cb441cf05d25f5c5a15b6893ff443f7b246a0f28bc039763b06e22e513f91b2ed2741450838b498194215dadb7221a9f3f921d00828d01f3633dcba4d05c122f3cf572f3fe9a264303409bf39e3fb09430399773b733db200a5e096aa101c61aa31c6880af94f5717397af7fb027fa1949f604b8d0e8d69dbd6dcd3e37d315e9bc519c7767d51889d20dbb056b2ccffa8fe3c51d3f2d43e1a5e0cf3de540da88e554ff76a90c56bfa11726d05427f6a6c5531f0ca50105a9beebcfa45ccba17282801959b02551f19b4fd841d4ce43fd38eb09d1c3507669f920b548657e70639b5a1660bbb18233c7bd928d79f936fd1e6e368afc94886eaff52f6e4bce2c004de56d32589a6bab8cef2b2db5cb8f146257df0e6528a933cce55311be650c5516e3dc809606d0d0037099e4c5b9c8b5d93a68670dc1196c8fee0935c39900bcafdd473f01df9b176a3bdf2d48fdd66b35434bf08cc1b9f480e4b16df8f04bb613674d2af9eba0b6328b29c9bcddeba73eea625b2862f4045b4bd146f1510aff78888092c03368a76ce90602f9db676fb69ec20beb40f176f7a17eb4a137015599a191be517eb1802ca7ba1919a234f4e28698d3971aea3d4f1dfa12e2d8f6b6d5a20b12be596a586726fcdde4685b4d5d70ab1b6677666e63f89a981b9256e2084d98d88a0944e5d749be4d8266987b9f52710fb3daf17ee18eedd085fc1c5b6440ced8f7d6280ab5768ea4ed5bfce242cbbf76dae70ed81fd2943f58de19fb535d9bb8a8713135cb0fa91d186eaeac2a4f71afcf5f3db9b28f71ca2a3cc754e479af50ea5ed0f640579b440ef29d9058883c6e853cd1db654536ec358b9f748f1db9e7320f645d2cf37b821ebeb7a2e7f75bc12d26ad8cd630c52b6766d298b27a19508deb9ea8d6eecc93b1aab0c5454a482655385a281f0cccb3dde12bff73fb10d0a232e4fe069fb65ba3ae0f4a6bb1c81c66efbbc5214d273d168d02ba56270b43e8be2e283402a7d2906171d073802a2b30987172617fcd49a6987b5f8b79b18df051da258e787a1e1b25b54a18b77a492ff9e864e00037532bda93d50f3348533dfccd6ce2865c083bd3843d6fe9c5bb0b3b2e03400000400000000" + } + } diff --git a/doc/api/mainchain/blockReferenceInfoBy.md b/doc/api/mainchain/blockReferenceInfoBy.md new file mode 100644 index 0000000..31be002 --- /dev/null +++ b/doc/api/mainchain/blockReferenceInfoBy.md @@ -0,0 +1,26 @@ +[< EON API Documentation](/doc/api/index.md) +### mainchain/blockReferenceInfoBy + +Returns a specific mainchain block reference by block hash or height (in the mainchain) +Only mainchain blocks referenced by the sidechain are returned. + +**Parameters** + +| Name | Type | Required | Description | +| -------- | ------- | ------- | ------- | +| hash | string | no | Mainchain block hash to query | +| height | int | no | Height in the mainchain to query | + +**Example request** + + curl -sX POST 'http://127.0.0.1:9085/mainchain/blockReferenceInfoBy' -H 'Content-Type: application/json' -H 'accept: application/json' -d '{"hash":"00037532bda93d50f3348533dfccd6ce2865c083bd3843d6fe9c5bb0b3b2e034"}' + + curl -sX POST 'http://127.0.0.1:9085/mainchain/blockReferenceInfoBy' -H 'Content-Type: application/json' -H 'accept: application/json' -d '{"height":1355909}' + +**Example response** + + { + "result" : { + "blockHex" : "00037532bda93d50f3348533dfccd6ce2865c083bd3843d6fe9c5bb0b3b2e0340000898ffe9dabd5435a772e8f3385193829f567acef873a3bf549ddee882a0c8ac2a5012abcf1ffa5e99aadbe15a9387e70d485d64cdb5b1ae842fcc60e1f8b1f0c17da2abcf1ffa5e99aadbe15a9387e70d485d64cdb5b1ae842fcc60e1f8b1f0c17da" + } + } \ No newline at end of file diff --git a/doc/api/mainchain/genesisBlockReferenceInfo.md b/doc/api/mainchain/genesisBlockReferenceInfo.md new file mode 100644 index 0000000..647a42c --- /dev/null +++ b/doc/api/mainchain/genesisBlockReferenceInfo.md @@ -0,0 +1,26 @@ +[< EON API Documentation](/doc/api/index.md) +### mainchain/genesisBlockReferenceInfo + +Returns info about the mainchain block containing the transaction that created this sidechain + +**Parameters** + +No parameters + +**Example request** + + curl -sX POST 'http://127.0.0.1:9085/mainchain/genesisBlockReferenceInfo' -H 'Content-Type: application/json' -H 'accept: application/json' + +**Example response** + + { + "result" : { + "blockReferenceInfo" : { + "mainchainHeaderSidechainBlockId" : "2f255cdc2f24c9fc365ca4d47d99783fce2fc369f7883a0bac9dc99227208230", + "mainchainReferenceDataSidechainBlockId" : "2f255cdc2f24c9fc365ca4d47d99783fce2fc369f7883a0bac9dc99227208230", + "hash" : "000cca32283b4652ea0e22883a913b5f2082e6c9e70a7d0f56e80c6f52c79cac", + "parentHash" : "000b01ca938dd2d122b2f1d92a71a3608a3ba0aad4f099754e4738c922267f69", + "height" : 1236923 + } + } + } \ No newline at end of file diff --git a/doc/api/mainchain/mainchainHeaderInfoByHash.md b/doc/api/mainchain/mainchainHeaderInfoByHash.md new file mode 100644 index 0000000..aad1a79 --- /dev/null +++ b/doc/api/mainchain/mainchainHeaderInfoByHash.md @@ -0,0 +1,29 @@ +[< EON API Documentation](/doc/api/index.md) +### mainchain/mainchainHeaderInfoByHash + +Returns info about a mainchain block header by its hash. +Only mainchain block headers referenced by the sidechain are returned. + +**Parameters** + +| Name | Type | Required | Description | +| -------- | ------- | ------- | ------- | +| hash | string | no | Mainchain block hash to query | + +**Example request** + + curl -sX POST 'http://127.0.0.1:9085/mainchain/mainchainHeaderInfoByHash' -H 'Content-Type: application/json' -H 'accept: application/json' -d '{"hash":"00037532bda93d50f3348533dfccd6ce2865c083bd3843d6fe9c5bb0b3b2e034"}' + +**Example response** + + { + "result" : { + "mainchainHeaderInfo" : { + "hash" : "00037532bda93d50f3348533dfccd6ce2865c083bd3843d6fe9c5bb0b3b2e034", + "parentHash" : "0000898ffe9dabd5435a772e8f3385193829f567acef873a3bf549ddee882a0c", + "height" : 1355909, + "sidechainBlockId" : "2abcf1ffa5e99aadbe15a9387e70d485d64cdb5b1ae842fcc60e1f8b1f0c17da", + "cumulativeCommTreeHash" : "8b02d11528132c3369d5762f569f488cb25e8cdd0db5e86ae8459e3eb15f5a2d" + } + } +} \ No newline at end of file diff --git a/doc/api/node/addToBlacklist.md b/doc/api/node/addToBlacklist.md new file mode 100644 index 0000000..112b18d --- /dev/null +++ b/doc/api/node/addToBlacklist.md @@ -0,0 +1,27 @@ +[< EON API Documentation](/doc/api/index.md) +### node/addToBlacklist + +Force the node to add a specific peer to the blacklisted ones. + +**Parameters** + +| Name | Type | Required | Description | +| -------- | ------- | ------- | ------- | +| address | string | yes | Peer to blacklist (format: ip:port) | +| durationInMinutes | int | yes | Duration for the ban | + + +**Example request** + + curl -sX POST 'http://127.0.0.1:9085/node/addToBlacklist' -H 'Content-Type: application/json' -H 'accept: application/json' -d '{"address":"92.92.92.92:27017", durationInMinutes: 20}' + +**Example response** + + { + "result" : {} + } + + + + + diff --git a/doc/api/node/allPeers.md b/doc/api/node/allPeers.md new file mode 100644 index 0000000..dbbc7de --- /dev/null +++ b/doc/api/node/allPeers.md @@ -0,0 +1,42 @@ +[< EON API Documentation](/doc/api/index.md) +### node/allPeers + +Returns the list of all sidechain node peers + +**Parameters** + +No parameters + +**Example request** + + curl -sX POST 'http://127.0.0.1:9085/node/allPeers' -H 'Content-Type: application/json' -H 'accept: application/json' + +**Example response** + + { + "result" : { + "peers" : [ + { + "remoteAddress" : "/143.42.26.149:5674", + "lastHandshake" : 0, + "lastMessage" : 0, + "name" : "unknown-/143.42.26.149:5674", + "agentName" : "unknown", + "protocolVersion" : "Version(0,0,1)" + }, + { + "remoteAddress" : "/192.46.215.198:5674", + "lastHandshake" : 0, + "lastMessage" : 0, + "name" : "unknown-/192.46.215.198:5674", + "agentName" : "unknown", + "protocolVersion" : "Version(0,0,1)" + } + ] + } + } + + + + + diff --git a/doc/api/node/blacklistedPeers.md b/doc/api/node/blacklistedPeers.md new file mode 100644 index 0000000..943c4e6 --- /dev/null +++ b/doc/api/node/blacklistedPeers.md @@ -0,0 +1,28 @@ +[< EON API Documentation](/doc/api/index.md) +### node/blacklistedPeers + +Return the list of the blacklisted peers + +**Parameters** + +No parameters. + +**Example request** + + curl -sX POST 'http://127.0.0.1:9085/node/blacklistedPeers' -H 'Content-Type: application/json' -H 'accept: application/json' + +**Example response** + + { + "result" : { + "addresses": [ + "92.92.92.92:27017", + "81.15.92.92:8080 + ] + } + } + + + + + diff --git a/doc/api/node/connect.md b/doc/api/node/connect.md new file mode 100644 index 0000000..1c7334c --- /dev/null +++ b/doc/api/node/connect.md @@ -0,0 +1,28 @@ +[< EON API Documentation](/doc/api/index.md) +### node/connect + +Force the node to try to establish a connection to a specific peer + +**Parameters** + +| Name | Type | Required | Description | +| -------- | ------- | ------- | ------- | +| host | string | yes | Host to connect | +| port | int | yes | Port | + +**Example request** + + curl -sX POST 'http://127.0.0.1:9085/node/connect' -H 'Content-Type: application/json' -H 'accept: application/json' -d '{"host":"myhost.com", "port": 8090}' + +**Example response** + + { + "result" : { + "connectedTo" : "143.42.26.149:5674" + } + } + + + + + diff --git a/doc/api/node/connectedPeers.md b/doc/api/node/connectedPeers.md new file mode 100644 index 0000000..6465d84 --- /dev/null +++ b/doc/api/node/connectedPeers.md @@ -0,0 +1,45 @@ +[< EON API Documentation](/doc/api/index.md) +### node/connectedPeers + +Returns the list of node peers currently connected to this node + +**Parameters** + +No parameters + +**Example request** + + curl -sX POST 'http://127.0.0.1:9085/node/connectedPeers' -H 'Content-Type: application/json' -H 'accept: application/json' + +**Example response** + + { + "result" : { + "peers" : [ + { + "remoteAddress" : "/139.162.18.215:5674", + "localAddress" : "/10.0.2.15:39164", + "lastHandshake" : 1698066516794, + "lastMessage" : 1698069128120, + "name" : "evmapp-testnet_forger11", + "agentName" : "2-Hop", + "protocolVersion" : "Version(0,0,1)", + "connectionType" : "Outgoing" + }, { + "remoteAddress" : "/172.105.185.87:5674", + "localAddress" : "/10.0.2.15:43622", + "lastHandshake" : 1698066486764, + "lastMessage" : 1698069135249, + "name" : "evmapp-testnet_forger7", + "agentName" : "2-Hop", + "protocolVersion" : "Version(0,0,1)", + "connectionType" : "Outgoing" + } + ] + } + } + + + + + diff --git a/doc/api/node/disconnect.md b/doc/api/node/disconnect.md new file mode 100644 index 0000000..3d40613 --- /dev/null +++ b/doc/api/node/disconnect.md @@ -0,0 +1,28 @@ +[< EON API Documentation](/doc/api/index.md) +### node/disconnect + +Force the node to disconnect from a specific peer + +**Parameters** + +| Name | Type | Required | Description | +| -------- | ------- | ------- | ------- | +| host | string | yes | Host to connect | +| port | int | yes | Port | + +**Example request** + + curl -sX POST 'http://127.0.0.1:9085/node/disconnect' -H 'Content-Type: application/json' -H 'accept: application/json' -d '{"host":"myhost.com", "port": 8090}' + +**Example response** + + { + "result" : { + "disconnectedFrom" : "143.42.26.149:5674" + } + } + + + + + diff --git a/doc/api/node/info.md b/doc/api/node/info.md new file mode 100644 index 0000000..7a0623a --- /dev/null +++ b/doc/api/node/info.md @@ -0,0 +1,53 @@ +[< EON API Documentation](/doc/api/index.md) +### node/info + +Returns info about this node + +**Parameters** + +No parameters + +**Example request** + + curl -sX POST 'http://127.0.0.1:9085/node/info' -H 'Content-Type: application/json' -H 'accept: application/json' + +**Example response** + + { + "result" : { + "nodeName" : "evmapp-testnet_forger1", + "nodeType" : "forger,signer,submitter", + "protocolVersion" : "0.0.1", + "agentName" : "2-Hop", + "sdkVersion" : "sidechains-sdk/0.8.0-SNAPSHOT/amd64/jdk11", + "nodeVersion" : "dev", + "scId" : "1f758350754c12ac8f75a547f745b75eb744b382e15d0d3b0e24a4b5c5acde00", + "scType" : "non ceasing", + "scModel" : "Account", + "scBlockHeight" : 976649, + "scConsensusEpoch" : 1774, + "epochForgersStake" : 1200110000, + "nextBaseFee" : 20000000000, + "scWithdrawalEpochLength" : 100, + "scWithdrawalEpochNum" : 1185, + "scEnv" : "testnet", + "lastMcBlockReferenceHash": "0000612c0dcffbd60108068537287d12efe8e33a06f51c6145ae0c8d548ac452", + "numberOfPeers" : 15, + "numberOfConnectedPeers" : 14, + "numberOfBlacklistedPeers" : 0, + "maxMemPoolSlots" : 6144, + "numOfTxInMempool" : 0, + "executableTxSize" : 0, + "nonExecutableTxSize" : 0, + "lastCertEpoch" : 1184, + "lastCertQuality" : 9, + "lastCertBtrFee" : 0, + "lastCertFtMinAmount" : 54, + "lastCertHash" : "6a3c0d3c83391d58f353f3218aef75abc9fbe1d7c820df2666dde7620edc4b70", + "errors" : [ ] + } + + + + + diff --git a/doc/api/node/peer.md b/doc/api/node/peer.md new file mode 100644 index 0000000..f94e7e9 --- /dev/null +++ b/doc/api/node/peer.md @@ -0,0 +1,35 @@ +[< EON API Documentation](/doc/api/index.md) +### node/peer + +Returns info about a specific node peer + +**Parameters** + +| Name | Type | Required | Description | +| -------- | ------- | ------- | ------- | +| address | string | yes | Peer to blacklist (format: ip:port) | + +**Example request** + + curl -sX POST 'http://127.0.0.1:9085/node/peer' -H 'Content-Type: application/json' -H 'accept: application/json' -d '{"address":"92.92.92.92:27017"}' + +**Example response** + + { + "result" : { + "peer" : + { + "remoteAddress" : "/143.42.26.149:5674", + "lastHandshake" : 0, + "lastMessage" : 0, + "name" : "unknown-/143.42.26.149:5674", + "agentName" : "unknown", + "protocolVersion" : "Version(0,0,1)" + } + } + } + + + + + diff --git a/doc/api/node/removeFromBlacklist.md b/doc/api/node/removeFromBlacklist.md new file mode 100644 index 0000000..7d2369b --- /dev/null +++ b/doc/api/node/removeFromBlacklist.md @@ -0,0 +1,27 @@ +[< EON API Documentation](/doc/api/index.md) +### node/removeFromBlacklist + +Force the node to remove a specific peer to the blacklisted ones. + +**Parameters** + +| Name | Type | Required | Description | +| -------- | ------- | ------- | ------- | +| address | string | yes | Peer to remove form blacklist (format: ip:port) | + + + +**Example request** + + curl -sX POST 'http://127.0.0.1:9085/node/removeFromBlacklist' -H 'Content-Type: application/json' -H 'accept: application/json' -d '{"address":"92.92.92.92:27017"}' + +**Example response** + + { + "result" : {} + } + + + + + diff --git a/doc/api/node/sidechainId.md b/doc/api/node/sidechainId.md new file mode 100644 index 0000000..bfe3f95 --- /dev/null +++ b/doc/api/node/sidechainId.md @@ -0,0 +1,26 @@ +[< EON API Documentation](/doc/api/index.md) +### node/sidechainId + +Returns info about the sidechain Id + +**Parameters** + +No parameters + +**Example request** + + curl -sX POST 'http://127.0.0.1:9085/node/sidechainId' -H 'Content-Type: application/json' -H 'accept: application/json' + +**Example response** + + { + "result" : { + "sidechainId" : "1f758350754c12ac8f75a547f745b75eb744b382e15d0d3b0e24a4b5c5acde00" + } + } + + + + + + diff --git a/doc/api/node/stop.md b/doc/api/node/stop.md new file mode 100644 index 0000000..b7fd214 --- /dev/null +++ b/doc/api/node/stop.md @@ -0,0 +1,23 @@ +[< EON API Documentation](/doc/api/index.md) +### node/stop + +Initiates a graceful stop procedure for the sidechain node. Returns an empty object. + +**Parameters** + +No parameter + +**Example request** + + curl -sX POST 'http://127.0.0.1:9085/node/stop' -H 'Content-Type: application/json' -H 'accept: application/json' + +**Example response** + + { + "result" : {} + } + + + + + diff --git a/doc/api/node/storageVersions.md b/doc/api/node/storageVersions.md new file mode 100644 index 0000000..63fd58b --- /dev/null +++ b/doc/api/node/storageVersions.md @@ -0,0 +1,31 @@ +[< EON API Documentation](/doc/api/index.md) +### node/storageVersions + +Returns info about most recent version recorded in the internal storages. + +**Parameters** + +No parameters + +**Example request** + + curl -sX POST 'http://127.0.0.1:9085/node/storageVersions' -H 'Content-Type: application/json' -H 'accept: application/json' + +**Example response** + + { + "result" : { + "listOfVersions" : { + "AccountHistoryStorage" : "6fd6be262631ab9535a00b19cb8b7d7bfe398655c4a18ef044368778aa8f1746", + "ConsensusDataStorage" : "59e813c4637b2033aef991236b2dfe49d28b94e7145caec9f61aa0bdaee6b30e", + "AccountStateMetadataStorage" : "074d804ef1c5c028fcbd4fecd9c65400b71a3604decd03c7fbc3ebde1b1cf657", + "SidechainSecretStorage" : "9bebf5221cf0b8f104aefc6e7f9db80fdbff595fe2ca05a4af5a290b36daf375" + } + } + } + + + + + + diff --git a/doc/index.md b/doc/index.md index d62199b..cd507cb 100644 --- a/doc/index.md +++ b/doc/index.md @@ -1,3 +1,7 @@ +# EON API Documentation + +Find [here documentation](/doc/api/index.md) about how to interact with a running EON node. + # EON Release Notes ## Version [1.1.0](/doc/release/1.1.0.md) From 9dda3107a03d613663f585760f9cb67ab64a79fd Mon Sep 17 00:00:00 2001 From: paolocappelletti Date: Tue, 24 Oct 2023 10:48:38 +0200 Subject: [PATCH 09/27] new line on index --- doc/api/index.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/doc/api/index.md b/doc/api/index.md index a8a2010..44a4b57 100644 --- a/doc/api/index.md +++ b/doc/api/index.md @@ -4,18 +4,18 @@ Following endpoints are available on EON node: ## Blocks endpoints -[/block/findById](/doc/api/block/findById.md) -[/block/findLastIds](/doc/api/block/findLastIds.md) -[/block/findIdByHeight](/doc/api/block/findIdByHeight.md) -[/block/best](/doc/api/block/best.md) -[/block/currentHeight](/doc/api/block/currentHeight.md) -[/block/findBlockInfoById](/doc/api/block/findBlockInfoById.md) -[/block/getFeePayments](/doc/api/block/getFeePayments.md) -[/block/getForwardTransfers](/doc/api/block/getForwardTransfers.md) -[/block/startForging](/doc/api/block/startForging.md) -[/block/stopForging](/doc/api/block/stopForging.md) -[/block/forgingInfo](/doc/api/block/forgingInfo.md) -[/block/generate](/doc/api/block/generate.md) +[/block/findById](/doc/api/block/findById.md)\ +[/block/findLastIds](/doc/api/block/findLastIds.md)\ +[/block/findIdByHeight](/doc/api/block/findIdByHeight.md)\ +[/block/best](/doc/api/block/best.md)\ +[/block/currentHeight](/doc/api/block/currentHeight.md)\ +[/block/findBlockInfoById](/doc/api/block/findBlockInfoById.md)\ +[/block/getFeePayments](/doc/api/block/getFeePayments.md)\ +[/block/getForwardTransfers](/doc/api/block/getForwardTransfers.md)\ +[/block/startForging](/doc/api/block/startForging.md)\ +[/block/stopForging](/doc/api/block/stopForging.md)\ +[/block/forgingInfo](/doc/api/block/forgingInfo.md)\ +[/block/generate](/doc/api/block/generate.md)\ ## Transaction endpoints From 9ad048f52396a58b5688b12b666db5a9c8907280 Mon Sep 17 00:00:00 2001 From: paolocappelletti Date: Tue, 24 Oct 2023 10:50:43 +0200 Subject: [PATCH 10/27] new line fix --- doc/api/index.md | 61 ++++++++++++++++++++++-------------------------- 1 file changed, 28 insertions(+), 33 deletions(-) diff --git a/doc/api/index.md b/doc/api/index.md index 44a4b57..43d69bf 100644 --- a/doc/api/index.md +++ b/doc/api/index.md @@ -5,18 +5,17 @@ Following endpoints are available on EON node: ## Blocks endpoints [/block/findById](/doc/api/block/findById.md)\ -[/block/findLastIds](/doc/api/block/findLastIds.md)\ -[/block/findIdByHeight](/doc/api/block/findIdByHeight.md)\ -[/block/best](/doc/api/block/best.md)\ -[/block/currentHeight](/doc/api/block/currentHeight.md)\ -[/block/findBlockInfoById](/doc/api/block/findBlockInfoById.md)\ -[/block/getFeePayments](/doc/api/block/getFeePayments.md)\ -[/block/getForwardTransfers](/doc/api/block/getForwardTransfers.md)\ -[/block/startForging](/doc/api/block/startForging.md)\ -[/block/stopForging](/doc/api/block/stopForging.md)\ -[/block/forgingInfo](/doc/api/block/forgingInfo.md)\ -[/block/generate](/doc/api/block/generate.md)\ - +[/block/findLastIds](/doc/api/block/findLastIds.md)\ +[/block/findIdByHeight](/doc/api/block/findIdByHeight.md)\ +[/block/best](/doc/api/block/best.md)\ +[/block/currentHeight](/doc/api/block/currentHeight.md)\ +[/block/findBlockInfoById](/doc/api/block/findBlockInfoById.md)\ +[/block/getFeePayments](/doc/api/block/getFeePayments.md)\ +[/block/getForwardTransfers](/doc/api/block/getForwardTransfers.md)\ +[/block/startForging](/doc/api/block/startForging.md)\ +[/block/stopForging](/doc/api/block/stopForging.md)\ +[/block/forgingInfo](/doc/api/block/forgingInfo.md)\ +[/block/generate](/doc/api/block/generate.md)\ ## Transaction endpoints [/transaction/allTransactions](/doc/api/transaction/allTransactions.md) @@ -58,28 +57,24 @@ Following endpoints are available on EON node: [/wallet/importSecrets](/doc/api/wallet/importSecrets.md) ## Mainchain related endpoints -[/mainchain/genesisBlockReferenceInfo](/doc/api/mainchain/genesisBlockReferenceInfo.md) -[/mainchain/bestBlockReferenceInfo](/doc/api/mainchain/bestBlockReferenceInfo.md) -[/mainchain/blockReferenceInfoBy](/doc/api/mainchain/blockReferenceInfoBy.md) -[/mainchain/blockReferenceByHash](/doc/api/mainchain/blockReferenceByHash.md) -[/mainchain/mainchainHeaderInfoByHash](/doc/api/mainchain/mainchainHeaderInfoByHash.md) +[/mainchain/genesisBlockReferenceInfo](/doc/api/mainchain/genesisBlockReferenceInfo.md)\ +[/mainchain/bestBlockReferenceInfo](/doc/api/mainchain/bestBlockReferenceInfo.md)\ +[/mainchain/blockReferenceInfoBy](/doc/api/mainchain/blockReferenceInfoBy.md)\ +[/mainchain/blockReferenceByHash](/doc/api/mainchain/blockReferenceByHash.md)\ +[/mainchain/mainchainHeaderInfoByHash](/doc/api/mainchain/mainchainHeaderInfoByHash.md)\ ## Node management endpoints -[/node/allPeers](/doc/api/node/allPeers.md) -[/node/connectedPeers](/doc/api/node/connectedPeers.md) -[/node/peer](/doc/api/node/peer.md) -[/node/info](/doc/api/node/info.md) -[/node/sidechainId](/doc/api/sidechainId/sidechainId.md) -[/node/storageVersions](/doc/api/node/storageVersions.md) -[/node/connect](/doc/api/node/connect.md) -[/node/disconnect](/doc/api/node/disconnect.md) -[/node/addToBlacklist](/doc/api/node/addToBlacklist.md) -[/node/removeFromBlacklist](/doc/api/node/removeFromBlacklist.md) -[/node/blacklistedPeers](/doc/api/node/blacklistedPeers.md) -[/node/stop](/doc/api/node/stop.md) - - - - +[/node/allPeers](/doc/api/node/allPeers.md)\ +[/node/connectedPeers](/doc/api/node/connectedPeers.md)\ +[/node/peer](/doc/api/node/peer.md)\ +[/node/info](/doc/api/node/info.md)\ +[/node/sidechainId](/doc/api/sidechainId/sidechainId.md)\ +[/node/storageVersions](/doc/api/node/storageVersions.md)\ +[/node/connect](/doc/api/node/connect.md)\ +[/node/disconnect](/doc/api/node/disconnect.md)\ +[/node/addToBlacklist](/doc/api/node/addToBlacklist.md)\ +[/node/removeFromBlacklist](/doc/api/node/removeFromBlacklist.md)\ +[/node/blacklistedPeers](/doc/api/node/blacklistedPeers.md)\ +[/node/stop](/doc/api/node/stop.md)\ From 771200a2defdcf493cff22cdf8af09ae8652d511 Mon Sep 17 00:00:00 2001 From: paolocappelletti Date: Tue, 24 Oct 2023 14:25:20 +0200 Subject: [PATCH 11/27] added wallet endpoints documentation --- doc/api/index.md | 26 ++++++++++---------- doc/api/wallet/allPublicKeys.md | 27 +++++++++++++++++++++ doc/api/wallet/createPrivateKey25519.md | 22 +++++++++++++++++ doc/api/wallet/createPrivateKeySecp256k1.md | 24 ++++++++++++++++++ doc/api/wallet/createVrfSecret.md | 24 ++++++++++++++++++ doc/api/wallet/dumpSecrets.md | 22 +++++++++++++++++ doc/api/wallet/exportSecret.md | 22 +++++++++++++++++ doc/api/wallet/getAllBalances.md | 23 ++++++++++++++++++ doc/api/wallet/getBalance.md | 20 +++++++++++++++ doc/api/wallet/getTotalBalance.md | 20 +++++++++++++++ doc/api/wallet/importSecret.md | 24 ++++++++++++++++++ doc/api/wallet/importSecrets.md | 27 +++++++++++++++++++++ 12 files changed, 268 insertions(+), 13 deletions(-) create mode 100644 doc/api/wallet/allPublicKeys.md create mode 100644 doc/api/wallet/createPrivateKey25519.md create mode 100644 doc/api/wallet/createPrivateKeySecp256k1.md create mode 100644 doc/api/wallet/createVrfSecret.md create mode 100644 doc/api/wallet/dumpSecrets.md create mode 100644 doc/api/wallet/exportSecret.md create mode 100644 doc/api/wallet/getAllBalances.md create mode 100644 doc/api/wallet/getBalance.md create mode 100644 doc/api/wallet/getTotalBalance.md create mode 100644 doc/api/wallet/importSecret.md create mode 100644 doc/api/wallet/importSecrets.md diff --git a/doc/api/index.md b/doc/api/index.md index 43d69bf..0c465f3 100644 --- a/doc/api/index.md +++ b/doc/api/index.md @@ -15,7 +15,7 @@ Following endpoints are available on EON node: [/block/startForging](/doc/api/block/startForging.md)\ [/block/stopForging](/doc/api/block/stopForging.md)\ [/block/forgingInfo](/doc/api/block/forgingInfo.md)\ -[/block/generate](/doc/api/block/generate.md)\ +[/block/generate](/doc/api/block/generate.md) ## Transaction endpoints [/transaction/allTransactions](/doc/api/transaction/allTransactions.md) @@ -44,16 +44,16 @@ Following endpoints are available on EON node: ## Wallet endpoints -[/wallet/createPrivateKey25519](/doc/api/wallet/createPrivateKey25519.md) -[/wallet/createPrivateKeySecp256k1](/doc/api/wallet/createPrivateKeySecp256k1.md) -[/wallet/createVrfSecret](/doc/api/wallet/createVrfSecret.md) -[/wallet/allPublicKeys](/doc/api/wallet/allPublicKeys.md) -[/wallet/getBalance](/doc/api/wallet/getBalance.md) -[/wallet/getTotalBalance](/doc/api/wallet/getTotalBalance.md) -[/wallet/getAllBalances](/doc/api/wallet/getAllBalances.md) -[/wallet/importSecret](/doc/api/wallet/importSecret.md) -[/wallet/exportSecret](/doc/api/wallet/exportSecret.md) -[/wallet/dumpSecrets](/doc/api/wallet/dumpSecrets.md) +[/wallet/createPrivateKey25519](/doc/api/wallet/createPrivateKey25519.md)\ +[/wallet/createPrivateKeySecp256k1](/doc/api/wallet/createPrivateKeySecp256k1.md)\ +[/wallet/createVrfSecret](/doc/api/wallet/createVrfSecret.md)\ +[/wallet/allPublicKeys](/doc/api/wallet/allPublicKeys.md)\ +[/wallet/getBalance](/doc/api/wallet/getBalance.md)\ +[/wallet/getTotalBalance](/doc/api/wallet/getTotalBalance.md)\ +[/wallet/getAllBalances](/doc/api/wallet/getAllBalances.md)\ +[/wallet/importSecret](/doc/api/wallet/importSecret.md)\ +[/wallet/exportSecret](/doc/api/wallet/exportSecret.md)\ +[/wallet/dumpSecrets](/doc/api/wallet/dumpSecrets.md)\ [/wallet/importSecrets](/doc/api/wallet/importSecrets.md) ## Mainchain related endpoints @@ -61,7 +61,7 @@ Following endpoints are available on EON node: [/mainchain/bestBlockReferenceInfo](/doc/api/mainchain/bestBlockReferenceInfo.md)\ [/mainchain/blockReferenceInfoBy](/doc/api/mainchain/blockReferenceInfoBy.md)\ [/mainchain/blockReferenceByHash](/doc/api/mainchain/blockReferenceByHash.md)\ -[/mainchain/mainchainHeaderInfoByHash](/doc/api/mainchain/mainchainHeaderInfoByHash.md)\ +[/mainchain/mainchainHeaderInfoByHash](/doc/api/mainchain/mainchainHeaderInfoByHash.md) ## Node management endpoints @@ -76,5 +76,5 @@ Following endpoints are available on EON node: [/node/addToBlacklist](/doc/api/node/addToBlacklist.md)\ [/node/removeFromBlacklist](/doc/api/node/removeFromBlacklist.md)\ [/node/blacklistedPeers](/doc/api/node/blacklistedPeers.md)\ -[/node/stop](/doc/api/node/stop.md)\ +[/node/stop](/doc/api/node/stop.md) diff --git a/doc/api/wallet/allPublicKeys.md b/doc/api/wallet/allPublicKeys.md new file mode 100644 index 0000000..98bd864 --- /dev/null +++ b/doc/api/wallet/allPublicKeys.md @@ -0,0 +1,27 @@ +[< EON API Documentation](/doc/api/index.md) +### wallet/allPublicKeys + +Returns the list of all keys contained in this node wallet. +For 25519 and VRF keys, the public key is returned, for Secp256k1 the EVM public address is returned. + +**Parameters** + +No parameters + +**Example request** + + curl -sX POST 'http://127.0.0.1:9085/wallet/allPublicKeys' -H 'Content-Type: application/json' -H 'accept: application/json' + +**Example response** + +{ + "result" : { + "propositions" : [ { + "publicKey" : "4b50edf43fddcf29afceacfcc9c5c16edb16de6550b9172c7190bfe9fdad0f45" + }, { + "address" : "00c8f107a09cd4f463afc2f1e6e5bf6022ad4600" + }, { + "publicKey" : "593b72416bce63251ce9f5c213127b861dd2aa34c03b6dffd72510678958dc2f80" + } ] + } +} \ No newline at end of file diff --git a/doc/api/wallet/createPrivateKey25519.md b/doc/api/wallet/createPrivateKey25519.md new file mode 100644 index 0000000..a9dbd74 --- /dev/null +++ b/doc/api/wallet/createPrivateKey25519.md @@ -0,0 +1,22 @@ +[< EON API Documentation](/doc/api/index.md) +### wallet/createPrivateKeySecp256k1 + +Create a private key in the Secp256k1 format. +Secp256k1 keys are the standard used in Ethereum EVM and also by EON EVM. +Returns the correspondent address. + +**Parameters** + +No parameters + +**Example request** + + curl -sX POST 'http://127.0.0.1:9085/wallet/createPrivateKeySecp256k1' -H 'Content-Type: application/json' -H 'accept: application/json' + +**Example response** + + { + "result" : { + "address" : "00c8f107a09cd4f463afc2f1e6e5bf6022ad4600" + } + } \ No newline at end of file diff --git a/doc/api/wallet/createPrivateKeySecp256k1.md b/doc/api/wallet/createPrivateKeySecp256k1.md new file mode 100644 index 0000000..0e6904e --- /dev/null +++ b/doc/api/wallet/createPrivateKeySecp256k1.md @@ -0,0 +1,24 @@ +[< EON API Documentation](/doc/api/index.md) +### wallet/createPrivateKey25519 + +Create a private key in the 25519 format. +25519 keys are used in EON for designating forgers. +Returns the correspondent public key. + +**Parameters** + +No parameters + +**Example request** + + curl -sX POST 'http://127.0.0.1:9085/wallet/createPrivateKey25519' -H 'Content-Type: application/json' -H 'accept: application/json' + +**Example response** + + { + "result" : { + "proposition" : { + "publicKey" : "4b50edf43fddcf29afceacfcc9c5c16edb16de6550b9172c7190bfe9fdad0f45" + } + } + } \ No newline at end of file diff --git a/doc/api/wallet/createVrfSecret.md b/doc/api/wallet/createVrfSecret.md new file mode 100644 index 0000000..d3701ac --- /dev/null +++ b/doc/api/wallet/createVrfSecret.md @@ -0,0 +1,24 @@ +[< EON API Documentation](/doc/api/index.md) +### wallet/createVrfSecret + +Create a VrfSecret. +VrfSecrets are used by forgers to partecipate at the forgers' lottery. +Returns the correspondent public key. + +**Parameters** + +No parameters + +**Example request** + + curl -sX POST 'http://127.0.0.1:9085/wallet/createVrfSecret' -H 'Content-Type: application/json' -H 'accept: application/json' + +**Example response** + + { + "result" : { + "proposition" : { + "publicKey" : "593b72416bce63251ce9f5c213127b861dd2aa34c03b6dffd72510678958dc2f80" + } + } + } \ No newline at end of file diff --git a/doc/api/wallet/dumpSecrets.md b/doc/api/wallet/dumpSecrets.md new file mode 100644 index 0000000..a59de98 --- /dev/null +++ b/doc/api/wallet/dumpSecrets.md @@ -0,0 +1,22 @@ +[< EON API Documentation](/doc/api/index.md) +### wallet/dumpSecrets + +Create locally a dump file of all the secrets (privatekeys) contained in the node wallet. + +**Parameters** + +| Name | Type | Required | Description | +| -------- | ------- | ------- | ------- | +| path | string | yes | Local full path of the file to be created (folder must be present) | + +**Example request** + + curl -sX POST 'http://127.0.0.1:9085/wallet/dumpSecrets' -H 'Content-Type: application/json' -H 'accept: application/json' -d '{"path":"/tmp/secrets.dump"}' + +**Example response** + + { + "result" : { + "status" : "Secrets dump completed successfully at: /tmp/secrets.dump" + } + } \ No newline at end of file diff --git a/doc/api/wallet/exportSecret.md b/doc/api/wallet/exportSecret.md new file mode 100644 index 0000000..57360be --- /dev/null +++ b/doc/api/wallet/exportSecret.md @@ -0,0 +1,22 @@ +[< EON API Documentation](/doc/api/index.md) +### wallet/exportSecret + +Prints out the privatekey correspondent to a public key or EVM address contained in this wallet + +**Parameters** + +| Name | Type | Required | Description | +| -------- | ------- | ------- | ------- | +| publickey | string | yes | Public key (or address for Secp256k1) to be exported | + +**Example request** + + curl -sX POST 'http://127.0.0.1:9085/wallet/exportSecret' -H 'Content-Type: application/json' -H 'accept: application/json' -d '{"publickey":"00c8f107a09cd4f463afc2f1e6e5bf6022ad4600"}' + +**Example response** + + { + "result" : { + "privKey" : "xxxxxxxxxxxxxx" + } + } \ No newline at end of file diff --git a/doc/api/wallet/getAllBalances.md b/doc/api/wallet/getAllBalances.md new file mode 100644 index 0000000..b7bd222 --- /dev/null +++ b/doc/api/wallet/getAllBalances.md @@ -0,0 +1,23 @@ +[< EON API Documentation](/doc/api/index.md) +### wallet/getAllBalances + +Return all ZEN balances associated to Secp256k1 (EVM compliant) addresses contained in the node walle, returning a list of pairs (address, balance). + +**Parameters** + +No parameters. + +**Example request** + + curl -sX POST 'http://127.0.0.1:9085/wallet/getAllBalances' -H 'Content-Type: application/json' -H 'accept: application/json' + +**Example response** + + { + "result" : { + "balances" : [ { + "address" : "00c8f107a09cd4f463afc2f1e6e5bf6022ad4600", + "balance" : 2330 + } ] + } + } \ No newline at end of file diff --git a/doc/api/wallet/getBalance.md b/doc/api/wallet/getBalance.md new file mode 100644 index 0000000..459fafe --- /dev/null +++ b/doc/api/wallet/getBalance.md @@ -0,0 +1,20 @@ +[< EON API Documentation](/doc/api/index.md) +### wallet/getBalance + +Return the ZEN balance associated to a specific Secp256k1 (EVM compliant) address contained in the node wallet. + +**Parameters** + +No parameters. + +**Example request** + + curl -sX POST 'http://127.0.0.1:9085/wallet/getBalance' -H 'Content-Type: application/json' -H 'accept: application/json' -d '{"address":"00c8f107a09cd4f463afc2f1e6e5bf6022ad4600"}' + +**Example response** + + { + "result" : { + "balance" : 3330 + } + } \ No newline at end of file diff --git a/doc/api/wallet/getTotalBalance.md b/doc/api/wallet/getTotalBalance.md new file mode 100644 index 0000000..d4704e4 --- /dev/null +++ b/doc/api/wallet/getTotalBalance.md @@ -0,0 +1,20 @@ +[< EON API Documentation](/doc/api/index.md) +### wallet/getTotalBalance + +Return the total ZEN balance of the wallet **considering only Secp256ki (EVM compliant) addresses** + +**Parameters** + +No parameters. + +**Example request** + + curl -sX POST 'http://127.0.0.1:9085/wallet/getTotalBalance' -H 'Content-Type: application/json' -H 'accept: application/json' + +**Example response** + + { + "result" : { + "balance" : 3330 + } + } \ No newline at end of file diff --git a/doc/api/wallet/importSecret.md b/doc/api/wallet/importSecret.md new file mode 100644 index 0000000..4378ca5 --- /dev/null +++ b/doc/api/wallet/importSecret.md @@ -0,0 +1,24 @@ +[< EON API Documentation](/doc/api/index.md) +### wallet/importSecret + +Import a specific private key in the local wallet + +**Parameters** + +| Name | Type | Required | Description | +| -------- | ------- | ------- | ------- | +| privKey | string | yes | Private key to be imported | + +**Example request** + + curl -sX POST 'http://127.0.0.1:9085/wallet/importSecret' -H 'Content-Type: application/json' -H 'accept: application/json' -d '{"privKey":"xxxxx"}' + +**Example response** + + { + "result" : { + "proposition" : { + "address" : "00c8f107a09cd4f463afc2f1e6e5bf6022ad4600" + } + } + } \ No newline at end of file diff --git a/doc/api/wallet/importSecrets.md b/doc/api/wallet/importSecrets.md new file mode 100644 index 0000000..b127518 --- /dev/null +++ b/doc/api/wallet/importSecrets.md @@ -0,0 +1,27 @@ +[< EON API Documentation](/doc/api/index.md) +### wallet/importSecrets + +Import all the secret from a file obtained by a [wallet/dumpSecrets](/doc/api/wallet/dumpSecrets.md) call. + +**Parameters** + +| Name | Type | Required | Description | +| -------- | ------- | ------- | ------- | +| path | string | yes | Local full path of the file to be imported ) | + +**Example request** + + curl -sX POST 'http://127.0.0.1:9085/wallet/importSecrets' -H 'Content-Type: application/json' -H 'accept: application/json' -d '{"path":"/tmp/secrets.dump"}' + +**Example response** + + { + "result" : { + "successfullyAdded" : 2, + "failedToAdd" : 1, + "summary" : [ { + "lineNumber" : 3, + "description" : "requirement failed: Key already exists - PrivateKeySecp256k1{privateKey=acb2dc78}" + } ] + } + } From 8fc127d8bb60350ccd4ef63e6b130657fc0139a1 Mon Sep 17 00:00:00 2001 From: paolocappelletti Date: Tue, 24 Oct 2023 16:22:21 +0200 Subject: [PATCH 12/27] documentation txs --- doc/api/index.md | 44 +++++++++++--------- doc/api/transaction/allTransactions.md | 22 ++++++++++ doc/api/transaction/allWithdrawalRequests.md | 28 +++++++++++++ doc/api/transaction/withdrawCoins.md | 41 ++++++++++++++++++ 4 files changed, 115 insertions(+), 20 deletions(-) create mode 100644 doc/api/transaction/allTransactions.md create mode 100644 doc/api/transaction/allWithdrawalRequests.md create mode 100644 doc/api/transaction/withdrawCoins.md diff --git a/doc/api/index.md b/doc/api/index.md index 0c465f3..2e44e34 100644 --- a/doc/api/index.md +++ b/doc/api/index.md @@ -18,29 +18,33 @@ Following endpoints are available on EON node: [/block/generate](/doc/api/block/generate.md) ## Transaction endpoints + +[/transaction/createLegacyEIP155Transaction] (/doc/api/transaction/createLegacyEIP155Transaction.md) +[/transaction/createEIP1559Transaction] (/doc/api/transaction/createEIP1559Transaction.md) +[/transaction/createLegacyTransaction] (/doc/api/transaction/createLegacyTransaction.md) +[/transaction/sendTransaction] (/doc/api/transaction/sendTransaction.md) +[/transaction/signTransaction] (/doc/api/transaction/signTransaction.md) +[/transaction/decodeTransactionBytes] (/doc/api/transaction/decodeTransactionBytes.md) +[/transaction/createSmartContract] (/doc/api/transaction/createSmartContract.md) + [/transaction/allTransactions](/doc/api/transaction/allTransactions.md) -[/transaction/createLegacyEIP155Transaction](/doc/api/transaction/createLegacyEIP155Transaction.md) -[/transaction/createEIP1559Transaction](/doc/api/transaction/createEIP1559Transaction.md) -[/transaction/createLegacyTransaction](/doc/api/transaction/createLegacyTransaction.md) -[/transaction/sendTransaction](/doc/api/transaction/sendTransaction.md) -[/transaction/signTransaction](/doc/api/transaction/signTransaction.md) -[/transaction/makeForgerStake](/doc/api/transaction/makeForgerStake.md) -[/transaction/spendForgingStake](/doc/api/transaction/spendForgingStake.md) [/transaction/withdrawCoins](/doc/api/transaction/withdrawCoins.md) -[/transaction/createSmartContract](/doc/api/transaction/createSmartContract.md) [/transaction/allWithdrawalRequests](/doc/api/transaction/allWithdrawalRequests.md) -[/transaction/allForgingStakes](/doc/api/transaction/allForgingStakes.md) -[/transaction/myForgingStakes](/doc/api/transaction/myForgingStakes.md) -[/transaction/decodeTransactionBytes](/doc/api/transaction/decodeTransactionBytes.md) -[/transaction/openForgerList](/doc/api/transaction/openForgerList.md) -[/transaction/allowedForgerList](/doc/api/transaction/allowedForgerList.md) -[/transaction/createKeyRotationTransaction](/doc/api/transaction/createKeyRotationTransaction.md) -[/transaction/invokeProxyCall](/doc/api/transaction/invokeProxyCall.md) -[/transaction/invokeProxyStaticCall](/doc/api/transaction/invokeProxyStaticCall.md) -[/transaction/sendKeysOwnership](/doc/api/transaction/sendKeysOwnership.md) -[/transaction/getKeysOwnership](/doc/api/transaction/getKeysOwnership.md) -[/transaction/removeKeysOwnership](/doc/api/transaction/removeKeysOwnership.md) -[/transaction/getKeysOwnerScAddresses](/doc/api/transaction/getKeysOwnerScAddresses.md) + +[/transaction/makeForgerStake] (/doc/api/transaction/makeForgerStake.md) +[/transaction/spendForgingStake] (/doc/api/transaction/spendForgingStake.md) +[/transaction/allForgingStakes] (/doc/api/transaction/allForgingStakes.md) +[/transaction/myForgingStakes] (/doc/api/transaction/myForgingStakes.md) +[/transaction/openForgerList] (/doc/api/transaction/openForgerList.md) +[/transaction/allowedForgerList] (/doc/api/transaction/allowedForgerList.md) +[/transaction/createKeyRotationTransaction] (/doc/api/transaction/createKeyRotationTransaction.md) + +[/transaction/invokeProxyCall] (/doc/api/transaction/invokeProxyCall.md) +[/transaction/invokeProxyStaticCall] (/doc/api/transaction/invokeProxyStaticCall.md) +[/transaction/sendKeysOwnership] (/doc/api/transaction/sendKeysOwnership.md) +[/transaction/getKeysOwnership] (/doc/api/transaction/getKeysOwnership.md) +[/transaction/removeKeysOwnership] (/doc/api/transaction/removeKeysOwnership.md) +[/transaction/getKeysOwnerScAddresses] (/doc/api/transaction/getKeysOwnerScAddresses.md) ## Wallet endpoints diff --git a/doc/api/transaction/allTransactions.md b/doc/api/transaction/allTransactions.md new file mode 100644 index 0000000..7fe120f --- /dev/null +++ b/doc/api/transaction/allTransactions.md @@ -0,0 +1,22 @@ +[< EON API Documentation](/doc/api/index.md) +### transaction/allTransactions + +Returns the list of the transactions in mempool. + +**Parameters** + +| Name | Type | Required | Description | +| -------- | ------- | ------- | ------- | +| format | boolean | no | If false, only the transaction id will be returned, otherwise the whole transaction in json format + +**Example request** + + curl -sX POST 'http://127.0.0.1:9085/transaction/allTransactions' -H 'Content-Type: application/json' -H 'accept: application/json' + +**Example response** + + { + "result" : { + "transactions" : [ "0134123523626tztYQpCcqUqd8LMFiM9p7Zp4hRSkjqrcWAsu" ] + } + } \ No newline at end of file diff --git a/doc/api/transaction/allWithdrawalRequests.md b/doc/api/transaction/allWithdrawalRequests.md new file mode 100644 index 0000000..06cc7d5 --- /dev/null +++ b/doc/api/transaction/allWithdrawalRequests.md @@ -0,0 +1,28 @@ +[< EON API Documentation](/doc/api/index.md) +### transaction/allWithdrawalRequests + +Returns the list of the withdrawal requests assigned to a specific withdrawal epoch. + +**Parameters** + +| Name | Type | Required | Description | +| -------- | ------- | ------- | ------- | +| epochNum | integer | yes | Withdrawal Epoch number + +**Example request** + + curl -sX POST 'http://127.0.0.1:9085/transaction/allWithdrawalRequests' -H 'Content-Type: application/json' -H 'accept: application/json' -d '{"epochNum": 1191}' + +**Example response** + + { + "result" : { + "listOfWR" : [ { + "proposition" : { + "mainchainAddress" : "ztYQpCcqUqd8LMFiM9p7Zp4hRSkjqrcWAsu" + }, + "value" : 1000000000000000000, + "valueInZennies" : 100000000 + } ] + } + } \ No newline at end of file diff --git a/doc/api/transaction/withdrawCoins.md b/doc/api/transaction/withdrawCoins.md new file mode 100644 index 0000000..f446919 --- /dev/null +++ b/doc/api/transaction/withdrawCoins.md @@ -0,0 +1,41 @@ +[< EON API Documentation](/doc/api/index.md) +### transaction/withdrawCoins + +Creates and posts a backward transfer transaction to sends some ZEN back to the mainchain + +**Parameters** + +| Name | Type | Required | Description | +| -------- | ------- | ------- | ------- | +| nonce | integer | no | Nonce associated to the address that is sending the tx. If omitted the next valid nonce will be calculated automatically. | +| withdrawalRequest | object | yes | Description of the withdrawal request | +| gasInfo | object | no | Info about GAS | + + +Parameters of the withdrawalRequest object: + +| Name | Type | Required | Description | +| -------- | ------- | ------- | ------- | +| mainchainAddress | string | yes | Receiver of the backward tx | +| value | long | yes | ZEN value to be sent (in Zentoshi: 1 Zen = 100000000)| + +Parameters of the gasInfo object: + +| Name | Type | Required | Description | +| -------- | ------- | ------- | ------- | +| gasLimit | biginteger | yes | GAS limit | +| maxPriorityFeePerGas | biginteger | yes | Max priority fee| +| maxFeePerGas | biginteger | yes | Max fee per gas | + + +**Example request** + + curl -sX POST 'http://127.0.0.1:9085/transaction/withdrawCoins' -H 'Content-Type: application/json' -H 'accept: application/json' -d '{"withdrawalRequest": { "mainchainAddress": "ztYQpCcqUqd8LMFiM9p7Zp4hRSkjqrcWAsu", "value": 100000000}}' + +**Example response** + + { + "result" : { + "transactionId" : "c6a3288142b2e0800ccffb42a9bb925e5bcb3e613204f291883868a94b58039c" + } + } \ No newline at end of file From 28617b9d9c09efef632a6b3ab129e0d714618e15 Mon Sep 17 00:00:00 2001 From: paolocappelletti Date: Tue, 24 Oct 2023 16:24:09 +0200 Subject: [PATCH 13/27] fix index.md --- doc/api/index.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/api/index.md b/doc/api/index.md index 2e44e34..3e098a9 100644 --- a/doc/api/index.md +++ b/doc/api/index.md @@ -27,9 +27,9 @@ Following endpoints are available on EON node: [/transaction/decodeTransactionBytes] (/doc/api/transaction/decodeTransactionBytes.md) [/transaction/createSmartContract] (/doc/api/transaction/createSmartContract.md) -[/transaction/allTransactions](/doc/api/transaction/allTransactions.md) -[/transaction/withdrawCoins](/doc/api/transaction/withdrawCoins.md) -[/transaction/allWithdrawalRequests](/doc/api/transaction/allWithdrawalRequests.md) +[/transaction/allTransactions](/doc/api/transaction/allTransactions.md)\ +[/transaction/withdrawCoins](/doc/api/transaction/withdrawCoins.md)\ +[/transaction/allWithdrawalRequests](/doc/api/transaction/allWithdrawalRequests.md) [/transaction/makeForgerStake] (/doc/api/transaction/makeForgerStake.md) [/transaction/spendForgingStake] (/doc/api/transaction/spendForgingStake.md) From 034ab9c8de6be81c4244fa32f75bb6280b744c24 Mon Sep 17 00:00:00 2001 From: paolocappelletti Date: Tue, 24 Oct 2023 16:45:39 +0200 Subject: [PATCH 14/27] some more endpoints --- doc/api/index.md | 5 +- doc/api/transaction/allowedForgerList.md | 46 +++++++++++++++++++ .../createKeyRotationTransaction.md | 36 +++++++++++++++ 3 files changed, 85 insertions(+), 2 deletions(-) create mode 100644 doc/api/transaction/allowedForgerList.md create mode 100644 doc/api/transaction/createKeyRotationTransaction.md diff --git a/doc/api/index.md b/doc/api/index.md index 3e098a9..21294cd 100644 --- a/doc/api/index.md +++ b/doc/api/index.md @@ -36,8 +36,9 @@ Following endpoints are available on EON node: [/transaction/allForgingStakes] (/doc/api/transaction/allForgingStakes.md) [/transaction/myForgingStakes] (/doc/api/transaction/myForgingStakes.md) [/transaction/openForgerList] (/doc/api/transaction/openForgerList.md) -[/transaction/allowedForgerList] (/doc/api/transaction/allowedForgerList.md) -[/transaction/createKeyRotationTransaction] (/doc/api/transaction/createKeyRotationTransaction.md) + +[/transaction/allowedForgerList](/doc/api/transaction/allowedForgerList.md)\ +[/transaction/createKeyRotationTransaction](/doc/api/transaction/createKeyRotationTransaction.md) [/transaction/invokeProxyCall] (/doc/api/transaction/invokeProxyCall.md) [/transaction/invokeProxyStaticCall] (/doc/api/transaction/invokeProxyStaticCall.md) diff --git a/doc/api/transaction/allowedForgerList.md b/doc/api/transaction/allowedForgerList.md new file mode 100644 index 0000000..d3825a1 --- /dev/null +++ b/doc/api/transaction/allowedForgerList.md @@ -0,0 +1,46 @@ +[< EON API Documentation](/doc/api/index.md) +### transaction/allowedForgerList + +Returns the list of the initial allowed forgers, tracking also their votes to open the forgers' list (when the majority have voted to open forging, everyone will be allowed to forge). + +**Parameters** + +No parameters + +**Example request** + + curl -sX POST 'http://127.0.0.1:9085/transaction/allowedForgerList' -H 'Content-Type: application/json' -H 'accept: application/json' + +**Example response** + + { + "result" : { + "allowedForgers" : [ { + "blockSign" : { + "publicKey" : "041e38dc04de208df1c05eeee8a91b92e4336e11f5113b6505dd745df417b4ae" + }, + "vrfPubKey" : { + "publicKey" : "a6b64b0b6eff71b6514d9893d730664ef2297302db4f86e32280f270b5e4370a00" + }, + "openForgersVote" : 1 + }, { + "blockSign" : { + "publicKey" : "0ca238f98dcedcca505e75c31124a298b4dd050c51e50a8b9ad2faaeed29e541" + }, + "vrfPubKey" : { + "publicKey" : "0cccfd640ac53ceba44ca5bfd5b1f8bdb7323969e474a7886496a9762dc01e3d80" + }, + "openForgersVote" : 1 + }, + { + "blockSign" : { + "publicKey" : "5e64c00f26a66e43029240a502417cfadee5caebbfc10d32bfe475d1215e80af" + }, + "vrfPubKey" : { + "publicKey" : "5b4293e3e9dd823d512409bd70ec41802466d92420c6ae944ffe7e388532c21200" + }, + "openForgersVote" : 0 + } + ] + } + } \ No newline at end of file diff --git a/doc/api/transaction/createKeyRotationTransaction.md b/doc/api/transaction/createKeyRotationTransaction.md new file mode 100644 index 0000000..c081f41 --- /dev/null +++ b/doc/api/transaction/createKeyRotationTransaction.md @@ -0,0 +1,36 @@ +[< EON API Documentation](/doc/api/index.md) +### transaction/createKeyRotationTransaction + +Creates and signs sidechain transaction for signers or masters certificate submitter key rotation.\n +If automaticSend is set to true, it validates and sends the transaction, then returns its id. +Otherwise, it returns the new transaction as a hex string if format = false, otherwise its JSON representation. + +**Parameters** + +See reuquest body below. + + +**Example request** + + curl -sX POST 'http://127.0.0.1:9085/transaction/createKeyRotationTransaction' -H 'Content-Type: application/json' -H 'accept: application/json' -d 'xxxxxx' + +The request body format is like this: + + { + "keyType": 0, //Key type - 0 for signers key, 1 for masters key + "keyIndex": 0, //Index of certificate submitter key + "newKey": "xxxxxxxxxxxx", + "signingKeySignature": "xxxxxxxxxxxxxx", + "masterKeySignature": "xxxxxxxxxxxxxxxxxx", + "newKeySignature": "xxxxxxxxxxxxxxxxxxxxxxxx", + "nonce": 0, + "gasInfo": { + "gasLimit": 10000, + "maxFeePerGas": 100, + "maxPriorityFeePerGas": 100 + } + } + +**Example response** + + \ No newline at end of file From c829be3efefe60bf4b9fc366e223f1b393ae7ba8 Mon Sep 17 00:00:00 2001 From: paolocappelletti Date: Tue, 24 Oct 2023 16:46:31 +0200 Subject: [PATCH 15/27] fix typo --- doc/api/transaction/createKeyRotationTransaction.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/doc/api/transaction/createKeyRotationTransaction.md b/doc/api/transaction/createKeyRotationTransaction.md index c081f41..79ebb3a 100644 --- a/doc/api/transaction/createKeyRotationTransaction.md +++ b/doc/api/transaction/createKeyRotationTransaction.md @@ -1,9 +1,7 @@ [< EON API Documentation](/doc/api/index.md) ### transaction/createKeyRotationTransaction -Creates and signs sidechain transaction for signers or masters certificate submitter key rotation.\n -If automaticSend is set to true, it validates and sends the transaction, then returns its id. -Otherwise, it returns the new transaction as a hex string if format = false, otherwise its JSON representation. +Creates and signs sidechain transaction for signers or masters certificate submitter key rotation. **Parameters** From 221914b5f647eba320afdf3dea9f77ec95a43d02 Mon Sep 17 00:00:00 2001 From: paolocappelletti Date: Tue, 24 Oct 2023 17:15:10 +0200 Subject: [PATCH 16/27] more endpoints documentation --- doc/api/index.md | 7 ++-- .../transaction/createEIP1559Transaction.md | 35 +++++++++++++++++++ .../createKeyRotationTransaction.md | 8 +++-- .../createLegacyEIP155Transaction.md | 35 +++++++++++++++++++ .../transaction/createLegacyTransaction.md | 35 +++++++++++++++++++ 5 files changed, 115 insertions(+), 5 deletions(-) create mode 100644 doc/api/transaction/createEIP1559Transaction.md create mode 100644 doc/api/transaction/createLegacyEIP155Transaction.md create mode 100644 doc/api/transaction/createLegacyTransaction.md diff --git a/doc/api/index.md b/doc/api/index.md index 21294cd..45ba3df 100644 --- a/doc/api/index.md +++ b/doc/api/index.md @@ -19,9 +19,10 @@ Following endpoints are available on EON node: ## Transaction endpoints -[/transaction/createLegacyEIP155Transaction] (/doc/api/transaction/createLegacyEIP155Transaction.md) -[/transaction/createEIP1559Transaction] (/doc/api/transaction/createEIP1559Transaction.md) -[/transaction/createLegacyTransaction] (/doc/api/transaction/createLegacyTransaction.md) +[/transaction/createLegacyEIP155Transaction](/doc/api/transaction/createLegacyEIP155Transaction.md)\ +[/transaction/createEIP1559Transaction](/doc/api/transaction/createEIP1559Transaction.md) +[/transaction/createLegacyTransaction](/doc/api/transaction/createLegacyTransaction.md) + [/transaction/sendTransaction] (/doc/api/transaction/sendTransaction.md) [/transaction/signTransaction] (/doc/api/transaction/signTransaction.md) [/transaction/decodeTransactionBytes] (/doc/api/transaction/decodeTransactionBytes.md) diff --git a/doc/api/transaction/createEIP1559Transaction.md b/doc/api/transaction/createEIP1559Transaction.md new file mode 100644 index 0000000..eb30714 --- /dev/null +++ b/doc/api/transaction/createEIP1559Transaction.md @@ -0,0 +1,35 @@ +[< EON API Documentation](/doc/api/index.md) +### transaction/createEIP1559Transaction + +Creates and signs an EIP155 transaction. +These are the new type2 version standard ethereum transactions with also priority fee and gasTip with replay protection. + +**Parameters** + +See request body below. + +**Example request** + + curl -sX POST 'http://127.0.0.1:9085/transaction/createEIP1559Transaction' -H 'Content-Type: application/json' -H 'accept: application/json' -d + +The request body format is like this: + +{ + "from": fromAddress, + "to": toAddress, + "nonce": nonce, + "gasLimit": gasLimit, + "maxPriorityFeePerGas": maxPriorityFeePerGas, + "maxFeePerGas": maxFeePerGas, + "value": value, + "data": data, + "signature_v": signature_v, + "signature_r": signature_r, + "signature_s": signature_s + } + +**Example response** + +{ + "transactionId": "xxxxxxxxxxxxxxxxx" +} \ No newline at end of file diff --git a/doc/api/transaction/createKeyRotationTransaction.md b/doc/api/transaction/createKeyRotationTransaction.md index 79ebb3a..4497332 100644 --- a/doc/api/transaction/createKeyRotationTransaction.md +++ b/doc/api/transaction/createKeyRotationTransaction.md @@ -5,12 +5,12 @@ Creates and signs sidechain transaction for signers or masters certificate submi **Parameters** -See reuquest body below. +See request body below. **Example request** - curl -sX POST 'http://127.0.0.1:9085/transaction/createKeyRotationTransaction' -H 'Content-Type: application/json' -H 'accept: application/json' -d 'xxxxxx' + curl -sX POST 'http://127.0.0.1:9085/transaction/createKeyRotationTransaction' -H 'Content-Type: application/json' -H 'accept: application/json' -d 'requestBody' The request body format is like this: @@ -31,4 +31,8 @@ The request body format is like this: **Example response** +{ + "transactionId": "xxxxxxxxxxxxxxxxx" +} + \ No newline at end of file diff --git a/doc/api/transaction/createLegacyEIP155Transaction.md b/doc/api/transaction/createLegacyEIP155Transaction.md new file mode 100644 index 0000000..67c1866 --- /dev/null +++ b/doc/api/transaction/createLegacyEIP155Transaction.md @@ -0,0 +1,35 @@ +[< EON API Documentation](/doc/api/index.md) +### transaction/createLegacyEIP155Transaction + +Creates and signs a legacy EIP155 transaction. +These are the type0 "old" legacy version ethereum transactions with replay protection. + +**Parameters** + +See request body below. + +**Example request** + + curl -sX POST 'http://127.0.0.1:9085/transaction/createLegacyEIP155Transaction' -H 'Content-Type: application/json' -H 'accept: application/json' -d + +The request body format is like this: + + { + "from": fromAddress, + "to": toAddress, + "nonce": nonce, + "gasLimit": gasLimit, + "gasPrice": gasPrice, + "value": value, + "data": data, + "signature_v": signature_v, + "signature_r": signature_r, + "signature_s": signature_s, + "outputRawBytes": true + } + +**Example response** + +{ + "transactionId": "xxxxxxxxxxxxxxxxx" +} \ No newline at end of file diff --git a/doc/api/transaction/createLegacyTransaction.md b/doc/api/transaction/createLegacyTransaction.md new file mode 100644 index 0000000..fb5c40b --- /dev/null +++ b/doc/api/transaction/createLegacyTransaction.md @@ -0,0 +1,35 @@ +[< EON API Documentation](/doc/api/index.md) +### transaction/createLegacyTransaction + +Creates and signs a legacy transaction. +These are the type0 "old" legacy version ethereum transactions without replay protection. + +**Parameters** + +See request body below. + +**Example request** + + curl -sX POST 'http://127.0.0.1:9085/transaction/createLegacyTransaction' -H 'Content-Type: application/json' -H 'accept: application/json' -d + +The request body format is like this: + + { + "from": fromAddress, + "to": toAddress, + "nonce": nonce, + "gasLimit": gasLimit, + "gasPrice": gasPrice, + "value": value, + "data": data, + "signature_v": signature_v, + "signature_r": signature_r, + "signature_s": signature_s, + "outputRawBytes": true + } + +**Example response** + +{ + "transactionId": "xxxxxxxxxxxxxxxxx" +} \ No newline at end of file From 453526e5314716723cfdaab23d0f8d7d9c4dae27 Mon Sep 17 00:00:00 2001 From: paolocappelletti Date: Tue, 24 Oct 2023 17:16:34 +0200 Subject: [PATCH 17/27] fix index.md --- doc/api/index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/api/index.md b/doc/api/index.md index 45ba3df..e2df672 100644 --- a/doc/api/index.md +++ b/doc/api/index.md @@ -20,8 +20,8 @@ Following endpoints are available on EON node: ## Transaction endpoints [/transaction/createLegacyEIP155Transaction](/doc/api/transaction/createLegacyEIP155Transaction.md)\ -[/transaction/createEIP1559Transaction](/doc/api/transaction/createEIP1559Transaction.md) -[/transaction/createLegacyTransaction](/doc/api/transaction/createLegacyTransaction.md) +[/transaction/createEIP1559Transaction](/doc/api/transaction/createEIP1559Transaction.md)\ +[/transaction/createLegacyTransaction](/doc/api/transaction/createLegacyTransaction.md) [/transaction/sendTransaction] (/doc/api/transaction/sendTransaction.md) [/transaction/signTransaction] (/doc/api/transaction/signTransaction.md) From efcc002436e8ea094377bdfa7017b62977552116 Mon Sep 17 00:00:00 2001 From: paolocappelletti Date: Thu, 16 Nov 2023 12:02:45 +0100 Subject: [PATCH 18/27] add more documentation --- doc/api/ethv1/index.md | 31 +++++++++++ doc/api/index.md | 51 +++++++++++------- doc/api/transaction/allForgingStakes.md | 50 +++++++++++++++++ doc/api/transaction/allowedForgerList.md | 2 +- doc/api/transaction/createSmartContract.md | 30 +++++++++++ doc/api/transaction/decodeTransactionBytes.md | 23 ++++++++ .../transaction/getKeysOwnerScAddresses.md | 20 +++++++ doc/api/transaction/getKeysOwnership.md | 25 +++++++++ doc/api/transaction/makeForgerStake.md | 31 +++++++++++ doc/api/transaction/myForgingStakes.md | 50 +++++++++++++++++ doc/api/transaction/openForgerList.md | 40 ++++++++++++++ doc/api/transaction/removeKeysOwnership.md | 50 +++++++++++++++++ doc/api/transaction/sendKeysOwnership.md | 54 +++++++++++++++++++ doc/api/transaction/sendTransaction.md | 25 +++++++++ doc/api/transaction/signTransaction.md | 24 +++++++++ doc/api/transaction/spendForgingStake.md | 24 +++++++++ 16 files changed, 510 insertions(+), 20 deletions(-) create mode 100644 doc/api/ethv1/index.md create mode 100644 doc/api/transaction/allForgingStakes.md create mode 100644 doc/api/transaction/createSmartContract.md create mode 100644 doc/api/transaction/decodeTransactionBytes.md create mode 100644 doc/api/transaction/getKeysOwnerScAddresses.md create mode 100644 doc/api/transaction/getKeysOwnership.md create mode 100644 doc/api/transaction/makeForgerStake.md create mode 100644 doc/api/transaction/myForgingStakes.md create mode 100644 doc/api/transaction/openForgerList.md create mode 100644 doc/api/transaction/removeKeysOwnership.md create mode 100644 doc/api/transaction/sendKeysOwnership.md create mode 100644 doc/api/transaction/sendTransaction.md create mode 100644 doc/api/transaction/signTransaction.md create mode 100644 doc/api/transaction/spendForgingStake.md diff --git a/doc/api/ethv1/index.md b/doc/api/ethv1/index.md new file mode 100644 index 0000000..da78e1a --- /dev/null +++ b/doc/api/ethv1/index.md @@ -0,0 +1,31 @@ +[< EON API Documentation](/doc/api/index.md) +### /ethv1 + +Executes Ethereum RPC compatible methods.\ +Returns the success / error response of called RPC method or error if method does not exist.\ +The request/response objects format follows JSON-RPC 2.0 specification. + +For more info on the available RPC commands, you can look at:\ +[https://postman.horizenlabs.io/](https://postman.horizenlabs.io/) + + +**Example request** + + curl --request POST 'http://127.0.0.1:9085/ethv1' \ + --header 'Accept: application/json' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "jsonrpc":"2.0", + "method":"eth_getBalance", + "params":["0xdd270b03A04A06A4432F0eDEbcFE1e0C640bc55d"], + "id":1 + }' + + +**Example response** + + { + "jsonrpc" : "2.0", + "id" : 1, + "result" : "0x0" + } \ No newline at end of file diff --git a/doc/api/index.md b/doc/api/index.md index e2df672..70280e0 100644 --- a/doc/api/index.md +++ b/doc/api/index.md @@ -3,6 +3,10 @@ Following endpoints are available on EON node: +## Ethereum RPC commands + +[/ethv1](/doc/api/ethv1/index.md) + ## Blocks endpoints [/block/findById](/doc/api/block/findById.md)\ [/block/findLastIds](/doc/api/block/findLastIds.md)\ @@ -19,34 +23,43 @@ Following endpoints are available on EON node: ## Transaction endpoints + [/transaction/createLegacyEIP155Transaction](/doc/api/transaction/createLegacyEIP155Transaction.md)\ [/transaction/createEIP1559Transaction](/doc/api/transaction/createEIP1559Transaction.md)\ -[/transaction/createLegacyTransaction](/doc/api/transaction/createLegacyTransaction.md) +[/transaction/createLegacyTransaction](/doc/api/transaction/createLegacyTransaction.md)\ +[/transaction/sendTransaction](/doc/api/transaction/sendTransaction.md)\ +[/transaction/signTransaction](/doc/api/transaction/signTransaction.md)\ +[/transaction/decodeTransactionBytes](/doc/api/transaction/decodeTransactionBytes.md)\ +[/transaction/createSmartContract](/doc/api/transaction/createSmartContract.md)\ +[/transaction/allTransactions](/doc/api/transaction/allTransactions.md) -[/transaction/sendTransaction] (/doc/api/transaction/sendTransaction.md) -[/transaction/signTransaction] (/doc/api/transaction/signTransaction.md) -[/transaction/decodeTransactionBytes] (/doc/api/transaction/decodeTransactionBytes.md) -[/transaction/createSmartContract] (/doc/api/transaction/createSmartContract.md) +#### Backward transfers: -[/transaction/allTransactions](/doc/api/transaction/allTransactions.md)\ [/transaction/withdrawCoins](/doc/api/transaction/withdrawCoins.md)\ [/transaction/allWithdrawalRequests](/doc/api/transaction/allWithdrawalRequests.md) -[/transaction/makeForgerStake] (/doc/api/transaction/makeForgerStake.md) -[/transaction/spendForgingStake] (/doc/api/transaction/spendForgingStake.md) -[/transaction/allForgingStakes] (/doc/api/transaction/allForgingStakes.md) -[/transaction/myForgingStakes] (/doc/api/transaction/myForgingStakes.md) -[/transaction/openForgerList] (/doc/api/transaction/openForgerList.md) +#### Forge stakes management: -[/transaction/allowedForgerList](/doc/api/transaction/allowedForgerList.md)\ -[/transaction/createKeyRotationTransaction](/doc/api/transaction/createKeyRotationTransaction.md) +[/transaction/makeForgerStake](/doc/api/transaction/makeForgerStake.md)\ +[/transaction/spendForgingStake](/doc/api/transaction/spendForgingStake.md)\ +[/transaction/allForgingStakes](/doc/api/transaction/allForgingStakes.md)\ +[/transaction/myForgingStakes](/doc/api/transaction/myForgingStakes.md) + +#### Restricted forgers management: -[/transaction/invokeProxyCall] (/doc/api/transaction/invokeProxyCall.md) -[/transaction/invokeProxyStaticCall] (/doc/api/transaction/invokeProxyStaticCall.md) -[/transaction/sendKeysOwnership] (/doc/api/transaction/sendKeysOwnership.md) -[/transaction/getKeysOwnership] (/doc/api/transaction/getKeysOwnership.md) -[/transaction/removeKeysOwnership] (/doc/api/transaction/removeKeysOwnership.md) -[/transaction/getKeysOwnerScAddresses] (/doc/api/transaction/getKeysOwnerScAddresses.md) +[/transaction/openForgerList](/doc/api/transaction/openForgerList.md)\ +[/transaction/allowedForgerList](/doc/api/transaction/allowedForgerList.md) + +#### ZENDao related: + +[/transaction/sendKeysOwnership](/doc/api/transaction/sendKeysOwnership.md)\ +[/transaction/getKeysOwnership](/doc/api/transaction/getKeysOwnership.md)\ +[/transaction/removeKeysOwnership](/doc/api/transaction/removeKeysOwnership.md)\ +[/transaction/getKeysOwnerScAddresses](/doc/api/transaction/getKeysOwnerScAddresses.md) + +#### Key rotation: + +[/transaction/createKeyRotationTransaction](/doc/api/transaction/createKeyRotationTransaction.md) ## Wallet endpoints diff --git a/doc/api/transaction/allForgingStakes.md b/doc/api/transaction/allForgingStakes.md new file mode 100644 index 0000000..b43c36b --- /dev/null +++ b/doc/api/transaction/allForgingStakes.md @@ -0,0 +1,50 @@ +[< EON API Documentation](/doc/api/index.md) +### transaction/allForgingStakes + +Returns all forging stakes. + + +**Example request** + + curl -sX POST 'http://127.0.0.1:9085/transaction/allForgingStakes' -H 'Content-Type: application/json' -H 'accept: application/json' + + +**Example response** + +{ + "result" : { + "stakes" : [ { + "stakeId" : "15f8f1054ae53bd707078248ce44d434b975dbdd250af65b21b6be4b4e601021", + "forgerStakeData" : { + "forgerPublicKeys" : { + "blockSignPublicKey" : { + "publicKey" : "10e9b5236a56cddb9f0332e9dd6d69151494f24172b26ab24a27473bbc92a181" + }, + "vrfPublicKey" : { + "publicKey" : "6a376f8a88b386f69296baa0792641d393c85a19b28dfd4a11d8f0a74618873280" + } + }, + "ownerPublicKey" : { + "address" : "62b1bc6fd237b775138d910274ff2911d7aea5cc" + }, + "stakedAmount" : 1000000000000000000 + } + }, { + "stakeId" : "f62dcc5facc6440d6da2f7b927c6440e9bcb643817a12bf733e5304cd655ecd9", + "forgerStakeData" : { + "forgerPublicKeys" : { + "blockSignPublicKey" : { + "publicKey" : "10e9b5236a56cddb9f0332e9dd6d69151494f24172b26ab24a27473bbc92a181" + }, + "vrfPublicKey" : { + "publicKey" : "6a376f8a88b386f69296baa0792641d393c85a19b28dfd4a11d8f0a74618873280" + } + }, + "ownerPublicKey" : { + "address" : "62b1bc6fd237b775138d910274ff2911d7aea5cc" + }, + "stakedAmount" : 99000000000000000000 + } + }] + } +} \ No newline at end of file diff --git a/doc/api/transaction/allowedForgerList.md b/doc/api/transaction/allowedForgerList.md index d3825a1..1b9b819 100644 --- a/doc/api/transaction/allowedForgerList.md +++ b/doc/api/transaction/allowedForgerList.md @@ -1,7 +1,7 @@ [< EON API Documentation](/doc/api/index.md) ### transaction/allowedForgerList -Returns the list of the initial allowed forgers, tracking also their votes to open the forgers' list (when the majority have voted to open forging, everyone will be allowed to forge). +Returns the list of the initial allowed forgers, tracking also their votes to open the forgers' list (when the majority have voted to open forging, everyone will be allowed to stake and partecipate in forging). **Parameters** diff --git a/doc/api/transaction/createSmartContract.md b/doc/api/transaction/createSmartContract.md new file mode 100644 index 0000000..0a2cfa8 --- /dev/null +++ b/doc/api/transaction/createSmartContract.md @@ -0,0 +1,30 @@ +[< EON API Documentation](/doc/api/index.md) +### transaction/createSmartContract + +Creates and send a transaction that deploys a smart contract. + +**Parameters** + +| Name | Type | Required | Description | +| -------- | ------- | ------- | ------- | +| nonce | integer | no | Optional field, if not specified the expected nonce from the state is used | +| contractCode | string | yes | HexString represantation of the compiled contract bytes | + +Parameters of the gasInfo object (optional): + +| Name | Type | Required | Description | +| -------- | ------- | ------- | ------- | +| gasLimit | biginteger | yes | GAS limit | +| maxPriorityFeePerGas | biginteger | yes | Max priority fee| +| maxFeePerGas | biginteger | yes | Max fee per gas | + +**Example request** + + curl -sX POST 'http://127.0.0.1:9085/transaction/createSmartContract' -H 'Content-Type: application/json' -H 'accept: application/json' -d '{"contractCode": "0x.........022", gasInfo: {.....}}' + + +**Example response** + + { + "transactionId": "xxxxxxxxxxxxxxxxx" + } \ No newline at end of file diff --git a/doc/api/transaction/decodeTransactionBytes.md b/doc/api/transaction/decodeTransactionBytes.md new file mode 100644 index 0000000..6f42d6d --- /dev/null +++ b/doc/api/transaction/decodeTransactionBytes.md @@ -0,0 +1,23 @@ +[< EON API Documentation](/doc/api/index.md) +### transaction/decodeTransactionBytes + +Returns a JSON representation of a transaction given its byte serialization. + +**Parameters** + +| Name | Type | Required | Description | +| -------- | ------- | ------- | ------- | +| transactionBytes | String | yes | HexString represantation of the bytes to decode | + + + +**Example request** + + curl -sX POST 'http://127.0.0.1:9085/transaction/decodeTransactionBytes' -H 'Content-Type: application/json' -H 'accept: application/json' -d '{"transactionBytes": "0x.........022"}' + + +**Example response** + + { + transaction: ...... + } \ No newline at end of file diff --git a/doc/api/transaction/getKeysOwnerScAddresses.md b/doc/api/transaction/getKeysOwnerScAddresses.md new file mode 100644 index 0000000..c02d8d6 --- /dev/null +++ b/doc/api/transaction/getKeysOwnerScAddresses.md @@ -0,0 +1,20 @@ +[< EON API Documentation](/doc/api/index.md) +### transaction/getKeysOwnerScAddresses + +Return the list of all EON sidechain addresses that have at least one mainchain associated. +This function is used for voting pourposes in ZENDAO. + +**Parameters** + +No parameter needed. + + +**Example request** + + curl -sX POST 'http://127.0.0.1:9085/transaction/getKeysOwnerScAddresses' -H 'Content-Type: application/json' -H 'accept: application/json' + +**Example response** + + { + "owners": ["", "", ...] + } \ No newline at end of file diff --git a/doc/api/transaction/getKeysOwnership.md b/doc/api/transaction/getKeysOwnership.md new file mode 100644 index 0000000..691882d --- /dev/null +++ b/doc/api/transaction/getKeysOwnership.md @@ -0,0 +1,25 @@ +[< EON API Documentation](/doc/api/index.md) +### transaction/getKeysOwnership + +Return the list of Horizen mainchain addresses associated to a given EON sidechain addres.\ +This function is used for voting pourposes in ZENDAO. + +**Parameters** + +| Name | Type | Required | Description | +| -------- | ------- | ------- | ------- | +| scAddressOpt | String | no | EON address to look. If omitted, all the mainchain associations are returned | + + + +**Example request** + + curl -sX POST 'http://127.0.0.1:9085/transaction/getKeysOwnership' -H 'Content-Type: application/json' -H 'accept: application/json' -d '{"scAddressOpt":""}' + +**Example response** + + { + "keysOwnership": { + "": ["", "", ...] + } + } \ No newline at end of file diff --git a/doc/api/transaction/makeForgerStake.md b/doc/api/transaction/makeForgerStake.md new file mode 100644 index 0000000..7bde296 --- /dev/null +++ b/doc/api/transaction/makeForgerStake.md @@ -0,0 +1,31 @@ +[< EON API Documentation](/doc/api/index.md) +### transaction/makeForgerStake + +Creates and signs a transaction to create a forger stake.\ +Can be performed by both the forger and by other delegators. + +**Parameters** + +See request body below. + +**Example request** + + curl -sX POST 'http://127.0.0.1:9085/transaction/makeForgerStake' -H 'Content-Type: application/json' -H 'accept: application/json' -d + +The request body format is like this: + + { + "forgerStakeInfo": { + "ownerAddress": owner_address, //this will be the address allowed to spend the forge stake lately + "blockSignPublicKey": blockSignPubKey, //together with vrfPubKey identifies the forger + "vrfPubKey": vrf_public_key, + "value": amount // in zentoshi + }, + "nonce": nonce + } + +**Example response** + +{ + "transactionId": "xxxxxxxxxxxxxxxxx" +} \ No newline at end of file diff --git a/doc/api/transaction/myForgingStakes.md b/doc/api/transaction/myForgingStakes.md new file mode 100644 index 0000000..9128335 --- /dev/null +++ b/doc/api/transaction/myForgingStakes.md @@ -0,0 +1,50 @@ +[< EON API Documentation](/doc/api/index.md) +### transaction/myForgingStakes + +Returns the forging stakes belonging to keys contained in the node wallet. + + +**Example request** + + curl -sX POST 'http://127.0.0.1:9085/transaction/myForgingStakes' -H 'Content-Type: application/json' -H 'accept: application/json' + + +**Example response** + +{ + "result" : { + "stakes" : [ { + "stakeId" : "15f8f1054ae53bd707078248ce44d434b975dbdd250af65b21b6be4b4e601021", + "forgerStakeData" : { + "forgerPublicKeys" : { + "blockSignPublicKey" : { + "publicKey" : "10e9b5236a56cddb9f0332e9dd6d69151494f24172b26ab24a27473bbc92a181" + }, + "vrfPublicKey" : { + "publicKey" : "6a376f8a88b386f69296baa0792641d393c85a19b28dfd4a11d8f0a74618873280" + } + }, + "ownerPublicKey" : { + "address" : "62b1bc6fd237b775138d910274ff2911d7aea5cc" + }, + "stakedAmount" : 1000000000000000000 + } + }, { + "stakeId" : "f62dcc5facc6440d6da2f7b927c6440e9bcb643817a12bf733e5304cd655ecd9", + "forgerStakeData" : { + "forgerPublicKeys" : { + "blockSignPublicKey" : { + "publicKey" : "10e9b5236a56cddb9f0332e9dd6d69151494f24172b26ab24a27473bbc92a181" + }, + "vrfPublicKey" : { + "publicKey" : "6a376f8a88b386f69296baa0792641d393c85a19b28dfd4a11d8f0a74618873280" + } + }, + "ownerPublicKey" : { + "address" : "62b1bc6fd237b775138d910274ff2911d7aea5cc" + }, + "stakedAmount" : 99000000000000000000 + } + }] + } +} \ No newline at end of file diff --git a/doc/api/transaction/openForgerList.md b/doc/api/transaction/openForgerList.md new file mode 100644 index 0000000..34aab9b --- /dev/null +++ b/doc/api/transaction/openForgerList.md @@ -0,0 +1,40 @@ +[< EON API Documentation](/doc/api/index.md) +### transaction/openForgerList + +Execute a transaction expressing the vote for opening the restricted forgers list. +This transaction is allowed only when the forgers are initially restricted, and can be executed only by one of the allowed forgers. Forger's keys of the voter must be present in the local wallet. +When the majority of the closed forgers have voted to open forging, everyone will be allowed to stake and partecipate in forging. + +**Parameters** + +| Name | Type | Required | Description | +| -------- | ------- | ------- | ------- | +| forgerIndex | integer | yes | Index (0-based) of the forger that is voting, referred to the allowed forgers list in the configuration file. Forger's keys of the voter must be present in the local wallet. | +| nonce | integer | no | Nonce associated to the address that is sending the tx. If omitted the next valid nonce will be calculated automatically. | +| gasInfo | object | no | Info about GAS | + +Parameters of the gasInfo object: + +| Name | Type | Required | Description | +| -------- | ------- | ------- | ------- | +| gasLimit | biginteger | yes | GAS limit | +| maxPriorityFeePerGas | biginteger | yes | Max priority fee| +| maxFeePerGas | biginteger | yes | Max fee per gas | + + +**Example request** + + curl -sX POST 'http://127.0.0.1:9085/transaction/openForgerList' -H 'Content-Type: application/json' -H 'accept: application/json' -d + +The request body format is like this: + + { + "forgerIndex": 2, + "nonce": nonce + } + +**Example response** + +{ + "transactionId": "xxxxxxxxxxxxxxxxx" +} \ No newline at end of file diff --git a/doc/api/transaction/removeKeysOwnership.md b/doc/api/transaction/removeKeysOwnership.md new file mode 100644 index 0000000..42a4658 --- /dev/null +++ b/doc/api/transaction/removeKeysOwnership.md @@ -0,0 +1,50 @@ +[< EON API Documentation](/doc/api/index.md) +### transaction/removeKeysOwnership + +Create and send a transaction to remove a previously created association between Horizen mainchain address and EON sidechain addres.\ +This function is used for voting pourposes in ZENDAO. + +**Parameters** + +| Name | Type | Required | Description | +| -------- | ------- | ------- | ------- | +| ownershipInfo | object | yes | Info about keys ownership (see below) | +| nonce | integer | no | Nonce associated to the address that is sending the tx. If omitted the next valid nonce will be calculated automatically. | +| gasInfo | object | no | Info about GAS | + +Parameters of the ownershipInfo object: + +| Name | Type | Required | Description | +| -------- | ------- | ------- | ------- | +| scAddress | String | yes | Sidechain address associated. The corresponding private key must be present in the local wallet | +| mcTransparentAddress | String | yes | Mainchain address| + + +Parameters of the gasInfo object: + +| Name | Type | Required | Description | +| -------- | ------- | ------- | ------- | +| gasLimit | biginteger | yes | GAS limit | +| maxPriorityFeePerGas | biginteger | yes | Max priority fee| +| maxFeePerGas | biginteger | yes | Max fee per gas | + + +**Example request** + + curl -sX POST 'http://127.0.0.1:9085/transaction/removeKeysOwnership' -H 'Content-Type: application/json' -H 'accept: application/json' -d + +The request body format is like this: + + { + "ownershipInfo": { + "scAddress": "......", + "mcTransparentAddress": "...." + } + "nonce": nonce + } + +**Example response** + + { + "transactionId": "xxxxxxxxxxxxxxxxx" + } \ No newline at end of file diff --git a/doc/api/transaction/sendKeysOwnership.md b/doc/api/transaction/sendKeysOwnership.md new file mode 100644 index 0000000..c34d707 --- /dev/null +++ b/doc/api/transaction/sendKeysOwnership.md @@ -0,0 +1,54 @@ +[< EON API Documentation](/doc/api/index.md) +### transaction/sendKeysOwnership + +Create and send a transaction to associate a Horizen mainchain address to one EON sidechain addres.\ +It internally performs the verification of the ownership of the mainchain address (a signature must be provided).\ +It can be called many times from the same EON address.\ +This function is used for voting pourposes in ZENDAO. + +**Parameters** + +| Name | Type | Required | Description | +| -------- | ------- | ------- | ------- | +| ownershipInfo | object | yes | Info about keys ownership (see below) | +| nonce | integer | no | Nonce associated to the address that is sending the tx. If omitted the next valid nonce will be calculated automatically. | +| gasInfo | object | no | Info about GAS | + +Parameters of the ownershipInfo object: + +| Name | Type | Required | Description | +| -------- | ------- | ------- | ------- | +| scAddress | String | yes | Sidechain address to associate. The corresponding private key must be present in the local wallet | +| mcTransparentAddress | String | yes | Mainchain address| +| mcSignature | String | yes | Signature generated with the private key associated to mcTransparentAddress of a message constituted by the previous scAddess (ownership proof of the mc address) | + + +Parameters of the gasInfo object: + +| Name | Type | Required | Description | +| -------- | ------- | ------- | ------- | +| gasLimit | biginteger | yes | GAS limit | +| maxPriorityFeePerGas | biginteger | yes | Max priority fee| +| maxFeePerGas | biginteger | yes | Max fee per gas | + + +**Example request** + + curl -sX POST 'http://127.0.0.1:9085/transaction/sendKeysOwnership' -H 'Content-Type: application/json' -H 'accept: application/json' -d + +The request body format is like this: + + { + "ownershipInfo": { + "scAddress": "......", + "mcTransparentAddress": "....", + "mcSignature": "...." + } + "nonce": nonce + } + +**Example response** + + { + "transactionId": "xxxxxxxxxxxxxxxxx" + } \ No newline at end of file diff --git a/doc/api/transaction/sendTransaction.md b/doc/api/transaction/sendTransaction.md new file mode 100644 index 0000000..a282c82 --- /dev/null +++ b/doc/api/transaction/sendTransaction.md @@ -0,0 +1,25 @@ +[< EON API Documentation](/doc/api/index.md) +### transaction/sendTransaction + +Validates and sends a transaction, given its serialization as input. Then returns the id of the transaction. + +**Parameters** + +| Name | Type | Required | Description | +| -------- | ------- | ------- | ------- | +| transactionBytes | String | yes | HexString represantation of the bytes to decode | + + + +**Example request** + + curl -sX POST 'http://127.0.0.1:9085/transaction/sendTransaction' -H 'Content-Type: application/json' -H 'accept: application/json' -d '{"transactionBytes": "0x.........022"}' + + +**Example response** + +{ + "transactionId": "xxxxxxxxxxxxxxxxx" +} + + diff --git a/doc/api/transaction/signTransaction.md b/doc/api/transaction/signTransaction.md new file mode 100644 index 0000000..32dd1f3 --- /dev/null +++ b/doc/api/transaction/signTransaction.md @@ -0,0 +1,24 @@ +[< EON API Documentation](/doc/api/index.md) +### transaction/signTransaction + +Decodes the input raw eth transaction bytes into an object, signs it using the input 'from' address and returns the resulting signed raw eth transaction bytes. + +**Parameters** + +| Name | Type | Required | Description | +| -------- | ------- | ------- | ------- | +| from | String | yes | Address to use for signing (privatekey must be present in local wallet) | +| transactionBytes | String | yes | HexString represantation of the bytes to decode | + + + +**Example request** + + curl -sX POST 'http://127.0.0.1:9085/transaction/sendTransaction' -H 'Content-Type: application/json' -H 'accept: application/json' -d '{"from": "....", "transactionBytes": "0x.........022"}' + + +**Example response** + +{ + "transactionBytes": "xxxxxxxxxxxxxxxxx" +} \ No newline at end of file diff --git a/doc/api/transaction/spendForgingStake.md b/doc/api/transaction/spendForgingStake.md new file mode 100644 index 0000000..89dcd6d --- /dev/null +++ b/doc/api/transaction/spendForgingStake.md @@ -0,0 +1,24 @@ +[< EON API Documentation](/doc/api/index.md) +### transaction/spendForgingStake + +Creates and signs a transaction to remove a forger stake and have ZEN back in the wallet. +Note: is not possible to remove partially a forging stake, all the stacked ZEN will be removed in a single transaction. + +**Parameters** + +| Name | Type | Required | Description | +| -------- | ------- | ------- | ------- | +| stakeId | string | yes | Id of the stake to be removed | +| nonce | string | no | | +| gasInfo | object | no | | + +**Example request** + + curl -sX POST 'http://127.0.0.1:9085/transaction/spendForgingStake' -H 'Content-Type: application/json' -H 'accept: application/json' -d '{"stakeId": "xxxxx"}' + + +**Example response** + + { + "transactionId": "xxxxxxxxxxxxxxxxx" + } \ No newline at end of file From 7c9eb98b7bd7f0fd09751448b99797361b0501db Mon Sep 17 00:00:00 2001 From: paolocappelletti Date: Thu, 16 Nov 2023 14:14:49 +0100 Subject: [PATCH 19/27] more documentation --- doc/api/block/best.md | 2 +- doc/api/block/findIdByHeight.md | 4 ++-- doc/api/block/generate.md | 4 ++-- doc/api/block/getFeePayments.md | 4 ++-- doc/api/block/getForwardTransfers.md | 3 ++- doc/api/block/startForging.md | 3 ++- doc/api/block/stopForging.md | 2 +- doc/api/transaction/createEIP1559Transaction.md | 4 ++-- .../transaction/createLegacyEIP155Transaction.md | 2 +- doc/api/transaction/createLegacyTransaction.md | 2 +- doc/api/transaction/spendForgingStake.md | 14 +++++++++++--- 11 files changed, 27 insertions(+), 17 deletions(-) diff --git a/doc/api/block/best.md b/doc/api/block/best.md index 747e1b0..d4f5208 100644 --- a/doc/api/block/best.md +++ b/doc/api/block/best.md @@ -1,7 +1,7 @@ [< EON API Documentation](/doc/api/index.md) ### block/best -Returns best sidechain block id and height in active chain +Returns best sidechain block and height in active chain **Parameters** diff --git a/doc/api/block/findIdByHeight.md b/doc/api/block/findIdByHeight.md index 3ab2417..96685a6 100644 --- a/doc/api/block/findIdByHeight.md +++ b/doc/api/block/findIdByHeight.md @@ -1,7 +1,7 @@ -[< EON API Documentation](/doc/api/findIdByHeight.md) +[< EON API Documentation](/doc/api/index.md) ### block/findIdByHeight -Returns a sidechain block Id by its height in the blockchain +Returns a sidechain block Id by its height in the active chain **Parameters** diff --git a/doc/api/block/generate.md b/doc/api/block/generate.md index c879ce2..be40846 100644 --- a/doc/api/block/generate.md +++ b/doc/api/block/generate.md @@ -1,8 +1,8 @@ [< EON API Documentation](/doc/api/index.md) ### block/generate -Tries to generate new block by epoch and slot number. Returns id of generated sidechain block. -**This endpoint can be used only in REGTEST mode** +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** diff --git a/doc/api/block/getFeePayments.md b/doc/api/block/getFeePayments.md index 63c339b..edc213c 100644 --- a/doc/api/block/getFeePayments.md +++ b/doc/api/block/getFeePayments.md @@ -1,8 +1,8 @@ [< EON API Documentation](/doc/api/index.md) ### block/getFeePayments -Returns info on the fee redistributed to forgers, at the end of each withdrawal epoch. -**This endpoint returns a non-empty result only for the last block of each withrawal epoch.** +Returns info on the fee redistributed to forgers at the specific block id.\ +**This endpoint returns a non-empty result only for the last block of each withrawal epoch (because fees are redistributed only there).** **Parameters** diff --git a/doc/api/block/getForwardTransfers.md b/doc/api/block/getForwardTransfers.md index 52674f1..3185644 100644 --- a/doc/api/block/getForwardTransfers.md +++ b/doc/api/block/getForwardTransfers.md @@ -1,7 +1,8 @@ [< EON API Documentation](/doc/api/index.md) ### block/getForwardTransfers -Returns info on the forward transfer included a specific block (if any). +Returns info on the forward transfer included a specific block (if any).\n +A forward transfer is a transfer of ZEN originated from the mainchain. **Parameters** diff --git a/doc/api/block/startForging.md b/doc/api/block/startForging.md index 55cde92..7341b9f 100644 --- a/doc/api/block/startForging.md +++ b/doc/api/block/startForging.md @@ -1,7 +1,8 @@ [< EON API Documentation](/doc/api/index.md) ### block/startForging -Start forging activity. +Start forging activity: the node will start to partecipate at the forgers lottery on every slot.\n +The probability of being elected as forge leader and being able to propose a block is proportional to the owned stake. **Parameters** diff --git a/doc/api/block/stopForging.md b/doc/api/block/stopForging.md index 466bd3b..3a3272d 100644 --- a/doc/api/block/stopForging.md +++ b/doc/api/block/stopForging.md @@ -1,7 +1,7 @@ [< EON API Documentation](/doc/api/index.md) ### block/stopForging -Stop forging activity. +Stop forging activity: the node will end to partecipate at the forgers lottery on every slot.\n **Parameters** diff --git a/doc/api/transaction/createEIP1559Transaction.md b/doc/api/transaction/createEIP1559Transaction.md index eb30714..fc0035f 100644 --- a/doc/api/transaction/createEIP1559Transaction.md +++ b/doc/api/transaction/createEIP1559Transaction.md @@ -1,8 +1,8 @@ [< EON API Documentation](/doc/api/index.md) ### transaction/createEIP1559Transaction -Creates and signs an EIP155 transaction. -These are the new type2 version standard ethereum transactions with also priority fee and gasTip with replay protection. +Creates and signs an EIP155 transaction.\ +These are the new type2 version standard ethereum transactions with also priority fee and gasTip and with replay protection. **Parameters** diff --git a/doc/api/transaction/createLegacyEIP155Transaction.md b/doc/api/transaction/createLegacyEIP155Transaction.md index 67c1866..27c01d4 100644 --- a/doc/api/transaction/createLegacyEIP155Transaction.md +++ b/doc/api/transaction/createLegacyEIP155Transaction.md @@ -1,7 +1,7 @@ [< EON API Documentation](/doc/api/index.md) ### transaction/createLegacyEIP155Transaction -Creates and signs a legacy EIP155 transaction. +Creates and signs a legacy EIP155 transaction.\ These are the type0 "old" legacy version ethereum transactions with replay protection. **Parameters** diff --git a/doc/api/transaction/createLegacyTransaction.md b/doc/api/transaction/createLegacyTransaction.md index fb5c40b..a293bc1 100644 --- a/doc/api/transaction/createLegacyTransaction.md +++ b/doc/api/transaction/createLegacyTransaction.md @@ -1,7 +1,7 @@ [< EON API Documentation](/doc/api/index.md) ### transaction/createLegacyTransaction -Creates and signs a legacy transaction. +Creates and signs a legacy transaction.\ These are the type0 "old" legacy version ethereum transactions without replay protection. **Parameters** diff --git a/doc/api/transaction/spendForgingStake.md b/doc/api/transaction/spendForgingStake.md index 89dcd6d..27b3c17 100644 --- a/doc/api/transaction/spendForgingStake.md +++ b/doc/api/transaction/spendForgingStake.md @@ -1,17 +1,25 @@ [< EON API Documentation](/doc/api/index.md) ### transaction/spendForgingStake -Creates and signs a transaction to remove a forger stake and have ZEN back in the wallet. -Note: is not possible to remove partially a forging stake, all the stacked ZEN will be removed in a single transaction. +Creates and signs a transaction to remove a forger stake and have ZEN back in the wallet.\ +Note: is not possible to remove partially a forging stake, all the stacked ZEN associated to the specific stakeId will be removed in a single transaction. **Parameters** | Name | Type | Required | Description | | -------- | ------- | ------- | ------- | | stakeId | string | yes | Id of the stake to be removed | -| nonce | string | no | | +| nonce | string | no | Nonce associated to the address that is sending the tx. If omitted the next valid nonce will be calculated automatically. | | gasInfo | object | no | | +Parameters of the gasInfo object: + +| Name | Type | Required | Description | +| -------- | ------- | ------- | ------- | +| gasLimit | biginteger | yes | GAS limit | +| maxPriorityFeePerGas | biginteger | yes | Max priority fee| +| maxFeePerGas | biginteger | yes | Max fee per gas | + **Example request** curl -sX POST 'http://127.0.0.1:9085/transaction/spendForgingStake' -H 'Content-Type: application/json' -H 'accept: application/json' -d '{"stakeId": "xxxxx"}' From 82b28c252339708a2e6161b4a85d9238416cc5f2 Mon Sep 17 00:00:00 2001 From: paolocappelletti Date: Thu, 16 Nov 2023 15:03:55 +0100 Subject: [PATCH 20/27] mode documentation --- doc/api/index.md | 2 +- .../mainchain/bestBlockReferenceInfo copy.md | 26 ------------------- doc/api/mainchain/blockReferenceByHash.md | 1 + doc/api/mainchain/blockReferenceInfoBy.md | 3 ++- .../mainchain/genesisBlockReferenceInfo.md | 2 +- .../mainchain/mainchainHeaderInfoByHash.md | 2 +- doc/api/node/addToBlacklist.md | 4 +-- doc/api/node/allPeers.md | 2 +- doc/api/node/blacklistedPeers.md | 2 +- doc/api/node/connectedPeers.md | 5 ++-- doc/api/node/info.md | 2 +- doc/api/node/peer.md | 6 ++--- doc/api/node/removeFromBlacklist.md | 4 +-- doc/api/node/sidechainId.md | 2 +- doc/api/node/storageVersions.md | 2 +- .../transaction/getKeysOwnerScAddresses.md | 4 +-- doc/api/wallet/allPublicKeys.md | 2 +- doc/api/wallet/createPrivateKey25519.md | 6 ++--- doc/api/wallet/createVrfSecret.md | 4 +-- doc/api/wallet/importSecret.md | 2 +- 20 files changed, 30 insertions(+), 53 deletions(-) delete mode 100644 doc/api/mainchain/bestBlockReferenceInfo copy.md diff --git a/doc/api/index.md b/doc/api/index.md index 70280e0..7dcc756 100644 --- a/doc/api/index.md +++ b/doc/api/index.md @@ -88,7 +88,7 @@ Following endpoints are available on EON node: [/node/connectedPeers](/doc/api/node/connectedPeers.md)\ [/node/peer](/doc/api/node/peer.md)\ [/node/info](/doc/api/node/info.md)\ -[/node/sidechainId](/doc/api/sidechainId/sidechainId.md)\ +[/node/sidechainId](/doc/api/node/sidechainId.md)\ [/node/storageVersions](/doc/api/node/storageVersions.md)\ [/node/connect](/doc/api/node/connect.md)\ [/node/disconnect](/doc/api/node/disconnect.md)\ diff --git a/doc/api/mainchain/bestBlockReferenceInfo copy.md b/doc/api/mainchain/bestBlockReferenceInfo copy.md deleted file mode 100644 index a743070..0000000 --- a/doc/api/mainchain/bestBlockReferenceInfo copy.md +++ /dev/null @@ -1,26 +0,0 @@ -[< EON API Documentation](/doc/api/index.md) -### mainchain/bestBlockReferenceInfo - -Returns info about the most recent mainchain block reference included in the sidechain - -**Parameters** - -No parameters - -**Example request** - - curl -sX POST 'http://127.0.0.1:9085/mainchain/bestBlockReferenceInfo' -H 'Content-Type: application/json' -H 'accept: application/json' - -**Example response** - - { - "result" : { - "blockReferenceInfo" : { - "mainchainHeaderSidechainBlockId" : "2abcf1ffa5e99aadbe15a9387e70d485d64cdb5b1ae842fcc60e1f8b1f0c17da", - "mainchainReferenceDataSidechainBlockId" : "2abcf1ffa5e99aadbe15a9387e70d485d64cdb5b1ae842fcc60e1f8b1f0c17da", - "hash" : "00037532bda93d50f3348533dfccd6ce2865c083bd3843d6fe9c5bb0b3b2e034", - "parentHash" : "0000898ffe9dabd5435a772e8f3385193829f567acef873a3bf549ddee882a0c", - "height" : 1355909 - } - } - } \ No newline at end of file diff --git a/doc/api/mainchain/blockReferenceByHash.md b/doc/api/mainchain/blockReferenceByHash.md index 73928dc..21e4afe 100644 --- a/doc/api/mainchain/blockReferenceByHash.md +++ b/doc/api/mainchain/blockReferenceByHash.md @@ -9,6 +9,7 @@ Only mainchain blocks referenced by the sidechain are returned. | Name | Type | Required | Description | | -------- | ------- | ------- | ------- | | hash | string | no | Mainchain block hash to query | +| format | boolean | no | If true, the response is returned in a json (human readable) format. Otherwise the hex representation is returned. | **Example request** diff --git a/doc/api/mainchain/blockReferenceInfoBy.md b/doc/api/mainchain/blockReferenceInfoBy.md index 31be002..c0b0e51 100644 --- a/doc/api/mainchain/blockReferenceInfoBy.md +++ b/doc/api/mainchain/blockReferenceInfoBy.md @@ -1,7 +1,7 @@ [< EON API Documentation](/doc/api/index.md) ### mainchain/blockReferenceInfoBy -Returns a specific mainchain block reference by block hash or height (in the mainchain) +Returns a specific mainchain block reference by block hash or height (in the mainchain).\ Only mainchain blocks referenced by the sidechain are returned. **Parameters** @@ -10,6 +10,7 @@ Only mainchain blocks referenced by the sidechain are returned. | -------- | ------- | ------- | ------- | | hash | string | no | Mainchain block hash to query | | height | int | no | Height in the mainchain to query | +| format | boolean | no | If true, the response is returned in a json (human readable) format. Otherwise the hex representation is returned. | **Example request** diff --git a/doc/api/mainchain/genesisBlockReferenceInfo.md b/doc/api/mainchain/genesisBlockReferenceInfo.md index 647a42c..5c5eb5a 100644 --- a/doc/api/mainchain/genesisBlockReferenceInfo.md +++ b/doc/api/mainchain/genesisBlockReferenceInfo.md @@ -1,7 +1,7 @@ [< EON API Documentation](/doc/api/index.md) ### mainchain/genesisBlockReferenceInfo -Returns info about the mainchain block containing the transaction that created this sidechain +Returns info about the mainchain block containing the transaction that created this sidechain. **Parameters** diff --git a/doc/api/mainchain/mainchainHeaderInfoByHash.md b/doc/api/mainchain/mainchainHeaderInfoByHash.md index aad1a79..4ffa6d2 100644 --- a/doc/api/mainchain/mainchainHeaderInfoByHash.md +++ b/doc/api/mainchain/mainchainHeaderInfoByHash.md @@ -8,7 +8,7 @@ Only mainchain block headers referenced by the sidechain are returned. | Name | Type | Required | Description | | -------- | ------- | ------- | ------- | -| hash | string | no | Mainchain block hash to query | +| hash | string | yes | Mainchain block hash to query | **Example request** diff --git a/doc/api/node/addToBlacklist.md b/doc/api/node/addToBlacklist.md index 112b18d..4246506 100644 --- a/doc/api/node/addToBlacklist.md +++ b/doc/api/node/addToBlacklist.md @@ -7,8 +7,8 @@ Force the node to add a specific peer to the blacklisted ones. | Name | Type | Required | Description | | -------- | ------- | ------- | ------- | -| address | string | yes | Peer to blacklist (format: ip:port) | -| durationInMinutes | int | yes | Duration for the ban | +| address | string | yes | Peer to blacklist (format: ip:port) | +| durationInMinutes | int | yes | Duration for the ban (in minutes). Must be > 0 | **Example request** diff --git a/doc/api/node/allPeers.md b/doc/api/node/allPeers.md index dbbc7de..1e466ed 100644 --- a/doc/api/node/allPeers.md +++ b/doc/api/node/allPeers.md @@ -1,7 +1,7 @@ [< EON API Documentation](/doc/api/index.md) ### node/allPeers -Returns the list of all sidechain node peers +Returns the list of all sidechain nodes known by this node. **Parameters** diff --git a/doc/api/node/blacklistedPeers.md b/doc/api/node/blacklistedPeers.md index 943c4e6..51ead59 100644 --- a/doc/api/node/blacklistedPeers.md +++ b/doc/api/node/blacklistedPeers.md @@ -1,7 +1,7 @@ [< EON API Documentation](/doc/api/index.md) ### node/blacklistedPeers -Return the list of the blacklisted peers +Return the list of the blacklisted peers. **Parameters** diff --git a/doc/api/node/connectedPeers.md b/doc/api/node/connectedPeers.md index 6465d84..03cc157 100644 --- a/doc/api/node/connectedPeers.md +++ b/doc/api/node/connectedPeers.md @@ -1,7 +1,7 @@ [< EON API Documentation](/doc/api/index.md) ### node/connectedPeers -Returns the list of node peers currently connected to this node +Returns the list of node peers currently connected to this node. **Parameters** @@ -25,7 +25,8 @@ No parameters "agentName" : "2-Hop", "protocolVersion" : "Version(0,0,1)", "connectionType" : "Outgoing" - }, { + }, + { "remoteAddress" : "/172.105.185.87:5674", "localAddress" : "/10.0.2.15:43622", "lastHandshake" : 1698066486764, diff --git a/doc/api/node/info.md b/doc/api/node/info.md index 7a0623a..a4c07e3 100644 --- a/doc/api/node/info.md +++ b/doc/api/node/info.md @@ -1,7 +1,7 @@ [< EON API Documentation](/doc/api/index.md) ### node/info -Returns info about this node +Returns info about this node. **Parameters** diff --git a/doc/api/node/peer.md b/doc/api/node/peer.md index f94e7e9..c366c5b 100644 --- a/doc/api/node/peer.md +++ b/doc/api/node/peer.md @@ -1,13 +1,13 @@ [< EON API Documentation](/doc/api/index.md) ### node/peer -Returns info about a specific node peer +Returns info about a specific node peer. **Parameters** | Name | Type | Required | Description | | -------- | ------- | ------- | ------- | -| address | string | yes | Peer to blacklist (format: ip:port) | +| address | string | yes | Peer to look at (format: ip:port) | **Example request** @@ -27,7 +27,7 @@ Returns info about a specific node peer "protocolVersion" : "Version(0,0,1)" } } - } + } diff --git a/doc/api/node/removeFromBlacklist.md b/doc/api/node/removeFromBlacklist.md index 7d2369b..c19e05b 100644 --- a/doc/api/node/removeFromBlacklist.md +++ b/doc/api/node/removeFromBlacklist.md @@ -1,13 +1,13 @@ [< EON API Documentation](/doc/api/index.md) ### node/removeFromBlacklist -Force the node to remove a specific peer to the blacklisted ones. +Force the node to remove a specific peer from the blacklisted ones. **Parameters** | Name | Type | Required | Description | | -------- | ------- | ------- | ------- | -| address | string | yes | Peer to remove form blacklist (format: ip:port) | +| address | string | yes | Peer to be removed from the blacklist (format: ip:port) | diff --git a/doc/api/node/sidechainId.md b/doc/api/node/sidechainId.md index bfe3f95..23308f4 100644 --- a/doc/api/node/sidechainId.md +++ b/doc/api/node/sidechainId.md @@ -1,7 +1,7 @@ [< EON API Documentation](/doc/api/index.md) ### node/sidechainId -Returns info about the sidechain Id +Returns info about the sidechain Id. **Parameters** diff --git a/doc/api/node/storageVersions.md b/doc/api/node/storageVersions.md index 63fd58b..1757f58 100644 --- a/doc/api/node/storageVersions.md +++ b/doc/api/node/storageVersions.md @@ -1,7 +1,7 @@ [< EON API Documentation](/doc/api/index.md) ### node/storageVersions -Returns info about most recent version recorded in the internal storages. +Returns info about the most recent version recorded in the internal storages. **Parameters** diff --git a/doc/api/transaction/getKeysOwnerScAddresses.md b/doc/api/transaction/getKeysOwnerScAddresses.md index c02d8d6..7b4ee86 100644 --- a/doc/api/transaction/getKeysOwnerScAddresses.md +++ b/doc/api/transaction/getKeysOwnerScAddresses.md @@ -1,7 +1,7 @@ [< EON API Documentation](/doc/api/index.md) ### transaction/getKeysOwnerScAddresses -Return the list of all EON sidechain addresses that have at least one mainchain associated. +Return the list of all EON sidechain addresses that have at least one mainchain associated.\ This function is used for voting pourposes in ZENDAO. **Parameters** @@ -12,7 +12,7 @@ No parameter needed. **Example request** curl -sX POST 'http://127.0.0.1:9085/transaction/getKeysOwnerScAddresses' -H 'Content-Type: application/json' -H 'accept: application/json' - + **Example response** { diff --git a/doc/api/wallet/allPublicKeys.md b/doc/api/wallet/allPublicKeys.md index 98bd864..b5442ae 100644 --- a/doc/api/wallet/allPublicKeys.md +++ b/doc/api/wallet/allPublicKeys.md @@ -2,7 +2,7 @@ ### wallet/allPublicKeys Returns the list of all keys contained in this node wallet. -For 25519 and VRF keys, the public key is returned, for Secp256k1 the EVM public address is returned. +For 25519 and VRF keys, the public key is returned, for Secp256k1 keys the EVM public address is returned. **Parameters** diff --git a/doc/api/wallet/createPrivateKey25519.md b/doc/api/wallet/createPrivateKey25519.md index a9dbd74..ab7638d 100644 --- a/doc/api/wallet/createPrivateKey25519.md +++ b/doc/api/wallet/createPrivateKey25519.md @@ -1,9 +1,9 @@ [< EON API Documentation](/doc/api/index.md) ### wallet/createPrivateKeySecp256k1 -Create a private key in the Secp256k1 format. -Secp256k1 keys are the standard used in Ethereum EVM and also by EON EVM. -Returns the correspondent address. +Create a private key in the Secp256k1 format.\ +Secp256k1 keys are the standard used in Ethereum EVMs and also by EON.\ +Returns the correspondent public address. **Parameters** diff --git a/doc/api/wallet/createVrfSecret.md b/doc/api/wallet/createVrfSecret.md index d3701ac..b04ca41 100644 --- a/doc/api/wallet/createVrfSecret.md +++ b/doc/api/wallet/createVrfSecret.md @@ -1,8 +1,8 @@ [< EON API Documentation](/doc/api/index.md) ### wallet/createVrfSecret -Create a VrfSecret. -VrfSecrets are used by forgers to partecipate at the forgers' lottery. +Create a VrfSecret.\ +VrfSecrets are used by forgers to partecipate at the forgers' lottery.\ Returns the correspondent public key. **Parameters** diff --git a/doc/api/wallet/importSecret.md b/doc/api/wallet/importSecret.md index 4378ca5..5c58a80 100644 --- a/doc/api/wallet/importSecret.md +++ b/doc/api/wallet/importSecret.md @@ -1,7 +1,7 @@ [< EON API Documentation](/doc/api/index.md) ### wallet/importSecret -Import a specific private key in the local wallet +Import a specific private key in the local wallet. **Parameters** From 3bb90976b3c5629fcbded2dc25f472ffdf70b32f Mon Sep 17 00:00:00 2001 From: paolocappelletti Date: Thu, 16 Nov 2023 15:34:41 +0100 Subject: [PATCH 21/27] update changelog and release notes --- CHANGELOG.md | 2 +- doc/index.md | 1 + doc/release/1.0.1.md | 9 +++++++++ 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 doc/release/1.0.1.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c22d2a..5b0101e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog ## 1.1.0 -* SDK dependency updated to version 0.9.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 ## 1.0.0 diff --git a/doc/index.md b/doc/index.md index cd507cb..91021da 100644 --- a/doc/index.md +++ b/doc/index.md @@ -5,4 +5,5 @@ Find [here documentation](/doc/api/index.md) about how to interact with a runnin # EON Release Notes ## Version [1.1.0](/doc/release/1.1.0.md) +## Version [1.0.1](/doc/release/1.0.1.md) ## Version [1.0.0](/doc/release/1.0.0.md) diff --git a/doc/release/1.0.1.md b/doc/release/1.0.1.md new file mode 100644 index 0000000..5562b4e --- /dev/null +++ b/doc/release/1.0.1.md @@ -0,0 +1,9 @@ +# Release notes - version 1.1.0 +--- + +## Notes about new/updated Features +The 1.0.1 version has been updated to the 0.8.1 SDK version, which fixes the eth RPC call eth_gasPrice: it now returns an estimation of the gasPrice more accurate. The previous one was overestimating the minimum gasPrice needed in some corner cases. Following the new endpoint estimation, will be possible to pay lower average fees than before.\ +The update will be immediately visible, not requirying an hardfork activation. + +--- +Full [Changelog](/CHANGELOG.md) available. \ No newline at end of file From 8e4e39a9b5a45a725c127a497090e24db3c5b280 Mon Sep 17 00:00:00 2001 From: paolocappelletti Date: Mon, 20 Nov 2023 17:41:04 +0100 Subject: [PATCH 22/27] fix on createEIP docs --- doc/api/transaction/createEIP1559Transaction.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/api/transaction/createEIP1559Transaction.md b/doc/api/transaction/createEIP1559Transaction.md index fc0035f..c67460f 100644 --- a/doc/api/transaction/createEIP1559Transaction.md +++ b/doc/api/transaction/createEIP1559Transaction.md @@ -14,7 +14,7 @@ See request body below. The request body format is like this: -{ + { "from": fromAddress, "to": toAddress, "nonce": nonce, @@ -30,6 +30,6 @@ The request body format is like this: **Example response** -{ - "transactionId": "xxxxxxxxxxxxxxxxx" -} \ No newline at end of file + { + "transactionId": "xxxxxxxxxxxxxxxxx" + } \ No newline at end of file From 10dfc5d48478ec9910ec83a3e0814c61c5384040 Mon Sep 17 00:00:00 2001 From: paolocappelletti Date: Tue, 21 Nov 2023 09:47:52 +0100 Subject: [PATCH 23/27] fork points for 1.1 --- node/src/main/java/io/horizen/eon/EonForkConfigurator.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/node/src/main/java/io/horizen/eon/EonForkConfigurator.java b/node/src/main/java/io/horizen/eon/EonForkConfigurator.java index 423c7d4..4949430 100644 --- a/node/src/main/java/io/horizen/eon/EonForkConfigurator.java +++ b/node/src/main/java/io/horizen/eon/EonForkConfigurator.java @@ -29,9 +29,9 @@ public class EonForkConfigurator extends ForkConfigurator { //EON fork 3: Native <> Real smart contract interoperability static final int F3_REGTEST_FORKPOINT = 7; static final int F3_PREGOBI_TESTNET_FORKPOINT = 1815; //estimated start: Mon 13 Nov 2023 13:01 Milano time - static final int F3_GOBI_TESTNET_FORKPOINT = 500000000; ///TODO: to be estimated - static final int F3_TESTNET_FORKPOINT = 500000000; //not used - static final int F3_MAINNET_FORKPOINT = 500000000; ///TODO: to be estimated + static final int F3_GOBI_TESTNET_FORKPOINT = 1900; //estimated start; Tue 28 Nov 11 2023 15:21 Milano time + static final int F3_TESTNET_FORKPOINT = 1900; //not used + static final int F3_MAINNET_FORKPOINT = 1211; //estimated start; Mon 11 Dec 2023 17:55 Milano time From b0fdd362ea066a6901dd04e46de182df190692b3 Mon Sep 17 00:00:00 2001 From: paolocappelletti Date: Tue, 21 Nov 2023 09:55:49 +0100 Subject: [PATCH 24/27] bump version to 1.1.0 final --- CHANGELOG.md | 1 + bootstraptool/pom.xml | 4 ++-- node/pom.xml | 4 ++-- pom.xml | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c22d2a..e93d3c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## 1.1.0 * SDK dependency updated to version 0.9.0 * Fork configuration to enable Native<>Real smart contract interoperability +* Added endpoints documentation ## 1.0.0 * SDK dependency updated to version 0.8.0 diff --git a/bootstraptool/pom.xml b/bootstraptool/pom.xml index c447697..e885a51 100644 --- a/bootstraptool/pom.xml +++ b/bootstraptool/pom.xml @@ -3,7 +3,7 @@ 4.0.0 io.horizen bootstraptool - 1.1.0-SNAPSHOT + 1.1.0 2023 UTF-8 @@ -21,7 +21,7 @@ io.horizen eon - 1.1.0-SNAPSHOT + 1.1.0 compile diff --git a/node/pom.xml b/node/pom.xml index 23878e3..745a211 100644 --- a/node/pom.xml +++ b/node/pom.xml @@ -3,7 +3,7 @@ 4.0.0 io.horizen eon - 1.1.0-SNAPSHOT + 1.1.0 2023 UTF-8 @@ -11,7 +11,7 @@ 11 3.8.1 3.1.1 - 0.9.0-SNAPSHOT + 0.9.0 diff --git a/pom.xml b/pom.xml index c51040d..14119d7 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 io.horizen eonproject - 1.1.0-SNAPSHOT + 1.1.0 pom 2023 From fc3b46017140ad9a6792a8050f3c6b9e522b12e2 Mon Sep 17 00:00:00 2001 From: paolocappelletti Date: Tue, 21 Nov 2023 09:56:01 +0100 Subject: [PATCH 25/27] bump version to 1.1.0 final --- bootstraptool/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstraptool/pom.xml b/bootstraptool/pom.xml index e885a51..e859105 100644 --- a/bootstraptool/pom.xml +++ b/bootstraptool/pom.xml @@ -16,7 +16,7 @@ io.horizen sidechains-sdk-account_sctools - 0.9.0-SNAPSHOT + 0.9.0 io.horizen From 626215b71269dac184629ae9c05f34c765c26064 Mon Sep 17 00:00:00 2001 From: paolocappelletti Date: Tue, 21 Nov 2023 17:17:09 +0100 Subject: [PATCH 26/27] added 1.0.1 in changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e93d3c9..d40c6b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ * 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.0 * SDK dependency updated to version 0.8.0 * Fork configuration to enable decentralized governance (ZenDao) and change consensus parameters (consensus epoch slot time and lenght, acrive slot coefficient) From 2f4ad4c8d23754f73043c2d07dfb81d408916418 Mon Sep 17 00:00:00 2001 From: paolocappelletti Date: Tue, 21 Nov 2023 17:25:30 +0100 Subject: [PATCH 27/27] updated fork date mainnet --- node/src/main/java/io/horizen/eon/EonForkConfigurator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node/src/main/java/io/horizen/eon/EonForkConfigurator.java b/node/src/main/java/io/horizen/eon/EonForkConfigurator.java index 4949430..fa8abab 100644 --- a/node/src/main/java/io/horizen/eon/EonForkConfigurator.java +++ b/node/src/main/java/io/horizen/eon/EonForkConfigurator.java @@ -31,7 +31,7 @@ public class EonForkConfigurator extends ForkConfigurator { static final int F3_PREGOBI_TESTNET_FORKPOINT = 1815; //estimated start: Mon 13 Nov 2023 13:01 Milano time static final int F3_GOBI_TESTNET_FORKPOINT = 1900; //estimated start; Tue 28 Nov 11 2023 15:21 Milano time static final int F3_TESTNET_FORKPOINT = 1900; //not used - static final int F3_MAINNET_FORKPOINT = 1211; //estimated start; Mon 11 Dec 2023 17:55 Milano time + static final int F3_MAINNET_FORKPOINT = 1213; //estimated start; Tue 12 Dec 2023 18:55 Milano time