From d254c63bc7906daf08d961ddb91e76ba60f5ec8b Mon Sep 17 00:00:00 2001 From: David Drvar Date: Fri, 16 Jun 2023 14:23:31 +0200 Subject: [PATCH 01/10] EonVersion binding --- node/src/main/java/io/horizen/eon/EonAppModule.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/node/src/main/java/io/horizen/eon/EonAppModule.java b/node/src/main/java/io/horizen/eon/EonAppModule.java index 9ed3a4b..543d9f6 100644 --- a/node/src/main/java/io/horizen/eon/EonAppModule.java +++ b/node/src/main/java/io/horizen/eon/EonAppModule.java @@ -96,5 +96,14 @@ public void configureApp() { bind(Integer.class) .annotatedWith(Names.named("ConsensusSecondsInSlot")) .toInstance(CONSENSUS_SLOT_TIME); + + bind(String.class) + .annotatedWith(Names.named("EonVersion")) + .toInstance(getEONVersion()); + } + + public String getEONVersion() { + Package eonPackage = this.getClass().getPackage(); + return eonPackage.getImplementationVersion(); } } From 6bbb68db9ef7e28293851e2c2b003c5146496d01 Mon Sep 17 00:00:00 2001 From: David Drvar Date: Mon, 19 Jun 2023 09:35:08 +0200 Subject: [PATCH 02/10] eon default version --- node/src/main/java/io/horizen/eon/EonAppModule.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/node/src/main/java/io/horizen/eon/EonAppModule.java b/node/src/main/java/io/horizen/eon/EonAppModule.java index 543d9f6..26d0538 100644 --- a/node/src/main/java/io/horizen/eon/EonAppModule.java +++ b/node/src/main/java/io/horizen/eon/EonAppModule.java @@ -103,7 +103,9 @@ public void configureApp() { } public String getEONVersion() { + String defaultVersion = "dev"; Package eonPackage = this.getClass().getPackage(); - return eonPackage.getImplementationVersion(); + String version = eonPackage.getImplementationVersion(); + return version != null ? version : defaultVersion; } } From 4e46588b04ec767a32fdd06eb18c24fdd9b2f50f Mon Sep 17 00:00:00 2001 From: David Drvar Date: Tue, 20 Jun 2023 10:38:14 +0200 Subject: [PATCH 03/10] eon version renamed to app version --- node/src/main/java/io/horizen/eon/EonAppModule.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node/src/main/java/io/horizen/eon/EonAppModule.java b/node/src/main/java/io/horizen/eon/EonAppModule.java index 26d0538..e79d704 100644 --- a/node/src/main/java/io/horizen/eon/EonAppModule.java +++ b/node/src/main/java/io/horizen/eon/EonAppModule.java @@ -98,7 +98,7 @@ public void configureApp() { .toInstance(CONSENSUS_SLOT_TIME); bind(String.class) - .annotatedWith(Names.named("EonVersion")) + .annotatedWith(Names.named("AppVersion")) .toInstance(getEONVersion()); } From 172bc6e80400ad32364c98a901e2570beb6f47b3 Mon Sep 17 00:00:00 2001 From: David Drvar Date: Tue, 20 Jun 2023 11:46:27 +0200 Subject: [PATCH 04/10] comment added to getEONVersion --- node/src/main/java/io/horizen/eon/EonAppModule.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/node/src/main/java/io/horizen/eon/EonAppModule.java b/node/src/main/java/io/horizen/eon/EonAppModule.java index e79d704..1d97ce3 100644 --- a/node/src/main/java/io/horizen/eon/EonAppModule.java +++ b/node/src/main/java/io/horizen/eon/EonAppModule.java @@ -102,6 +102,15 @@ public void configureApp() { .toInstance(getEONVersion()); } + /** + Retrieves the EON version by dynamically accessing the implementation version of the package at runtime. + The implementation version is taken from JAR file's manifest file Implementation-Version attribute. That attribute + is populated when JAR is build with value of version tag under project key from pom file.
+ When running the application in a development environment (e.g., directly from the source code or an IDE), the implementation + version is not accessible and will return default "dev" value. + + @return The EON version, or "dev" if the version is not available. + */ public String getEONVersion() { String defaultVersion = "dev"; Package eonPackage = this.getClass().getPackage(); From 9d1207a7cd1ef89df60d514ccdfe8d037449a3f1 Mon Sep 17 00:00:00 2001 From: David Drvar Date: Tue, 20 Jun 2023 11:49:14 +0200 Subject: [PATCH 05/10] getEONVersion comment grammar fixed --- node/src/main/java/io/horizen/eon/EonAppModule.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/node/src/main/java/io/horizen/eon/EonAppModule.java b/node/src/main/java/io/horizen/eon/EonAppModule.java index 1d97ce3..642bdd9 100644 --- a/node/src/main/java/io/horizen/eon/EonAppModule.java +++ b/node/src/main/java/io/horizen/eon/EonAppModule.java @@ -104,10 +104,10 @@ public void configureApp() { /** Retrieves the EON version by dynamically accessing the implementation version of the package at runtime. - The implementation version is taken from JAR file's manifest file Implementation-Version attribute. That attribute - is populated when JAR is build with value of version tag under project key from pom file.
+ The implementation version is taken from the JAR file's manifest file Implementation-Version attribute. That attribute + is populated when JAR is built with the value of the version tag under the project key from the pom file.
When running the application in a development environment (e.g., directly from the source code or an IDE), the implementation - version is not accessible and will return default "dev" value. + version is not accessible and will return the default "dev" value. @return The EON version, or "dev" if the version is not available. */ From b43e707e175e9564ebedd62c1333fd353c78dfb1 Mon Sep 17 00:00:00 2001 From: paolocappelletti Date: Fri, 23 Jun 2023 14:17:33 +0200 Subject: [PATCH 06/10] bump version to 0.2.0 --- CHANGELOG.md | 2 ++ bootstraptool/pom.xml | 8 ++++---- node/pom.xml | 4 ++-- pom.xml | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4619b57..2871b4a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,6 @@ # Changelog +## 0.2.0 +* Updated SDK dependency to 0.7.1 ## 0.1.0 Initial version of the EON application. diff --git a/bootstraptool/pom.xml b/bootstraptool/pom.xml index d5a8c82..78ba07a 100644 --- a/bootstraptool/pom.xml +++ b/bootstraptool/pom.xml @@ -3,7 +3,7 @@ 4.0.0 io.horizen bootstraptool - 0.1.0-SNAPSHOT + 0.2.0-SNAPSHOT 2023 UTF-8 @@ -16,18 +16,18 @@ io.horizen sidechains-sdk-scbootstrappingtools - 0.7.0-SNAPSHOT + 0.7.1-SNAPSHOT compile io.horizen sidechains-sdk-account_sctools - 0.7.0-SNAPSHOT + 0.7.1-SNAPSHOT io.horizen eon - 0.1.0-SNAPSHOT + 0.2.0-SNAPSHOT compile diff --git a/node/pom.xml b/node/pom.xml index d7d7fad..8926686 100644 --- a/node/pom.xml +++ b/node/pom.xml @@ -3,7 +3,7 @@ 4.0.0 io.horizen eon - 0.1.0-SNAPSHOT + 0.2.0-SNAPSHOT 2023 UTF-8 @@ -11,7 +11,7 @@ 11 3.8.1 3.1.1 - 0.7.0-SNAPSHOT + 0.7.1-SNAPSHOT diff --git a/pom.xml b/pom.xml index b0d814a..1441e89 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 io.horizen eonproject - 0.1.0-SNAPSHOT + 0.2.0-SNAPSHOT pom 2023 From b749b90465ce75bce08bda50d2ec47dfef634f25 Mon Sep 17 00:00:00 2001 From: lander86 <40528366+lander86@users.noreply.github.com> Date: Tue, 11 Jul 2023 15:30:26 +0200 Subject: [PATCH 07/10] Integrate Txs handling parameter (#36) * integrate Txs handling and remote key management parameters --- dockerfiles/evmapp/entrypoint.sh | 7 +++++-- dockerfiles/evmapp/sc_settings.conf.tmpl | 3 +++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/dockerfiles/evmapp/entrypoint.sh b/dockerfiles/evmapp/entrypoint.sh index 253f14d..ae85301 100755 --- a/dockerfiles/evmapp/entrypoint.sh +++ b/dockerfiles/evmapp/entrypoint.sh @@ -70,12 +70,15 @@ to_check=( "SCNODE_NET_API_LIMITER_ENABLED" "SCNODE_NET_SLOW_MODE" "SCNODE_NET_REBROADCAST_TXS" + "SCNODE_NET_HANDLING_TXS" "SCNODE_REST_PORT" "SCNODE_WALLET_SEED" "SCNODE_WALLET_MAXTX_FEE" "SCNODE_WS_SERVER_PORT" "SCNODE_WS_CLIENT_ENABLED" "SCNODE_WS_SERVER_ENABLED" + "SCNODE_REMOTE_KEY_MANAGER_PARALLEL_REQUESTS" + "SCNODE_REMOTE_KEY_MANAGER_REQUEST_TIMEOUT" ) for var in "${to_check[@]}"; do if [ -z "${!var:-}" ]; then @@ -255,9 +258,9 @@ export SCNODE_NET_KNOWNPEERS SUBST='$SCNODE_CERT_MASTERS_PUBKEYS:$SCNODE_CERT_SIGNERS_MAXPKS:$SCNODE_CERT_SIGNERS_PUBKEYS:$SCNODE_CERT_SIGNERS_SECRETS:$SCNODE_CERT_SIGNERS_THRESHOLD:$SCNODE_CERT_SIGNING_ENABLED:'\ '$SCNODE_CERT_SUBMITTER_ENABLED:$SCNODE_GENESIS_BLOCKHEX:$SCNODE_GENESIS_SCID:$SCNODE_GENESIS_POWDATA:$SCNODE_GENESIS_MCBLOCKHEIGHT:$SCNODE_GENESIS_MCNETWORK:'\ '$SCNODE_GENESIS_WITHDRAWALEPOCHLENGTH:$SCNODE_GENESIS_COMMTREEHASH:$SCNODE_GENESIS_ISNONCEASING:$SCNODE_ALLOWED_FORGERS:$SCNODE_FORGER_ENABLED:$SCNODE_FORGER_RESTRICT:'\ -'$SCNODE_NET_DECLAREDADDRESS:$SCNODE_NET_KNOWNPEERS:$SCNODE_NET_MAGICBYTES:$SCNODE_NET_NODENAME:$SCNODE_NET_P2P_PORT:$SCNODE_NET_API_LIMITER_ENABLED:$SCNODE_NET_SLOW_MODE:$SCNODE_NET_REBROADCAST_TXS:'\ +'$SCNODE_NET_DECLAREDADDRESS:$SCNODE_NET_KNOWNPEERS:$SCNODE_NET_MAGICBYTES:$SCNODE_NET_NODENAME:$SCNODE_NET_P2P_PORT:$SCNODE_NET_API_LIMITER_ENABLED:$SCNODE_NET_SLOW_MODE:$SCNODE_NET_REBROADCAST_TXS:$SCNODE_NET_HANDLING_TXS:'\ '$SCNODE_WALLET_GENESIS_SECRETS:$SCNODE_WALLET_MAXTX_FEE:$SCNODE_WALLET_SEED:$WS_ADDRESS:$MAX_INCOMING_CONNECTIONS:$MAX_OUTGOING_CONNECTIONS:$SCNODE_WS_SERVER_PORT:'\ -'$SCNODE_WS_CLIENT_ENABLED:$SCNODE_WS_SERVER_ENABLED:$SCNODE_REMOTE_KEY_MANAGER_ENABLED:$SCNODE_REMOTE_KEY_MANAGER_ADDRESS:$SCNODE_LOG_FILE_LEVEL:$SCNODE_LOG_CONSOLE_LEVEL:'\ +'$SCNODE_WS_CLIENT_ENABLED:$SCNODE_WS_SERVER_ENABLED:$SCNODE_REMOTE_KEY_MANAGER_ENABLED:$SCNODE_REMOTE_KEY_MANAGER_ADDRESS:$SCNODE_LOG_FILE_LEVEL:$SCNODE_LOG_CONSOLE_LEVEL:$SCNODE_REMOTE_KEY_MANAGER_REQUEST_TIMEOUT:$SCNODE_REMOTE_KEY_MANAGER_PARALLEL_REQUESTS:'\ '$SCNODE_REST_APIKEYHASH:$SCNODE_REST_PORT'\ export SUBST diff --git a/dockerfiles/evmapp/sc_settings.conf.tmpl b/dockerfiles/evmapp/sc_settings.conf.tmpl index 13a4f52..9340f37 100644 --- a/dockerfiles/evmapp/sc_settings.conf.tmpl +++ b/dockerfiles/evmapp/sc_settings.conf.tmpl @@ -31,6 +31,7 @@ sparkz { rebroadcastDelay = 30s rebroadcastQueueSize = 1024 rebroadcastBatchSize = 75 + handlingTransactionsEnabled = $SCNODE_NET_HANDLING_TXS } apiRateLimiter { @@ -86,6 +87,8 @@ sparkz { remoteKeysManager { enabled = $SCNODE_REMOTE_KEY_MANAGER_ENABLED address = "$SCNODE_REMOTE_KEY_MANAGER_ADDRESS" + requestTimeout = $SCNODE_REMOTE_KEY_MANAGER_REQUEST_TIMEOUT + numOfParallelRequests = $SCNODE_REMOTE_KEY_MANAGER_PARALLEL_REQUESTS } genesis { From d7f5f94a57844cc56183d29dcf58868a613c0422 Mon Sep 17 00:00:00 2001 From: Yuri Sibirski <31861444+ysibirski@users.noreply.github.com> Date: Mon, 24 Jul 2023 12:13:09 -0400 Subject: [PATCH 08/10] Publish docker 'dev' tag and GH releases (#37) --- .travis.yml | 11 ++++++++++- ci/docker.sh | 20 +++++++++++++++----- ci/setup_env.sh | 15 +++++++++++++-- 3 files changed, 38 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index f5bf1a2..61a0bad 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ os: linux -dist: jammy +dist: focal language: generic addons: apt: @@ -34,3 +34,12 @@ jobs: env: - EVMAPP_DOCKER_IMAGE_NAME='evmapp' - BOOTSTRAPTOOL_DOCKER_IMAGE_NAME='evmapp-bootstraptool' + +deploy: + provider: releases + token: $GITHUB_TOKEN + prerelease: $IS_A_GH_PRERELEASE + overwrite: true + on: + tags: true + condition: $IS_A_RELEASE = true \ No newline at end of file diff --git a/ci/docker.sh b/ci/docker.sh index 6e553d1..9e6c1a5 100755 --- a/ci/docker.sh +++ b/ci/docker.sh @@ -9,6 +9,9 @@ pom_version="${ROOT_POM_VERSION:-}" DOCKER_USERNAME="${DOCKER_USERNAME:-}" DOCKER_PASSWORD="${DOCKER_PASSWORD:-}" +IS_A_RELEASE="${IS_A_RELEASE:-false}" +PROD_RELEASE="${PROD_RELEASE:-false}" +TRAVIS_TAG="${TRAVIS_TAG:-}" # Functions @@ -45,23 +48,30 @@ if [ -n "${docker_tag}" ]; then . # Publishing to DockerHub - echo "" && echo "=== Publishing Docker image(s) on Docker Hub===" && echo "" + echo "" && echo "=== Publishing Docker image(s) on Docker Hub ===" && echo "" if [ -z "${DOCKER_USERNAME}" ] || [ -z "${DOCKER_PASSWORD}" ]; then - echo "Warning: DOCKER_USERNAME and/or DOCKER_USERNAME is(are) empty. Docker image is NOT going to be published on DockerHub !!!" + echo "Warning: DOCKER_USERNAME and/or DOCKER_PASSWORD variable(s) is(are) empty. Docker image(s) is(are) NOT going to be published on DockerHub !!!" else echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_USERNAME}" --password-stdin - echo "Create tags" docker_images=("${evmapp_docker_image_name}" "${bootstraptool_docker_image_name}") - for docker_image in "${docker_images[@]}"; do + + # Docker image(s) tags for PROD vs DEV release + if [ "${PROD_RELEASE}" = "true" ]; then tags=("${docker_tag}" "latest") + else + tags=("${docker_tag}" "dev") + fi + + for docker_image in "${docker_images[@]}"; do for tag in "${tags[@]}"; do + echo "" && echo "Publishing docker image: ${docker_image}:${tag}" docker tag "${docker_image}:${docker_tag}" "index.docker.io/${docker_hub_org}/${docker_image}:${tag}" docker push "index.docker.io/${docker_hub_org}/${docker_image}:${tag}" done done fi else - echo "" && echo "=== The build did NOT satisfy RELEASE build requirements. Docker image is not being created ===" && echo "" + echo "" && echo "=== The build did NOT satisfy RELEASE build requirements. Docker image(s) was(were) NOT created/published ===" && echo "" fi diff --git a/ci/setup_env.sh b/ci/setup_env.sh index 6ea22b6..2cc77db 100755 --- a/ci/setup_env.sh +++ b/ci/setup_env.sh @@ -1,7 +1,10 @@ #!/bin/bash set -eo pipefail -export IS_A_RELEASE="false" +IS_A_RELEASE="false" +IS_A_GH_PRERELEASE="false" +PROD_RELEASE="false" + ROOT_POM_VERSION="$(xpath -q -e '/project/version/text()' pom.xml)" node_pom_version="$(xpath -q -e '/project/version/text()' ./node/pom.xml)" bootstraptool_pom_version="$(xpath -q -e '/project/version/text()' ./bootstraptool/pom.xml)" @@ -97,6 +100,9 @@ if [ -n "${TRAVIS_TAG}" ]; then if [ "${IS_A_RELEASE}" = "true" ]; then echo "" && echo "=== Production release ===" && echo "" + + export PROD_RELEASE="true" + export IS_A_GH_PRERELEASE="false" fi elif ( git branch -r --contains "${TRAVIS_TAG}" | grep -xqE ". origin\/${DEV_RELEASE_BRANCH}$" ); then import_gpg_keys "${all_maintainers_keys}" @@ -105,7 +111,7 @@ if [ -n "${TRAVIS_TAG}" ]; then if ! [[ "${ROOT_POM_VERSION}" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-RC[0-9]+)?(-SNAPSHOT){1}$ ]]; then echo "Warning: package(s) version is in the wrong format for DEVELOPMENT release. Expecting: d.d.d(-RC[0-9]+)?(-SNAPSHOT){1}. The build is not going to be released !!!" - IS_A_RELEASE="false" + export IS_A_RELEASE="false" fi # Checking Github tag format @@ -117,6 +123,9 @@ if [ -n "${TRAVIS_TAG}" ]; then if [ "${IS_A_RELEASE}" = "true" ]; then echo "" && echo "=== Development release ===" && echo "" + + export PROD_RELEASE="false" + export IS_A_GH_PRERELEASE="true" fi fi fi @@ -124,6 +133,8 @@ fi # Final check for release vs non-release build if [ "${IS_A_RELEASE}" = "false" ]; then echo "" && echo "=== NOT a release build ===" && echo "" + + export IS_A_RELEASE="false" fi set +eo pipefail From 626d00744ae374d4d6e26aec5e15e46c3ff4c542 Mon Sep 17 00:00:00 2001 From: paolocappelletti Date: Wed, 26 Jul 2023 15:50:23 +0200 Subject: [PATCH 09/10] 0.2.0 final --- bootstraptool/pom.xml | 4 ++-- node/pom.xml | 4 ++-- pom.xml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bootstraptool/pom.xml b/bootstraptool/pom.xml index 78ba07a..34af0c4 100644 --- a/bootstraptool/pom.xml +++ b/bootstraptool/pom.xml @@ -3,7 +3,7 @@ 4.0.0 io.horizen bootstraptool - 0.2.0-SNAPSHOT + 0.2.0 2023 UTF-8 @@ -27,7 +27,7 @@ io.horizen eon - 0.2.0-SNAPSHOT + 0.2.0 compile diff --git a/node/pom.xml b/node/pom.xml index 8926686..c778e7d 100644 --- a/node/pom.xml +++ b/node/pom.xml @@ -3,7 +3,7 @@ 4.0.0 io.horizen eon - 0.2.0-SNAPSHOT + 0.2.0 2023 UTF-8 @@ -11,7 +11,7 @@ 11 3.8.1 3.1.1 - 0.7.1-SNAPSHOT + 0.7.1 diff --git a/pom.xml b/pom.xml index 1441e89..425ff57 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 io.horizen eonproject - 0.2.0-SNAPSHOT + 0.2.0 pom 2023 From 2ee4f1e58e7d4f898128ba95661b0e3d86ebfa4e Mon Sep 17 00:00:00 2001 From: paolocappelletti Date: Wed, 26 Jul 2023 15:50:52 +0200 Subject: [PATCH 10/10] 0.2.0 final --- bootstraptool/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bootstraptool/pom.xml b/bootstraptool/pom.xml index 34af0c4..1a8ef71 100644 --- a/bootstraptool/pom.xml +++ b/bootstraptool/pom.xml @@ -16,13 +16,13 @@ io.horizen sidechains-sdk-scbootstrappingtools - 0.7.1-SNAPSHOT + 0.7.1 compile io.horizen sidechains-sdk-account_sctools - 0.7.1-SNAPSHOT + 0.7.1 io.horizen