You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am a bit confused between peers and miners. I know that peers are the ones which have the entire blockchain with them and whenever a new block comes, it is broadcast to all peers, and the peers check the validity and finally add it to the blockchain.
Now I am confused as to who introduces the new block? I see the code which adds a new block which then gets broadcast to all peers but what I do not understand is, who calls the mineCommand()?
functionmineCommand(vorpal){vorpal.command('mine <data>','Mine a new block. Eg: mine hello!').alias('m').action(function(args,callback){if(args.data){blockchain.mine(args.data);p2p.broadcastLatest();}callback();})}
From the UI, I get an impression that a peer is the one adding a new block but from the code it doesn't seem so.
The text was updated successfully, but these errors were encountered:
I am a bit confused between peers and miners. I know that peers are the ones which have the entire blockchain with them and whenever a new block comes, it is broadcast to all peers, and the peers check the validity and finally add it to the blockchain.
Now I am confused as to who introduces the new block? I see the code which adds a new block which then gets broadcast to all peers but what I do not understand is, who calls the
mineCommand()
?From the UI, I get an impression that a peer is the one adding a new block but from the code it doesn't seem so.
The text was updated successfully, but these errors were encountered: