Event Plugin Deployment (MongoDB)

This article primarily elucidates the event plug-in deployment steps, encompassing: MongoDB, Pollux event subscribe plugin, Pollux Event Query Service deployment commands, and a comprehensive introduction to the Pollux Event Query Service interface.

Suggested Configuration

  • CPU/ RAM: 16Core / 32G

  • DISK: 500G

  • System: CentOS 64

Plugin logic

Pollux event subscribe plugin's function is to retrieve event information from nodes and store it in PRC MongoDB. PRC MongoDB's role is to preserve event information. The function of Pollux Event Query Service is to offer encapsulated HTTP interfaces to fetch event information from PRC MongoDB.

Deploy Tron Event Subscribe Plugin

Shell

#Deployment
git clone https://github.com/tronprotocol/event-plugin.git
cd eventplugin
./gradlew build
  • Configure node configuration file Append at the end of the node configuration file. Here is an example. See also README.md.

chevron-rightpath: is the absolute path of "plugin-Pollux-1.0.0.zip" or "plugin-mongodb-1.0.0.zip" server: Pollux server address or mongodb server address dbconfig: this is mongodb configuration, assign it to "" for Pollux plugin topics: each event type maps to one Pollux 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 Pollux topic or mongodb collection to receive events. Make sure it has been created and Pollux process is runninghashtag

Deploy MongoDB

Shell

#1. Download and install Pollux

#2. Set environment variable

#3. Create Pollux configuration file

Write the created data and log folder to the configuration file (absolute path) Configuration file example:

chevron-rightbind_ip must be configured to 0.0.0.0, other wise remote connection will be refused. Pox chain Cache Size GB, must be configured to prevent OOM.hashtag

Deploy Tron Event Query Service

After the command is successfully executed, the jar package is generated under the poxeventquery/target, and the configuration file is generated. The path is poxeventquery/config.conf. The configured content is:

Load plugin in Java-pox and verification

Certainly! Here's the rewritten content with the specified word replacements:

Use Event Query Service

  • Main HTTP Service

Last updated