Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added network:head command to dump some useful info #2463

Closed
wants to merge 2 commits into from

Conversation

yourcodesucks
Copy link

Description

Added network:head command to dump some useful info

Sample output:

timestamp: Fri, 17 Jan 2020 05:37:09 GMT
block number: 107665
epoch index: 149
epoch position: 385
block signer: 0xea0c8e8b18bdE45819483a4D8E64A5e94c4303Cc

Tested

Ran against baklava network by building against the baklava branch on the following environment:

  • osx 10.15.2
  • yarn 1.21.0,
  • npm 6.11.3
  • nodejs v10.17.0

Copy link
Contributor

@yorhodes yorhodes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would be great to clean this up and get it merged

let interesting: { [key: string]: string | number | boolean } = {}
interesting['timestamp'] = new Date(new Date(0).setUTCSeconds(block.timestamp)).toUTCString()
interesting['block number'] = block.number
interesting['epoch index'] = Math.floor(block.number / 720) // TODO: epoch block duration should come from network:parameters
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can get this from this.kit
see how network/parameters.ts works


async run() {
const block = await this.web3.eth.getBlock('latest')
console.log(block.miner)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

@barbaraliau
Copy link
Contributor

Is this still a relevant PR or should this be closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants