This are changes that I had to make outside plugins/ in order to make substitution functionality work.
libraries/chain/controller.cpp: Add optional post_db_initstd::function based hook, this is needed in order to enable substitution before replay, but after intial db setup, might need to consider a way to allow multiple plugins to register a hook?
libraries/chain/include/eosio/chain/controller.hpp: Make mutable_db a public method, need to get a non const ref to the main chainbase::database in order to perform subsitutions.
libraries/chain/include/eosio/chain/types.hpp: Add custom subst_meta_type to internal nodeos db types to store our metadata.
libraries/chain/include/eosio/chain/wasm_interface.hpp: Ugly change, need to make the wasm_interface_impl pointer public in order to clear code caches after updating a substitution.
libraries/libfc/include/fc/network/http/http_client.hpp & libraries/libfc/src/network/http/http_client.cpp: Add http GET methods.
plugins/CMakeLists.txt: Add subst_plugin and subst_plugin_api build.
programs/nodeos/CMakeLists.txt: Add subst_plugin & subst_plugin_api to nodeos link step.
Internal
nodeos
changes:This are changes that I had to make outside
plugins/
in order to make substitution functionality work.libraries/chain/controller.cpp
: Add optionalpost_db_init
std::function
based hook, this is needed in order to enable substitution before replay, but after intial db setup, might need to consider a way to allow multiple plugins to register a hook?libraries/chain/include/eosio/chain/controller.hpp
: Makemutable_db
a public method, need to get a nonconst
ref to the mainchainbase::database
in order to perform subsitutions.libraries/chain/include/eosio/chain/types.hpp
: Add customsubst_meta_type
to internalnodeos
db types to store our metadata.libraries/chain/include/eosio/chain/wasm_interface.hpp
: Ugly change, need to make thewasm_interface_impl
pointer public in order to clear code caches after updating a substitution.libraries/libfc/include/fc/network/http/http_client.hpp
&libraries/libfc/src/network/http/http_client.cpp
: Add httpGET
methods.plugins/CMakeLists.txt
: Add subst_plugin and subst_plugin_api build.programs/nodeos/CMakeLists.txt
: Addsubst_plugin
&subst_plugin_api
tonodeos
link step.