This article mainly explains the event plug-in deployment steps, including: MongoDB, Tron event subscribe plugin, Tron Event Query Service deployment commands, and detailed introduction to the Tron Event Query Service interface.
# Suggested Configuration
CPU/ RAM: 16Core / 32G
System: CentOS 64
# Plugin logic
Tron event subscribe plugin's function is to get event information from nodes and store it in MongoDB
MongoDB's function is to save event information
The function of Tron Event Query Service is to provide the encapsulated http interfaces to get event information from MongoDB.
# Deploy Tron Event Subscribe Plugin
Configure node configuration file Append at the end of the node configuration file. Here is an example. See also README.md.
path: is the absolute path of "plugin-kafka-1.0.0.zip" or "plugin-mongodb-1.0.0.zip"
server: Kafka server address or mongodb server address
dbconfig: this is mongodb configuration, assign it to "" for kafka plugin
topics: each event type maps to one Kafka topic, we support four event types subscribing, block, transaction, contract log and contract event.
triggerName: the trigger type, the value can't be modified.
enable: plugin can receive nothing if the value is false.
topic: the value is the kafka topic or mongodb collection to receive events. Make sure it has been created and Kafka process is running
# Deploy MongoDB
Write the created data and log folder to the configuration file (absolute path) Configuration file example:
bind_ip must be configured to 0.0.0.0，otherwise remote connection will be refused.
wiredTigerCacheSizeGB, must be configured to prevent OOM
# Deploy Tron Event Query Service
After the command is successfully executed, the jar package is generated under the troneventquery/target, and the configuration file is generated. The path is troneventquery/config.conf. The configured content is:
The default port is 8080. If you want to change it, modify the script troneventquery/deploy.sh: nohup java -jar -Dserver.port=8081 target/troneventquery-1.0.0-SNAPSHOT.jar 2>&1 &
# Load plugin in Java-tron and verification
# Use Event Query Service
Main HTTP Service