Closed gaboesquivel closed 5 years ago
Ref https://developers.eos.io/eosio-nodeos/reference . see get_producers
Ref bp.json standard https://github.com/eosrio/bp-info-standard
@murillojorge @rubenabix the idea is to aggregate all data to display logo, location and all info we can gather from a BP on their profile page
@rubenabix usage example of EOS Camel API pkg https://github.com/gaboesquivel/eos-actions/blob/master/index.js
The RPC endpoint is not returning the data we need.
We need to:
cleos.sh
(https://github.com/CryptoLions/EOS-MainNet/blob/master/cleos.sh) pointing to the EOSCR node. cleos.sh system listproducers -j
on the cronjobsomething like this
const exec = require('await-exec')
try{
const producersList = await exec(`cleos.sh system listproducers -j`)
}catch(err){
logger.error(err)
}
then get all bp.jsons
const got = require('got')
const getBpJson = (url) => got(url)
const producersData = procudersList.map(bp => getBpJson(bp.bpJsonUrl))
and finally save the data to MongoDB using the Block Producer mongoose Model
Another option re-enabling a unix cron we use to have to generate that list on one of EOS Costa Rica nodes monitor.eosio.cr/mainnet-producers.json .. It's not currently working. Thoughts @xavier506 ?
Actually I think we don't want to be running a node on Zeit just to able to execute cleos to get the system producerslist
I'd look this
const got = require('got')
const producersList = await got('https://monitor.eosio.cr/mainnet-producers.json')
const getBpJson = (url) => got(url)
const producersData = procudersList.map(bp => getBpJson(bp.bpJsonUrl))
// and finally save the data to MongoDB using the Block Producer mongoose Model
I just talked to @xavier506, we are going re-enable the mainent producers json cron job / service and we'll query that.
No need to run an EOS node on this project. @rubenabix
Para el mainnet-producers.json
estoy corriendo el siguiente cron job en el server
docker exec eosio /opt/eosio/bin/cleos -u https://api.eosio.cr --wallet-url http://127.0.0.1:8888 system listproducers -l 1000 -j > /var/www/monitor.eosio.cr/public_html/mainnet-producers.json
Esto tira la lista de los primeros 1000 producers
Cool, please let us know when we can start using it.
Here is an initial list of BPs in JSON format
https://github.com/eoscostarica/rate.eoscostarica.io/blob/master/mainnet-producers.json
hey @rubenabix we should be using the On-Chain Data instead.
https://validate.eosnation.io/data/
here you get all BPJSON data from Blockchain. https://validate.eosnation.io/bps.json .
I think we can just configure demux to listen to system_contract:regblockproducer
and producerjson_contract:set
https://github.com/EOSIO/eos/blob/master/contracts/eosio.system/eosio.system.cpp
https://github.com/greymass/producerjson/blob/master/producerjson.cpp
We need to serve a list of block producers to app containing relevant info from their profile.
Use info from eosio.system with: Information from the producerjson contract.