0

I'm struggling to find the answer to that issue and thought maybe the collective knowledge might be helpful ;-)

I'm trying to get the balance of a certain token for a specific account from the mongo_db_plugin. As there isn't much documentation about that I've looked around a bit and although I think it's probably somewhere in the "accounts" collection, I'm not entirely sure what it is I should be looking for?

Any ideas?

Sub-question => Is it actually possible to get the balance of an account at a specific block?

0

In my mind, mongo_db_plugin is a replacement for history_plugin and history_api_plugin. This means it provides information about what has happened, instead of current status. If you want to get currency balance, you should probably use the RPC API instead of mongo_db_plugin, as the RPC API will be able to access the current state.

  • Thanks for your answer, you're both right, I don't why I went head down into trying to make that work with the mongo_db_plugin as the RPC API or eosjscan do that much more easily and in a straightforward way. – Linda Nov 25 '18 at 15:50
0

I think usage of cleos get currency balance eosio.token <query-account> will directly give you balance of that account no mongodb interection needed if you are looking for eosio.token's balance, and you can use eosjs or RPC API also for getting balance.

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.