Nodeos plugin for cache contract abi information.
This plugin will insert all abi into redis. Multiple abi of same account stored as a <abi_sequence>-<abi_binary_data>
Hash. Full archive of abi make it convenient to deserialize action_trace
data, also make it possible to process blockchain history data in parallel.
# e.g.
sudo apt install libhiredis-dev
- Get
abi_cache_plugin
source code.
git clone https://github.com/EOSLaoMao/abi_cache_plugin.git plugins/abi_cache_plugin
cd plugins/abi_cache_plugin
git submodule update --init --recursive
- Add subdirectory to
plugins/CMakeLists.txt
.
...
add_subdirectory(mongo_db_plugin)
add_subdirectory(login_plugin)
add_subdirectory(login_plugin)
add_subdirectory(abi_cache_plugin) # add this line.
...
- Add following line to
programs/nodeos/CMakeLists.txt
.
target_link_libraries( ${NODE_EXECUTABLE_NAME}
PRIVATE appbase
PRIVATE -Wl,${whole_archive_flag} login_plugin -Wl,${no_whole_archive_flag}
PRIVATE -Wl,${whole_archive_flag} history_plugin -Wl,${no_whole_archive_flag}
...
# add this line.
PRIVATE -Wl,${whole_archive_flag} abi_cache_plugin -Wl,${no_whole_archive_flag}
...
The plugin will cache the contract abi both in nodeos process and redis. If redis host is not specified then redis cache is disabled.
--abi-cache-thread-pool-size arg (=4) The size of the data processing thread pool.
--abi-cache-redis-host arg Redis host, If not specified then Redis cache is disabled.
--abi-cache-redis-port arg (=6379) Redis port.