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

New stats command added to planet cli #1353

Merged
merged 3 commits into from
Jul 6, 2021

Conversation

greymistcube
Copy link
Contributor

@greymistcube greymistcube commented Jun 24, 2021

A rudimentary implementation of extracting stored blockchain information. See the provided help text for usage.

Usage: Libplanet.Tools stats [--path <String>] [--header] [--offset <Int64>] [--limit <Nullable`1>] [--help]

Outputs a summary of a stored chain in a CSV format.

Options:
  -p, --path <String>         The URI denoting the type and the path of a concrete class for IStore; given as <store-type>://<store-path> (Required)
  -r, --header                Whether to include header row
  -o, --offset <Int64>        Starting index offset; supports negative indexing (Default: 0)
  -l, --limit <Nullable`1>    Maximum number of results to return; no limit by default
  -h, --help                  Show help message

Outputs to a terminal, so pipe accordingly. Output is in a CSV format with the following fields:

  • index
  • hash
  • difficulty
  • miner
  • tx count
  • timestamp (in UNIX milliseconds)
  • perceived timestamp, if any (in UNIX milliseconds)

The -o option supports negative indexing with the value of -1 corresponding to the tip of the chain it is querying.

@codecov
Copy link

codecov bot commented Jun 24, 2021

Codecov Report

Merging #1353 (9fa2f2c) into main (0033ed7) will decrease coverage by 9.23%.
The diff coverage is 52.78%.

❗ Current head 9fa2f2c differs from pull request most recent head b98fe2f. Consider uploading reports for the commit b98fe2f to get more accurate results

@@            Coverage Diff             @@
##             main    #1353      +/-   ##
==========================================
- Coverage   86.03%   76.79%   -9.24%     
==========================================
  Files         361      254     -107     
  Lines       32457    17055   -15402     
==========================================
- Hits        27925    13098   -14827     
- Misses       2747     3406     +659     
+ Partials     1785      551    -1234     
Impacted Files Coverage Δ
...bplanet.Explorer/Controllers/ExplorerController.cs 0.00% <0.00%> (ø)
...rer/Controllers/GenericControllerNameConvention.cs 0.00% <0.00%> (ø)
Libplanet.Explorer/Controllers/GraphQLBody.cs 0.00% <0.00%> (ø)
Libplanet.Explorer/ExplorerStartup.cs 0.00% <0.00%> (ø)
Libplanet.Explorer/GraphTypes/NodeStateType.cs 0.00% <0.00%> (ø)
...ibplanet.Explorer/Interfaces/IBlockChainContext.cs 0.00% <0.00%> (ø)
Libplanet.Explorer/Queries/BlockQuery.cs 0.00% <0.00%> (ø)
Libplanet.Explorer/Queries/ExplorerQuery.cs 0.00% <0.00%> (ø)
Libplanet.Explorer/Queries/TransactionQuery.cs 0.00% <0.00%> (ø)
Libplanet.Explorer/Store/AddressRefDoc.cs 0.00% <0.00%> (ø)
... and 247 more

@greymistcube greymistcube self-assigned this Jun 24, 2021
@greymistcube greymistcube marked this pull request as ready for review June 24, 2021 17:26
@longfin
Copy link
Member

longfin commented Jun 28, 2021

/rebase

@libplanet libplanet force-pushed the feature/block-stats-cli branch from 34d5e70 to a4663ad Compare June 28, 2021 12:50
@greymistcube greymistcube force-pushed the feature/block-stats-cli branch 2 times, most recently from 1c524ca to b6f5ca0 Compare July 6, 2021 02:01
@longfin
Copy link
Member

longfin commented Jul 6, 2021

/rebase

@libplanet libplanet force-pushed the feature/block-stats-cli branch from b6f5ca0 to b98fe2f Compare July 6, 2021 02:33
@longfin longfin added the tools Related to CLI tools (Libplanet.Tools) label Jul 6, 2021
@longfin longfin merged commit 6308ac9 into planetarium:main Jul 6, 2021
@greymistcube greymistcube deleted the feature/block-stats-cli branch July 22, 2021 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tools Related to CLI tools (Libplanet.Tools)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants