mirror of
https://github.com/EvernodeXRPL/hpcore.git
synced 2026-04-29 15:37:59 +00:00
Used consistent wording for HotPocket.
This commit is contained in:
10
README.md
10
README.md
@@ -1,4 +1,4 @@
|
||||
# Hot Pocket Consensus Engine
|
||||
# HotPocket Consensus Engine
|
||||
|
||||
## What's here?
|
||||
*In development*
|
||||
@@ -14,16 +14,16 @@ A C++ version of hotpocket designed for production envrionments, original protot
|
||||
* Concurrent Queue - https://github.com/cameron314/concurrentqueue
|
||||
* Boost Stacktrace - https://www.boost.org
|
||||
|
||||
## Setting up Hot Pocket development environment
|
||||
## Setting up HotPocket development environment
|
||||
Run the setup script located at the repo root (tested on Ubuntu 20.04).
|
||||
```
|
||||
./dev-setup.sh
|
||||
```
|
||||
|
||||
## Build Hot Pocket
|
||||
## Build HotPocket
|
||||
1. Run `cmake .` (You only have to do this once)
|
||||
1. Run `make` (Hot Pocket binary will be created as `./build/hpcore`)
|
||||
1. Refer to the Wiki for instructions on running Hot Pocket.
|
||||
1. Run `make` (HotPocket binary will be created as `./build/hpcore`)
|
||||
1. Refer to the Wiki for instructions on running HotPocket.
|
||||
|
||||
## FlatBuffers message definitions
|
||||
If you update flatbuffers message definitions, you need to run the flatbuffers code generator to update the stubs.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
# Usage ./dev-setup.sh
|
||||
# Hot Pocket build environment setup script.
|
||||
# HotPocket build environment setup script.
|
||||
|
||||
set -e # exit on error
|
||||
|
||||
@@ -105,6 +105,6 @@ sudo ldconfig
|
||||
popd > /dev/null 2>&1
|
||||
rm -r $workdir
|
||||
|
||||
# Build Hot Pocket
|
||||
# Build HotPocket
|
||||
cmake .
|
||||
make
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/hotpocket-js-client/browser.min.js"></script>
|
||||
|
||||
<!--Hot Pocket client library requires libsodium js for cryptographic operations.-->
|
||||
<!--HotPocket client library requires libsodium js for cryptographic operations.-->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/libsodium-wrappers/0.5.4/sodium.min.js"
|
||||
integrity="sha512-oRfU7aik4u7f0dPAKgOyA4+bb/YRGfAaD5RA4Z3Mb2ycPcGDs+k8qAnDNd7ouruoqlIHSuGVaTTlEs91Gvd37A=="
|
||||
crossorigin="anonymous"></script>
|
||||
|
||||
@@ -27,7 +27,7 @@ const diagnosticContract = async (ctx) => {
|
||||
let output = null;
|
||||
|
||||
if (mode === "status") {
|
||||
output = "Hot Pocket diagnostic contract is running.";
|
||||
output = "HotPocket diagnostic contract is running.";
|
||||
}
|
||||
else if (mode === "file") {
|
||||
const param = parseInt(data);
|
||||
|
||||
@@ -259,7 +259,7 @@ namespace conf
|
||||
struct contract_ctx
|
||||
{
|
||||
std::string command; // The CLI command issued to launch HotPocket
|
||||
std::string exe_dir; // Hot Pocket executable dir.
|
||||
std::string exe_dir; // HotPocket executable dir.
|
||||
std::string hpws_exe_path; // hpws executable file path.
|
||||
std::string hpfs_exe_path; // hpfs executable file path.
|
||||
|
||||
@@ -281,7 +281,7 @@ namespace conf
|
||||
struct flock config_lock; // Config file lock.
|
||||
};
|
||||
|
||||
// Log severity levels used in Hot Pocket.
|
||||
// Log severity levels used in HotPocket.
|
||||
enum LOG_SEVERITY
|
||||
{
|
||||
DEBUG,
|
||||
|
||||
@@ -86,7 +86,7 @@ namespace consensus
|
||||
{
|
||||
if (kill_switch(util::get_epoch_milliseconds()))
|
||||
{
|
||||
LOG_ERROR << "Hot Pocket usage limit failure.";
|
||||
LOG_ERROR << "HotPocket usage limit failure.";
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -715,7 +715,7 @@ namespace consensus
|
||||
|
||||
// If a node doesn't have enough time (eg. due to network delay) to recieve/send reliable stage proposals for next stage,
|
||||
// it will join in next round. Otherwise it will continue particapating in this round.
|
||||
if (stage_start < now || to_wait < ctx.stage_reset_wait_threshold) //todo: self claculating/adjusting network delay
|
||||
if (stage_start < now || to_wait < ctx.stage_reset_wait_threshold) // todo: self claculating/adjusting network delay
|
||||
{
|
||||
LOG_DEBUG << "Missed stage " << std::to_string(ctx.stage) << " window. Resetting to stage 0.";
|
||||
ctx.stage = 0;
|
||||
@@ -1420,7 +1420,7 @@ namespace consensus
|
||||
* @param prop_patch_hash Hash of patch file which reached consensus.
|
||||
* @param current_patch_hash Hash of the current patch file.
|
||||
* @return 0 on success. -1 on failure.
|
||||
*/
|
||||
*/
|
||||
int apply_consensed_patch_file_changes(const util::h32 &prop_patch_hash, const util::h32 ¤t_patch_hash)
|
||||
{
|
||||
// Check whether is there any patch changes to be applied which reached consensus.
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
###
|
||||
# ##
|
||||
# Compile-time timestamping library
|
||||
#
|
||||
#
|
||||
|
||||
# Adapted from https://github.com/kraiskil/cmake_timestamp
|
||||
# This is only used for the Hot Pocket kill switch.
|
||||
# This is only used for the HotPocket kill switch.
|
||||
|
||||
#CMake 3.12 made using OBJECT libraries much nicer, so we use that.
|
||||
# CMake 3.12 made using OBJECT libraries much nicer, so we use that.
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
|
||||
# Set CMake variable BUILD_TIME to 'now'. This 'now' is the time
|
||||
@@ -13,26 +13,25 @@ cmake_minimum_required(VERSION 3.12)
|
||||
string(TIMESTAMP BUILD_TIME "%s" UTC)
|
||||
|
||||
# Compile the library that contains the global variables
|
||||
add_library( killswitch OBJECT killswitch.c)
|
||||
add_library(killswitch OBJECT killswitch.c)
|
||||
target_compile_definitions(
|
||||
killswitch
|
||||
PRIVATE -DBUILD_TIME="${BUILD_TIME}"
|
||||
)
|
||||
target_include_directories( killswitch
|
||||
target_include_directories(killswitch
|
||||
PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||
)
|
||||
|
||||
#Add a dummy target that removes the CMake variable BUILD_TIME from CMake's cache.
|
||||
#this forces CMake to be-rerun when we hit this target.
|
||||
# Add a dummy target that removes the CMake variable BUILD_TIME from CMake's cache.
|
||||
# this forces CMake to be-rerun when we hit this target.
|
||||
add_custom_target(
|
||||
clear_cache
|
||||
COMMAND ${CMAKE_COMMAND} -U BUILD_TIME ${CMAKE_BINARY_DIR}
|
||||
)
|
||||
|
||||
#Have the cache clearing be run before trying to build the killswitch library.
|
||||
#This (I think) is the same as a PRE_BUILD custom_command. But PRE_BUILD is
|
||||
#available for VS generators only, on others it is synonymous to PRE_LINK,
|
||||
#i.e. "post compile"
|
||||
# Have the cache clearing be run before trying to build the killswitch library.
|
||||
# This (I think) is the same as a PRE_BUILD custom_command. But PRE_BUILD is
|
||||
# available for VS generators only, on others it is synonymous to PRE_LINK,
|
||||
# i.e. "post compile"
|
||||
add_dependencies(killswitch clear_cache)
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ uint64_t build_time_sec = 0;
|
||||
|
||||
/**
|
||||
* Returns true if kill switch is activated (allowed time has expired).
|
||||
* Otherwise returns false (can keep using Hot Pocket).
|
||||
* Otherwise returns false (can keep using HotPocket).
|
||||
* @param epoch_ms Current time in epoch milliseconds.
|
||||
*/
|
||||
bool kill_switch(const uint64_t epoch_ms)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Based on https://github.com/kraiskil/cmake_timestamp
|
||||
|
||||
This whole folder exists to get the CMAKE compile/link time into the binary so we can perform
|
||||
Hot Pocket time-based kill switch check. This folder must be removed when we no longer need the kill switch.
|
||||
HotPocket time-based kill switch check. This folder must be removed when we no longer need the kill switch.
|
||||
|
||||
@@ -18,12 +18,12 @@
|
||||
#include "killswitch/killswitch.h"
|
||||
|
||||
/**
|
||||
* Parses CLI args and extracts hot pocket command and parameters given.
|
||||
* Parses CLI args and extracts HotPocket command and parameters given.
|
||||
* HP command line accepts command and the contract directory(optional)
|
||||
*/
|
||||
int parse_cmd(int argc, char **argv)
|
||||
{
|
||||
if (argc > 1) //We get working dir as an arg anyway. So we need to check for >1 args.
|
||||
if (argc > 1) // We get working dir as an arg anyway. So we need to check for >1 args.
|
||||
{
|
||||
// We populate the global contract ctx with the detected command.
|
||||
conf::ctx.command = argv[1];
|
||||
@@ -162,7 +162,7 @@ int main(int argc, char **argv)
|
||||
{
|
||||
if (kill_switch(util::get_epoch_milliseconds()))
|
||||
{
|
||||
std::cerr << "Hot Pocket usage limit failure.\n";
|
||||
std::cerr << "HotPocket usage limit failure.\n";
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -202,7 +202,7 @@ int main(int argc, char **argv)
|
||||
|
||||
hplog::init();
|
||||
|
||||
LOG_INFO << "Hot Pocket " << version::HP_VERSION;
|
||||
LOG_INFO << "HotPocket " << version::HP_VERSION;
|
||||
LOG_INFO << "Role: " << (conf::cfg.node.role == conf::ROLE::OBSERVER ? "Observer" : "Validator");
|
||||
LOG_INFO << "Public key: " << conf::cfg.node.public_key_hex;
|
||||
LOG_INFO << "Contract: " << conf::cfg.contract.id << " (" << conf::cfg.contract.version << ")";
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace msg::usrmsg::json
|
||||
// We do not use jsoncons library here in favour of performance because this is a simple json message.
|
||||
|
||||
// Since we know the rough size of the challenge message we reserve adequate amount for the holder.
|
||||
// Only Hot Pocket version number is variable length.
|
||||
// Only HotPocket version number is variable length.
|
||||
msg.reserve(256);
|
||||
msg += "{\"";
|
||||
msg += msg::usrmsg::FLD_HP_VERSION;
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
|
||||
namespace p2p
|
||||
{
|
||||
/**
|
||||
* Represents a WebSocket connection to a Hot Pocket peer.
|
||||
/**
|
||||
* Represents a WebSocket connection to a HotPocket peer.
|
||||
*/
|
||||
class peer_comm_session : public comm::comm_session
|
||||
{
|
||||
|
||||
@@ -563,7 +563,7 @@ namespace sc
|
||||
}
|
||||
else if (pid > 0)
|
||||
{
|
||||
// Hot Pocket process.
|
||||
// HotPocket process.
|
||||
int status = 0;
|
||||
if (waitpid(pid, &status, 0) == -1)
|
||||
{
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
|
||||
namespace usr
|
||||
{
|
||||
/**
|
||||
* Represents a WebSocket connection to a Hot Pocket user.
|
||||
/**
|
||||
* Represents a WebSocket connection to a HotPocket user.
|
||||
*/
|
||||
class user_comm_session : public comm::comm_session
|
||||
{
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
namespace version
|
||||
{
|
||||
// Hot Pocket version. Written to new configs and p2p/user messages.
|
||||
// HotPocket version. Written to new configs and p2p/user messages.
|
||||
constexpr const char *HP_VERSION = "0.6.0";
|
||||
|
||||
// Minimum compatible config version (this will be used to validate configs).
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/bin/bash
|
||||
# Builds all the Hot Pocket docker images.
|
||||
# Builds all the HotPocket docker images.
|
||||
|
||||
hpcoredir=$(realpath ../..)
|
||||
img=evernodedev/hotpocket
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/bin/bash
|
||||
# Pushes all the Hot Pocket images into docker hub.
|
||||
# Pushes all the HotPocket images into docker hub.
|
||||
|
||||
img=evernodedev/hotpocket
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# We are going with Hot Pocket NodeJs docker image because sample contracts need NodeJs to run.
|
||||
# We are going with HotPocket NodeJs docker image because sample contracts need NodeJs to run.
|
||||
FROM evernodedev/hotpocket:latest-ubt.20.04-njs.16
|
||||
|
||||
# Copy (overwrite) the local build outputs into the docker image.
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
# Validate the node count arg.
|
||||
if [ -n "$1" ] && [ "$1" -eq "$1" ] 2>/dev/null; then
|
||||
echo "Generating a Hot Pocket cluster of ${1} node(s)..."
|
||||
echo "Generating a HotPocket cluster of ${1} node(s)..."
|
||||
else
|
||||
echo "Error: Please provide number of nodes."
|
||||
exit 1
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/bin/bash
|
||||
# Hot Pocket cluster management script.
|
||||
# HotPocket cluster management script.
|
||||
|
||||
# Usage examples:
|
||||
# ./cluster.sh new
|
||||
@@ -10,15 +10,15 @@
|
||||
# Command modes:
|
||||
# info - Displays information about current cluster configuration status.
|
||||
# select - Sets the currently active contract from the list of contracts defined in cluster config file.
|
||||
# new - Install hot pocket dependencies and hot pocket with example contracts to each node.
|
||||
# updatebin - Deploy updated hot pocket and example binaries into specified node or entire cluster.
|
||||
# new - Install HotPocket dependencies and HotPocket with example contracts to each node.
|
||||
# updatebin - Deploy updated HotPocket and example binaries into specified node or entire cluster.
|
||||
# updateconfig - Updates the config file of specified node or entire cluster.
|
||||
# reconfig - Cleans and reconfigures the entire cluster using already uploaded HP binaries.
|
||||
# start - Run hot pocket on specified node or entire cluster.
|
||||
# stop - Gracefully stop hot pocket (if running) on specified node or entire cluster.
|
||||
# check - Get hot pocket running process ids on specified node or entire cluster.
|
||||
# log - Stream hot pocket console output log (if running) on specified node.
|
||||
# kill - Force kill hot pocket (if running) on specified node or entire cluster.
|
||||
# start - Run HotPocket on specified node or entire cluster.
|
||||
# stop - Gracefully stop HotPocket (if running) on specified node or entire cluster.
|
||||
# check - Get HotPocket running process ids on specified node or entire cluster.
|
||||
# log - Stream HotPocket console output log (if running) on specified node.
|
||||
# kill - Force kill HotPocket (if running) on specified node or entire cluster.
|
||||
# reboot - Reboot specified node.
|
||||
# ssh - Open up an ssh terminal for the specified node.
|
||||
# ssl - Creates LetsEncrypt ssl certs matching with the domain name.
|
||||
|
||||
Reference in New Issue
Block a user