Does anyone have any idea dea how to use Demux with EOS Blockchain. There is this repo where they give example how to use Demux.
I want to ask if there is any example for how to "use Demux without Docker"
Does anyone have any idea dea how to use Demux with EOS Blockchain. There is this repo where they give example how to use Demux.
I want to ask if there is any example for how to "use Demux without Docker"
I've integrated it in my simple Chess Dapp if you'd like a code example:
https://github.com/NatPDeveloper/eos-chess/tree/master/js/lib/demux-js
Specifying contract:action to listen for:
const updaters = [
{
actionType: "chesschessch::setstat", // updated with current contract account name
updater: updateMatchStatus,
},
]
App.js setup to configure block indexing speed and API endpoint to ping:
// JUNGLE TESTNET
const actionReader = new NodeosActionReader(
"https://poll.troonblockchain.io:9999", // Locally hosted node needed for reasonable indexing speed
22238967, // First actions relevant to this dapp happens at this block
)
const actionHandler = new MyActionHandler(
updaters,
effects,
)
const actionWatcher = new BaseActionWatcher(
actionReader,
actionHandler,
250, // Poll at twice the block interval for less latency
)
actionWatcher.watch() // Start watch loop
Yes. You can use Demux without docker. The best way is to take the example repository's "backend" folder and copy locally. Then you can modify the code to interface with a smart contract you write yourself and you can run it with nodemon. There are also examples in the main demux wiki that might be easier to follow than the larger / arguably needlessly complex demux example repo.