2

At this time, is it possible for me to do so when the BPs have not been elected? I need this for a block explorer I'm building using eosjs.

3

Yes, it is possible with eosjs.

You can create an instance of Eos with a given config and then do getTableRows with the given parameters. You might find the api footprint here. Also check the github repository for more info about the config parameters.

Here is an example how I do it at EOSIO BP alarm:

eos = new Eos(config)
eos.populateBlockProducers().then((result) => {
            console.log(result)
        }, this.handleError)

eos.getTableRows({
            "json": true,
            "scope": 'eosio',
            "code": 'eosio',
            "table": "producers",
            "limit": 500
        })

function populateBlockProducers() {
        return eos.getTableRows({
            "json": true,
            "scope": 'eosio',
            "code": 'eosio',
            "table": "producers",
            "limit": 500
        })
    }

function handleError(error) {}
| improve this answer | |

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.