It is a good show to see all the TRYBE transfers on the EOS blockchain!

After discovering the DFuse can stream all the activity on the EOS block-chain, I thought why not doing the same for TRYBE.

To stream the EOS blockchain in realtime, the DFuse script used is as follows :

 client
.getActionTraces({ account: “eosio.token”, action_name: “” })
.onMessage((message) => {
if (message.type === InboundMessageType.ACTION_TRACE) {
const { from, to, quantity, memo } = message.data.trace.act.data
const{block_time}=message.data.trace;
console.log(from,to,quantity,memo);
console.log(block_time);

If we change eosio.token to trybenetwork, it should normally stream TRYBE transfers.

Trying this, I managed to stream the TRYBE activity on the blockchain.

Since the transfer data can be streamed, it would be put in a node.js server and the data can be sent to a discord bot to show every transfer of TRYBE.

It is the first time I am dealing with a discord bot but it shouldn’t be rocket science.

There were very good tutorials on how to make a discord bot and I really liked this one!

Now what I had in my hand was, a streaming TRYBE data and a discord bot.

I managed to combine this two and I set the bot “whenever a new data comes, message the discord server”

This is done as follows :

client
.connect()
.then(() => {
client
.getActionTraces({ account: “trybenetwork”, action_name: “” })
.onMessage((message) => {
if (message.type === InboundMessageType.ACTION_TRACE) {
const { from, to, quantity, memo } = message.data.trace.act.data
const{block_time}=message.data.trace;
console.log(from,to,quantity,memo);
console.log(block_time);
var channel = bot.channels.get(‘#channel-number’);
channel.send(“—————————“+”\n”+”From: “+from+”\n”+ “To: “+to+”\n”+ “Quantity: “+quantity+”\n”+”MEMO: “+memo+”\n”+ “Time: “+block_time+”\n”+ “—————————-“);
}
})
})

After some trial and error process, I managed to work the bot just as I want.

Now, what had to be done was to put the bot.js file in the AWS server.

I put the bot to my dungeon-hunt discord server and the invite link is as below :

https://discord.gg/5S4jdFt

The bot gets no orders, only streams the data.

For who is interested, now we have a discord bot that streams the TRYBE transfers in real-time.

Thank you for reading.

FD.


Your Remaining Votes (within 24hrs) : 10 of 10
22 votes, average: 4.82 out of 522 votes, average: 4.82 out of 522 votes, average: 4.82 out of 522 votes, average: 4.82 out of 522 votes, average: 4.82 out of 5 (22 votes, average: 4.82 out of 5)
You need to be a registered member to rate this.
(3758 total tokens earned)
Loading...

Responses

        1. firedream Post author

          wow…now I realized what you mean! It is an activity on TRYBE chain.

          “From: undefined
          To: undefined
          Quantity: undefined
          MEMO: Trybe pre-sale is ending soon! We are giving away 35 million TRYBE tokens to the top 200 pre-sale contributors! Visit our pre-sale portal NOW: https://live.wallet.trybe.one/
          Time: 2019-01-20T01:24:44.000″

          This is not a conventional transfer.It is something TRYBE team issued to promote presales on TRYBE blockchain.
          I have to dig deeper to find how to solve these!

          (0)