CCF
Loading...
Searching...
No Matches
governance_driven_registry.h
Go to the documentation of this file.
1// Copyright (c) Microsoft Corporation. All rights reserved.
2// Licensed under the Apache 2.0 License.
3#pragma once
4
5#include "ccf/js/registry.h"
8
9namespace ccf::js
10{
11 // This sample extends the generic BaseDynamicJSEndpointRegistry to read JS
12 // endpoints (code, metadata, options) from governance tables. Specifically,
13 // tables populated by actions in the default sample CCF constitution
14 // (set_js_app). This can be sub-classed to modify the dispatch or execution
15 // behaviour, or to provide further JS extension APIs via get_extensions().
16 //
17 // An application running this registry with no further extensions is shipped
18 // with the CCF releases as `js_generic`.
21 {
22 public:
24 // Note: We do not pass a kv_prefix here, instead we explicitly, manually
25 // construct each map name to match previously used values
27 {
28 modules_map = ccf::Tables::MODULES;
29 metadata_map = ccf::endpoints::Tables::ENDPOINTS;
30 interpreter_flush_map = ccf::Tables::INTERPRETER_FLUSH;
31 modules_quickjs_version_map = ccf::Tables::MODULES_QUICKJS_VERSION;
32 modules_quickjs_bytecode_map = ccf::Tables::MODULES_QUICKJS_BYTECODE;
33 runtime_options_map = ccf::Tables::JSENGINE;
34 }
35 };
36} // namespace ccf::js
ccf::AbstractNodeContext & context
Definition base_endpoint_registry.h:123
std::string interpreter_flush_map
Definition registry.h:67
std::string modules_quickjs_bytecode_map
Definition registry.h:69
std::string runtime_options_map
Definition registry.h:70
std::string modules_map
Definition registry.h:65
std::string metadata_map
Definition registry.h:66
std::string modules_quickjs_version_map
Definition registry.h:68
Definition governance_driven_registry.h:21
GovernanceDrivenJSRegistry(AbstractNodeContext &context)
Definition governance_driven_registry.h:23
Definition bundle.h:12
Definition app_interface.h:14
Definition node_context.h:12