Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

websocket contract event doesn't work #17

Open
l3lackrooz opened this issue Sep 12, 2021 · 0 comments
Open

websocket contract event doesn't work #17

l3lackrooz opened this issue Sep 12, 2021 · 0 comments

Comments

@l3lackrooz
Copy link

I want to watch the event usdt trc20
I ran a full node server with the event plugin service, but i can only see "blockTrigger", "transactionTrigger" and "solidityTrigger"
i can't see contract event and contract log trigger

my config.conf:

`{
event.subscribe = {
native = {
useNativeQueue = true // if true, use native message queue, else use event plugin.
bindport = 5555 // bind port
sendqueuelength = 1000 //max length of send queue
}

path = "/home/dbgames/fullnode/event-plugin/build/plugins/plugin-kafka-1.0.0.zip" // absolute path of plugin
server = "127.0.0.1:50051" // target server address to receive event triggers
#dbconfig="" // dbname|username|password
contractParse = true,
topics = [
    {
      triggerName = "block" // block trigger, the value can't be modified
      enable = true
      topic = "block" // plugin topic, the value could be modified
    },
    {
      triggerName = "transaction"
      enable = true
      topic = "transaction"
    },
    {
      triggerName = "contractevent"
      enable = true
      topic = "contractevent"
    },
    {
      triggerName = "contractlog"
      enable = true
      topic = "contractlog"
    },
    {
      triggerName = "solidity" // solidity block event trigger, the value can't be modified
      enable = true            // the default value is true
      topic = "solidity"
    },
    {
      triggerName = "solidityevent"
      enable = false
      topic = "solidityevent"
    },
    {
      triggerName = "soliditylog"
      enable = false
      topic = "soliditylog"
    }
]

filter = {
   fromblock = "" // the value could be "", "earliest" or a specified block number as the beginning of the queried range
   toblock = "" // the value could be "", "latest" or a specified block number as end of the queried range
   contractAddress = [
       "TVkNuE1BYxECWq85d8UR9zsv6WppBns9iH" // contract address you want to subscribe, if it's set to "", you will receive contract logs/events with any contract address.
   ]

   contractTopic = [
       "" // contract topic you want to subscribe, if it's set to "", you will receive contract logs/events with any contract topic.
   ]
}

}
my socket.js file :
var zmq = require('zeromq')
, sock = zmq.socket('sub');

sock.connect('tcp://127.0.0.1:5555');
sock.subscribe('blockTrigger');
sock.subscribe('transactionTrigger');
sock.subscribe('contractLogTrigger');
sock.subscribe('contractEventTrigger');

sock.on('message', function(topic, message) {
console.log(new Buffer(topic).toString('utf8'), new Buffer(message).toString('utf8'));
});
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant