Hotpocket version changes (#336)

This commit is contained in:
Chalith Desaman
2021-07-28 16:33:58 +05:30
committed by GitHub
parent 866a617989
commit 4a5c3554bd
10 changed files with 27 additions and 13 deletions

View File

@@ -1,6 +1,8 @@
#ifndef __HOTPOCKET_CONTRACT_LIB_C__
#define __HOTPOCKET_CONTRACT_LIB_C__
// Hot Pocket contract library version 0.5.0
#include <stdio.h>
#include <unistd.h>
#include <string.h>

View File

@@ -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;

View File

@@ -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",

View File

@@ -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
{

View File

@@ -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.

Binary file not shown.

Binary file not shown.

View File

@@ -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/

View File

@@ -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

View File

@@ -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
docker image push --all-tags $img