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

Export all states as JSON #1026

Merged
merged 3 commits into from Oct 14, 2020
Merged

Conversation

moreal
Copy link
Contributor

@moreal moreal commented Oct 6, 2020

Before this pull request, #1023 MUST proceed.

This pull request introduced a new feature to export all states corresponded to the state root hash as JSON.

Usage

> dotnet run -- mpt export "C:\Users\moreal\AppData\Local\planetarium\9c-beta-8-rc1\states" "09dc793242a7f0932656654e01d92e5e84b58b3f52738cf0d67960e9d32951de" -t rocksdb > states.json

> cat states.json
{"39666566633833366331343965336664383436333932366232623434626431616633363734663034":"ZHU3OmFkZHJlc3MyMDqf78g2wUnj/YRjkmsrRL0a82dPBHU1Om5vbmNlM ....
....

Export format

It will be exported as not pretty JSON like the below type:

{
  "<state_key>": "<bencodexed_hexdecimal_string>"
}

@moreal moreal added storage Related to storage (Libplanet.Store) tools Related to CLI tools (Libplanet.Tools) labels Oct 6, 2020
@codecov
Copy link

codecov bot commented Oct 8, 2020

Codecov Report

Merging #1026 into main will increase coverage by 0.02%.
The diff coverage is 97.56%.

@@            Coverage Diff             @@
##             main    #1026      +/-   ##
==========================================
+ Coverage   88.43%   88.45%   +0.02%     
==========================================
  Files         334      335       +1     
  Lines       30341    30401      +60     
==========================================
+ Hits        26831    26891      +60     
+ Misses       1902     1899       -3     
- Partials     1608     1611       +3     
Impacted Files Coverage Δ
Libplanet.Tests/ImmutableArrayEqualityComparer.cs 90.90% <90.90%> (ø)
Libplanet.Tests/Store/TrieStateStoreTest.cs 98.50% <96.15%> (+0.20%) ⬆️
...lanet.Tests/Store/Trie/MerkleTrieExtensionsTest.cs 100.00% <100.00%> (ø)
Libplanet/Store/Trie/MerkleTrieExtensions.cs 84.21% <100.00%> (+2.96%) ⬆️
Libplanet/Store/TrieStateStore.cs 90.47% <100.00%> (+0.37%) ⬆️
Libplanet/Net/Protocols/KBucket.cs 92.37% <0.00%> (-2.55%) ⬇️
Libplanet.RocksDBStore/RocksDBStore.cs 95.56% <0.00%> (-0.32%) ⬇️
Libplanet/Net/Swarm.cs 84.97% <0.00%> (-0.23%) ⬇️
Libplanet/Store/DefaultStore.cs 86.64% <0.00%> (+0.95%) ⬆️
... and 1 more

@moreal moreal force-pushed the feature/export-trie-states branch 2 times, most recently from 759b3bb to e4ce480 Compare October 12, 2020 02:16
@moreal moreal self-assigned this Oct 12, 2020
@moreal
Copy link
Contributor Author

moreal commented Oct 12, 2020

/rebase

@moreal moreal marked this pull request as ready for review October 13, 2020 04:47
limebell
limebell previously approved these changes Oct 14, 2020
longfin
longfin previously approved these changes Oct 14, 2020
earlbread
earlbread previously approved these changes Oct 14, 2020
@moreal moreal dismissed stale reviews from earlbread, longfin, and limebell via b9774be October 14, 2020 09:11
@moreal
Copy link
Contributor Author

moreal commented Oct 14, 2020

There was a problem about compile in mono because of the difference between netcoreapp2.2 and netstandard2.0. I fixed it. Please review again 🙏 cc @longfin @earlbread @limebell

@moreal moreal merged commit 2f6e94d into planetarium:main Oct 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
storage Related to storage (Libplanet.Store) tools Related to CLI tools (Libplanet.Tools)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants