diff --git a/examples/c_contract/hotpocket_contract.h b/examples/c_contract/hotpocket_contract.h index 74dcbd7d..8e6fc5d2 100644 --- a/examples/c_contract/hotpocket_contract.h +++ b/examples/c_contract/hotpocket_contract.h @@ -1,6 +1,8 @@ #ifndef __HOTPOCKET_CONTRACT_LIB_C__ #define __HOTPOCKET_CONTRACT_LIB_C__ +// Hot Pocket contract library version 0.5.0 + #include #include #include diff --git a/examples/js_client/lib/hp-client-lib.js b/examples/js_client/lib/hp-client-lib.js index ec9d07b4..49f282c6 100644 --- a/examples/js_client/lib/hp-client-lib.js +++ b/examples/js_client/lib/hp-client-lib.js @@ -1,5 +1,6 @@ /** * Hot Pocket javascript client library (for NodeJs and Browser) + * Version 0.5.0 * NodeJs: const HotPocket = require("./hp-client-lib") * Browser: window.HotPocket */ @@ -21,7 +22,7 @@ TextDecoder = util.TextDecoder; } - const supportedHpVersion = "1.0.0"; + const supportedHpVersion = "0.5.0"; const serverChallengeSize = 16; const outputValidationPassThreshold = 0.8; const connectionCheckIntervalMs = 1000; diff --git a/examples/nodejs_contract/hp-contract-lib.js b/examples/nodejs_contract/hp-contract-lib.js index 961ad909..3d43d84a 100644 --- a/examples/nodejs_contract/hp-contract-lib.js +++ b/examples/nodejs_contract/hp-contract-lib.js @@ -1,6 +1,8 @@ const fs = require('fs'); const tty = require('tty'); +// Hot Pocket contract library version 0.5.0 + const MAX_SEQ_PACKET_SIZE = 128 * 1024; const controlMessages = { contractEnd: "contract_end", diff --git a/src/main.cpp b/src/main.cpp index d4aa55ee..36f10c70 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -155,7 +155,8 @@ int main(int argc, char **argv) if (conf::ctx.command == "version") { // Print the version - std::cout << "HotPocket " << version::HP_VERSION << " (ledger version " << version::LEDGER_VERSION << ")" << std::endl; + std::cout << version::HP_VERSION << " \nLedger version: " << version::LEDGER_VERSION << "\n"; + return 0; } else { diff --git a/src/util/version.hpp b/src/util/version.hpp index 6c619eab..02807fe5 100644 --- a/src/util/version.hpp +++ b/src/util/version.hpp @@ -6,13 +6,13 @@ namespace version { // Hot Pocket version. Written to new configs and p2p/user messages. - constexpr const char *HP_VERSION = "1.0.0"; + constexpr const char *HP_VERSION = "0.5.0"; // Minimum compatible config version (this will be used to validate configs). - constexpr const char *MIN_CONFIG_VERSION = "1.0.0"; + constexpr const char *MIN_CONFIG_VERSION = "0.5.0"; // Ledger file storage version. All nodes in a cluster MUST use the same ledger version. - constexpr const char *LEDGER_VERSION = "1.0.0"; + constexpr const char *LEDGER_VERSION = "0.5.0"; // Version header size in bytes when serialized in binary format. (applies to hp version as well as ledger version) // 2 bytes each for 3 version components. 2 bytes reserved. diff --git a/test/bin/hpfs b/test/bin/hpfs index 5c1d2b3a..fe568ea0 100755 Binary files a/test/bin/hpfs and b/test/bin/hpfs differ diff --git a/test/bin/hpws b/test/bin/hpws index 69c98f58..26dd64b3 100755 Binary files a/test/bin/hpws and b/test/bin/hpws differ diff --git a/test/docker/Dockerfile.ubt.20.04-njs b/test/docker/Dockerfile.ubt.20.04-njs index 9a025f9c..81f8bca8 100644 --- a/test/docker/Dockerfile.ubt.20.04-njs +++ b/test/docker/Dockerfile.ubt.20.04-njs @@ -1,6 +1,6 @@ # HotPocket (Ubuntu 20.04) + NodeJs -FROM hotpocketdev/hotpocket:ubt.20.04 +FROM hotpocketdev/hotpocket:%ver%-ubt.20.04 # Copy the node binary from build context to the container image. COPY node /usr/bin/ \ No newline at end of file diff --git a/test/docker/build.sh b/test/docker/build.sh index 23133c50..7eab92e9 100755 --- a/test/docker/build.sh +++ b/test/docker/build.sh @@ -1,15 +1,22 @@ #!/bin/bash +# Builds all the Hot Pocket docker images. hpcoredir=$(realpath ../..) -repo=hotpocketdev/hotpocket +img=hotpocketdev/hotpocket +basefile="Dockerfile.ubt.20.04" +njsfile="Dockerfile.ubt.20.04-njs" # Prepare build context tmp=$(mktemp -d) cp $hpcoredir/build/{hpcore,appbill} $hpcoredir/test/bin/{hpfs,hpws,libblake3.so} $tmp/ strip $tmp/hpcore +hpversion=$($tmp/hpcore version | head -n 1) +# Remove the revision component from hp version to make up the image version. +imgversion=$(echo "${hpversion%.*}") + # Ubuntu base image -docker build -t $repo:ubt.20.04 -f ./Dockerfile.ubt.20.04 $tmp/ +docker build -t $img:$imgversion-ubt.20.04 -f ./$basefile $tmp/ rm -r $tmp/* # NodeJs image @@ -17,6 +24,8 @@ rm -r $tmp/* curl -fsSL -o $tmp/nodejs.tar.xz https://nodejs.org/dist/v14.17.3/node-v14.17.3-linux-x64.tar.xz tar -xvJf $tmp/nodejs.tar.xz --strip-components=2 -C $tmp/ node-v14.17.3-linux-x64/bin/node rm $tmp/nodejs.tar.xz -docker build -t $repo:ubt.20.04-njs.14 -f ./Dockerfile.ubt.20.04-njs $tmp +cp ./$njsfile $tmp/ +sed -i "s/%ver%/$imgversion/g" $tmp/$njsfile +docker build -t $img:$imgversion-ubt.20.04-njs.14 -f $tmp/$njsfile $tmp rm -r $tmp \ No newline at end of file diff --git a/test/docker/push.sh b/test/docker/push.sh index 472df71d..21f46b07 100755 --- a/test/docker/push.sh +++ b/test/docker/push.sh @@ -1,7 +1,6 @@ #!/bin/bash +# Pushes all the Hot Pocket images into docker hub. -repo=hotpocketdev/hotpocket +img=hotpocketdev/hotpocket -./build.sh -docker push $repo:ubt.20.04 -docker push $repo:ubt.20.04-njs.14 \ No newline at end of file +docker image push --all-tags $img \ No newline at end of file