Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -354,15 +354,12 @@ configure_file(
)
install(FILES ${CCF_DIR}/include/ccf/version.h DESTINATION include/ccf)

file(
READ ${CCF_DIR}/doc/host_config_schema/cchost_config.json
HOST_CONFIG_SCHEMA
)
file(READ ${CCF_DIR}/doc/host_config_schema/host_config.json HOST_CONFIG_SCHEMA)
set_property(
DIRECTORY
APPEND
PROPERTY
CMAKE_CONFIGURE_DEPENDS ${CCF_DIR}/doc/host_config_schema/cchost_config.json
CMAKE_CONFIGURE_DEPENDS ${CCF_DIR}/doc/host_config_schema/host_config.json
)
configure_file(
${CCF_DIR}/src/host/config_schema.h.in
Expand Down
2 changes: 1 addition & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ def setup(app):
)

# configuration generator
input_file_path = doc_dir / "host_config_schema/cchost_config.json"
input_file_path = doc_dir / "host_config_schema/host_config.json"
output_file_path = doc_dir / "operations/generated_config.rst"

if os.path.exists(input_file_path):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
{
"enclave": {
"file": "/opt/ccf_virtual/lib/libjs_generic.virtual.so",
"type": "Virtual",
"platform": "Virtual"
},
"network": {
"node_to_node_interface": { "bind_address": "127.0.0.1:8081" },
"rpc_interfaces": {
Expand Down
4 changes: 3 additions & 1 deletion samples/minimal_ccf/ccf_runtime/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ RUN mkdir /staging \
&& rm -rf /staging/run/* \
&& rm -rf /staging/var/cache/tdnf \
&& find /staging/var/log -type f -size +0 -delete \
&& mv /staging/opt/ccf_${PLATFORM}/bin/cchost /staging/usr/bin/cchost
# Stage js_generic on PATH as a sample application binary. Replace this
# with the actual intended application binary when adapting this image.
&& mv /staging/opt/ccf_${PLATFORM}/bin/js_generic /staging/usr/bin/js_generic

FROM mcr.microsoft.com/azurelinux/distroless/minimal:3.0

Expand Down
2 changes: 1 addition & 1 deletion samples/minimal_ccf/run_app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ docker run \
--name ccf \
--rm -v "$(pwd)/app:/app" \
-p 8080:8080 \
${my_app_target} cchost --config /app/cchost_config_${PLATFORM}_js.json &
${my_app_target} js_generic --config /app/config_${PLATFORM}_js.json &
Comment thread
maxtropets marked this conversation as resolved.

Comment thread
maxtropets marked this conversation as resolved.
sleep 3 && docker rm -f ccf
50 changes: 25 additions & 25 deletions src/host/configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ namespace host
data_json_file,
recovery_role);

struct CCHostConfig : public ccf::CCFConfig
struct HostConfig : public ccf::CCFConfig
{
ccf::ds::TimeString tick_interval = {"10ms"};
ccf::ds::TimeString slow_io_logging_threshold = {"10ms"};
Expand Down Expand Up @@ -127,38 +127,38 @@ namespace host
Command command = {};
};

DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS(CCHostConfig::OutputFiles);
DECLARE_JSON_REQUIRED_FIELDS(CCHostConfig::OutputFiles);
DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS(HostConfig::OutputFiles);
DECLARE_JSON_REQUIRED_FIELDS(HostConfig::OutputFiles);
DECLARE_JSON_OPTIONAL_FIELDS(
CCHostConfig::OutputFiles,
HostConfig::OutputFiles,
node_certificate_file,
pid_file,
node_to_node_address_file,
rpc_addresses_file);

DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS(CCHostConfig::Logging);
DECLARE_JSON_REQUIRED_FIELDS(CCHostConfig::Logging);
DECLARE_JSON_OPTIONAL_FIELDS(CCHostConfig::Logging, format);
DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS(HostConfig::Logging);
DECLARE_JSON_REQUIRED_FIELDS(HostConfig::Logging);
DECLARE_JSON_OPTIONAL_FIELDS(HostConfig::Logging, format);

DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS(CCHostConfig::Memory);
DECLARE_JSON_REQUIRED_FIELDS(CCHostConfig::Memory);
DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS(HostConfig::Memory);
DECLARE_JSON_REQUIRED_FIELDS(HostConfig::Memory);
DECLARE_JSON_OPTIONAL_FIELDS(
CCHostConfig::Memory, circuit_size, max_msg_size, max_fragment_size);
HostConfig::Memory, circuit_size, max_msg_size, max_fragment_size);

DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS(CCHostConfig::Command::Start);
DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS(HostConfig::Command::Start);
DECLARE_JSON_REQUIRED_FIELDS(
CCHostConfig::Command::Start, members, constitution_files);
HostConfig::Command::Start, members, constitution_files);
DECLARE_JSON_OPTIONAL_FIELDS(
CCHostConfig::Command::Start,
HostConfig::Command::Start,
service_configuration,
initial_service_certificate_validity_days,
service_subject_name,
cose_signatures);

DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS(CCHostConfig::Command::Join);
DECLARE_JSON_REQUIRED_FIELDS(CCHostConfig::Command::Join, target_rpc_address);
DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS(HostConfig::Command::Join);
DECLARE_JSON_REQUIRED_FIELDS(HostConfig::Command::Join, target_rpc_address);
DECLARE_JSON_OPTIONAL_FIELDS(
CCHostConfig::Command::Join,
HostConfig::Command::Join,
retry_timeout,
follow_redirect,
fetch_recent_snapshot,
Expand All @@ -167,22 +167,22 @@ namespace host
fetch_snapshot_max_size,
host_data_transparent_statement_path);

DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS(CCHostConfig::Command::Recover);
DECLARE_JSON_REQUIRED_FIELDS(CCHostConfig::Command::Recover);
DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS(HostConfig::Command::Recover);
DECLARE_JSON_REQUIRED_FIELDS(HostConfig::Command::Recover);
DECLARE_JSON_OPTIONAL_FIELDS(
CCHostConfig::Command::Recover,
HostConfig::Command::Recover,
initial_service_certificate_validity_days,
previous_service_identity_file);

DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS(CCHostConfig::Command);
DECLARE_JSON_REQUIRED_FIELDS(CCHostConfig::Command, type);
DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS(HostConfig::Command);
DECLARE_JSON_REQUIRED_FIELDS(HostConfig::Command, type);
DECLARE_JSON_OPTIONAL_FIELDS(
CCHostConfig::Command, service_certificate_file, start, join, recover);
HostConfig::Command, service_certificate_file, start, join, recover);

DECLARE_JSON_TYPE_WITH_BASE_AND_OPTIONAL_FIELDS(CCHostConfig, ccf::CCFConfig);
DECLARE_JSON_REQUIRED_FIELDS(CCHostConfig, command);
DECLARE_JSON_TYPE_WITH_BASE_AND_OPTIONAL_FIELDS(HostConfig, ccf::CCFConfig);
DECLARE_JSON_REQUIRED_FIELDS(HostConfig, command);
DECLARE_JSON_OPTIONAL_FIELDS(
CCHostConfig,
HostConfig,
tick_interval,
slow_io_logging_threshold,
node_client_interface,
Expand Down
20 changes: 10 additions & 10 deletions src/host/run.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ static constexpr size_t retry_interval_ms = 100;

namespace ccf
{
void validate_and_adjust_recovery_threshold(host::CCHostConfig& config)
void validate_and_adjust_recovery_threshold(host::HostConfig& config)
{
if (config.command.type != StartType::Start)
{
Expand Down Expand Up @@ -191,7 +191,7 @@ namespace ccf
};

void setup_rpc_interfaces(
host::CCHostConfig& config,
host::HostConfig& config,
asynchost::RPCConnections<asynchost::TCP>& rpc,
asynchost::RPCConnections<asynchost::UDP>& rpc_udp)
{
Expand Down Expand Up @@ -341,7 +341,7 @@ namespace ccf
}

void populate_config_for_start(
const host::CCHostConfig& config, ccf::StartupConfig& startup_config)
const host::HostConfig& config, ccf::StartupConfig& startup_config)
{
for (auto const& member : config.command.start.members)
{
Expand Down Expand Up @@ -404,7 +404,7 @@ namespace ccf
}

void populate_config_for_join(
const host::CCHostConfig& config, ccf::StartupConfig& startup_config)
const host::HostConfig& config, ccf::StartupConfig& startup_config)
{
LOG_INFO_FMT(
"Creating new node - join existing network at {}",
Expand All @@ -428,7 +428,7 @@ namespace ccf
}

void populate_config_for_recover(
const host::CCHostConfig& config, ccf::StartupConfig& startup_config)
const host::HostConfig& config, ccf::StartupConfig& startup_config)
{
LOG_INFO_FMT("Creating new node - recover");
startup_config.initial_service_certificate_validity_days =
Expand All @@ -446,7 +446,7 @@ namespace ccf
}

std::optional<size_t> create_enclave_node(
const host::CCHostConfig& config,
const host::HostConfig& config,
messaging::BufferProcessor& buffer_processor,
ringbuffer::Circuit& circuit,
EnclaveConfig& enclave_config,
Expand Down Expand Up @@ -508,7 +508,7 @@ namespace ccf
}

void write_certificates_to_disk(
const host::CCHostConfig& config,
const host::HostConfig& config,
const std::vector<uint8_t>& node_cert,
const std::vector<uint8_t>& service_cert)
{
Expand All @@ -529,7 +529,7 @@ namespace ccf
}
}

void run_enclave_threads(const host::CCHostConfig& config)
void run_enclave_threads(const host::HostConfig& config)
{
auto enclave_thread_start = [&](threading::ThreadID thread_id) {
threading::set_current_thread_id(thread_id);
Expand Down Expand Up @@ -573,7 +573,7 @@ namespace ccf
}

std::optional<size_t> run_main_loop(
host::CCHostConfig& config,
host::HostConfig& config,
messaging::BufferProcessor& buffer_processor,
ringbuffer::Circuit& circuit,
EnclaveConfig& enclave_config,
Expand Down Expand Up @@ -954,7 +954,7 @@ namespace ccf
schema_error_msg.value()));
}

host::CCHostConfig config = config_json;
host::HostConfig config = config_json;

if (config.logging.format == host::LogFormat::JSON)
{
Expand Down
2 changes: 1 addition & 1 deletion tests/historical_query_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ def run(args):
args.package = "samples/apps/logging/logging"
args.nodes = infra.e2e_args.min_nodes(args, f=1)
args.initial_member_count = 1
args.sig_ms_interval = 1000 # Set to cchost default value
args.sig_ms_interval = 1000 # Set to node default value
args.historical_cache_soft_limit = "20KB"

run(args)
2 changes: 1 addition & 1 deletion tests/historical_query_perf.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,5 +219,5 @@ def add(parser):
args.package = "samples/apps/logging/logging"
args.nodes = infra.e2e_args.max_nodes(args, f=0)
args.initial_member_count = 1
args.sig_ms_interval = 1000 # Set to cchost default value
args.sig_ms_interval = 1000 # Set to node default value
run(args)
2 changes: 1 addition & 1 deletion tests/infra/e2e_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def cli_args(
parser.add_argument(
"-b",
"--binary-dir",
help="Path to CCF binaries (cchost, scurl, keygenerator)",
help="Path to CCF binaries (node executable, scurl, keygenerator)",
default=".",
)
parser.add_argument(
Expand Down
5 changes: 5 additions & 0 deletions tests/infra/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,11 @@ def _setup(
lib_path,
workspace,
common_dir,
binary_name=(
"cchost"
if self.major_version is not None and self.major_version < 7
else None
),
binary_dir=self.binary_dir,
label=label,
local_node_id=self.local_node_id,
Expand Down
2 changes: 1 addition & 1 deletion tests/infra/piccolo_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def run(get_command, args):

args.initial_user_count = 3
args.sig_ms_interval = 100
args.ledger_chunk_bytes = "5MB" # Set to cchost default value
args.ledger_chunk_bytes = "5MB" # Set to node default value

LOG.info("Starting nodes on {}".format(hosts))

Expand Down
6 changes: 4 additions & 2 deletions tests/infra/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,6 @@ def get_result(self, line_count):


class CCFRemote(object):
BIN = "cchost"
TEMPLATE_CONFIGURATION_FILE = "config.jinja"
DEPS = []

Expand All @@ -294,6 +293,7 @@ def __init__(
enclave_file,
workspace,
common_dir,
binary_name=None,
label="",
binary_dir=".",
local_node_id=None,
Expand Down Expand Up @@ -382,10 +382,12 @@ def __init__(
self.node_address_file = f"{local_node_id}.node_address"
self.rpc_addresses_file = f"{local_node_id}.rpc_addresses"

self.BIN = infra.path.build_bin_path(self.BIN, binary_dir=binary_dir)
# 7.x releases combined binaries and removed the separate cchost entry-point
if major_version is None or major_version >= 7:
self.BIN = enclave_file
else:
assert binary_name, "binary_name must be provided when major_version < 7"
self.BIN = infra.path.build_bin_path(binary_name, binary_dir=binary_dir)

self.common_dir = common_dir
self.pub_host = host.get_primary_interface().public_host
Expand Down
4 changes: 2 additions & 2 deletions tests/infra/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ def run(get_command, args):
hosts = infra.e2e_args.nodes(args, minimum_number_of_local_nodes(args))

args.initial_user_count = 3
args.sig_ms_interval = 1000 # Set to cchost default value
args.ledger_chunk_bytes = "5MB" # Set to cchost default value
args.sig_ms_interval = 1000 # Set to node default value
args.ledger_chunk_bytes = "5MB" # Set to node default value

LOG.info("Starting nodes on {}".format(hosts))

Expand Down
2 changes: 1 addition & 1 deletion tests/lts_compatibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,7 @@ def add(parser):
args.package = "js_generic"
args.nodes = infra.e2e_args.max_nodes(args, f=0)
args.jwt_key_refresh_interval_s = 3
args.sig_ms_interval = 1000 # Set to cchost default value
args.sig_ms_interval = 1000 # Set to node default value

# Hardcoded because host only accepts info log on release builds
args.log_level = "info"
Expand Down