EOSIO / demux-js-eos

Demux-js Action Reader implementations for EOSIO blockchains
MIT License
39 stars 17 forks source link

How to use MongoActionReader if the DB need auth? #43

Closed clockknock closed 5 years ago

clockknock commented 5 years ago

I meet this problem, my MongoDB need auth to login, and I create MongoActionReader by these:

 const actionReader = new MongoActionReader(
        "mongodb://USERNAME:PASSWORD@myDbIp:port/EOS",
        0,
        true,
        600,
        "EOS"
    );

and then i get this error:

 UnhandledPromiseRejectionWarning: Error: MongoActionReader must be initialized before fetching blocks.

I think the problem is the MongoActionReader can't be initial by my mongoEndpoint, can i get some help?

clockknock commented 5 years ago
    actionReader.initialize().then(() =>
        actionWatcher.watch()
    )

forgot to add these to initialize