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

feat: cli: lotus info cmd #9233

Merged
merged 7 commits into from Sep 5, 2022
Merged

feat: cli: lotus info cmd #9233

merged 7 commits into from Sep 5, 2022

Conversation

rjan90
Copy link
Contributor

@rjan90 rjan90 commented Aug 30, 2022

Related Issues

Implements most of the metrics listed in #5766.

Proposed Changes

Add a lotus info command that prints info about the lotus node:

Network: butterflynet
Chain: [sync ok] [basefee 100 aFIL] [epoch 194446]
Peers to: [publish messages 13] [publish blocks 13]
Chain health: 68% [unhealthy]

Default address: 
      t1p34z3ex72fa3v7h7thkwl6n3ggqzgne3sz5ls3y [22.869 FIL]

Wallet: 12 addresses
      Total balance: 748.537 FIL
      Market locked: 166.638 μFIL
      Market available: 1.5 FIL

Payment Channels: 2 channels

Deals: 6, 762 MiB
      StorageDealActive: 5 deals, 635 MiB
      StorageDealSealing: 1 deals, 127 MiB

Bandwidth:
      TotalIn  TotalOut  RateIn  RateOut
      4.9 MB   4.2 MB    0 B/s   0 B/s

Additional Info

Checklist

Before you mark the PR ready for review, please make sure that:

  • All commits have a clear commit message.
  • The PR title is in the form of of <PR type>: <area>: <change being made>
    • example: fix: mempool: Introduce a cache for valid signatures
    • PR type: fix, feat, INTERFACE BREAKING CHANGE, CONSENSUS BREAKING, build, chore, ci, docs,perf, refactor, revert, style, test
    • area: api, chain, state, vm, data transfer, market, mempool, message, block production, multisig, networking, paychan, proving, sealing, wallet, deps
  • This PR has tests for new functionality or change in behaviour
  • If new user-facing features are introduced, clear usage guidelines and / or documentation updates should be included in https://lotus.filecoin.io or Discussion Tutorials.
  • CI is green

Adds lotus info command that prints a lot of node information.
make docsgen-cli
@rjan90 rjan90 requested a review from a team as a code owner August 30, 2022 12:26
Copy link
Contributor

@magik6k magik6k left a comment

Choose a reason for hiding this comment

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

This is really cool!

cli/info.go Show resolved Hide resolved
cli/info.go Outdated Show resolved Hide resolved
//Chain health calculated as percentage: amount of blocks in last finality / very healthy amount of blocks in a finality (900 epochs * 5 blocks per tipset)
health := (100 * (900 * status.ChainStatus.BlocksPerTipsetLastFinality) / (900 * 5))
switch {
case health > 85:
Copy link
Contributor

Choose a reason for hiding this comment

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

For setting the threshold - what % do we see on mainnet?

Copy link
Contributor Author

@rjan90 rjan90 Aug 31, 2022

Choose a reason for hiding this comment

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

Its been hovering around 4.8 - 4.9 blocks on average in the last finality on mainnet while I have been monitoring it, so around 96% - 98%

Could maybe try to get some historical avarages as well for setting the threshold of what is unhealthy more realistic.

Only print address and get balance if err == nil, else print that the Default address is not set
Move newline
Put SyncBasefeeCheck in function
Copy link
Contributor

@magik6k magik6k left a comment

Choose a reason for hiding this comment

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

make gen is sad

cli/info.go Outdated Show resolved Hide resolved
cli/info.go Outdated Show resolved Hide resolved
rjan90 and others added 2 commits September 2, 2022 15:12
Co-authored-by: Łukasz Magiera <magik6k@users.noreply.github.com>
make gen happy not sad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants