2

I cannot find any implementation of a consumer for the state_history_plugin.

The official Nodeos webpage suggests the fill-postgresql repo. But, I cannot compile it -- even after building the specific cmake that the author decided to use, and fixing all the git submodule references it still refuses to compile.

Another interesting repo is this JS implementation of a consumer: https://github.com/tmuskal/jsclient-eosio-state-history-plugin

But the problem with it is that it has the ABI from the node hardcoded, and I think it has an outdated version, so nothing happens.

I wrote a simple Python websocket function that returns the only ABI from my node:

import websockets
import asyncio

async def consumer():
    async with websockets.connect('ws://localhost:8080') as websocket:
        msg = await websocket.recv()
        print(msg)

loop = asyncio.get_event_loop()
loop.run_until_complete(consumer())

But to get updates of blocks or actions I need to send a message to the node via the same scheme, i.e.,

websocket.send(<MESSAGE_TO_NODE>)

What is this message? Also, how to deserialize the data from the Node?

  • I am still working on this problem, How do you deserialize the data now? could u please offer some experience? – lucas_tictok Jun 24 at 16:45
0

You can use c++ example of serialization / deserialization from fill postgres plugin https://github.com/EOSIO/fill-postgresql or typescript from eosjs repo - https://github.com/EOSIO/eosjs/blob/develop/src/eosjs-serialize.ts.

MESSAGE_TO_NODE - is serialized request from abi from state history plugin.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.