hello,
I need list of block validators in my smart contract,
do u have any suggestion for saving address of miners in smart contract?(solidity)

May 29, 2022, 1:11 PM
What's the purpose of this?
May 29, 2022, 1:12 PM
get informations and show them from blocks to UI , with solidity coding
May 29, 2022, 1:15 PM
O_o!
that's.... strange haha
use a simple function like
function getBlockData() public view returns (uint,uint) {
return (block.timestamp,block.number)
}
https://bscscan.com/validators
there you can find anyway the 21 validators active
May 29, 2022, 1:35 PM
last validator is not enought
May 29, 2022, 1:35 PM
what are you missing from them? and what you want to read?
May 29, 2022, 1:35 PM
i want to save every block validators after now
address of miners
May 29, 2022, 1:38 PM
then it's an off-chain task, not on-chain.
From a contract you can only read actual blockchain data, not past, not future.
Your transaction have no idea who are the validators and who will be the next one.
Maybe you want to write a script that tracks the validators, but again, it's an off-chain task or you need to use a sort-of oracle that update on-chain data specifically for that
May 29, 2022, 1:39 PM
exactly πŸ‘Œ
u undrestood me , now what are u thinking that i should do?
May 29, 2022, 1:42 PM
mhm, i'll take the "raw" road, scrape the page from bscscan and check it for changes.
Don't really know your end target, but sometimes "scraping" even if it's dirty, get the job done
May 29, 2022, 1:44 PM
I don t undrsatand what u mean
May 29, 2022, 1:46 PM
kinda off topic
https://realpython.com/beautiful-soup-web-scraper-python/
But it's a way to gather data
May 29, 2022, 1:48 PM
thank you so much
@krakoviachannel I understood your road (scraping the page)
but if I want to use oracles , do you have any suggestion?
May 29, 2022, 2:03 PM
it's way more complicated and i have no suggestion for thatπŸ˜†
May 29, 2022, 2:04 PM
πŸ˜‚ yes
May 29, 2022, 2:05 PM
it's slower and annoying but once you get it up you have free hands
May 29, 2022, 2:09 PM
Why not etherscan API?
Wait I'm not sure they provide that lol
May 29, 2022, 2:27 PM
πŸ‘πŸ˜‚ I working on BSCSCAN API now but I confused
May 29, 2022, 2:28 PM
https://docs.etherscan.io/api-endpoints/blocks
Yep its there
Listen on new block mined, call API and store on buffer, write to contract on some interval...?
I don't think it gets more easier than this
May 29, 2022, 2:30 PM
i should try it
but i dont know how
have you docs or tutorals
May 29, 2022, 2:34 PM
This right here literally says "docs"
May 29, 2022, 2:35 PM
I have to make oracle by these api s , haven't I ?
May 29, 2022, 2:36 PM
Search the web
May 29, 2022, 2:38 PM
I'll do that
May 29, 2022, 2:39 PM

Β© 2024 Draquery.com All rights reserved.