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

[cli] add list-reputables #332

Merged
merged 11 commits into from
Jun 17, 2023
Merged

[cli] add list-reputables #332

merged 11 commits into from
Jun 17, 2023

Conversation

haerdib
Copy link
Contributor

@haerdib haerdib commented Jun 14, 2023

closes #315

I tested it on the Kusama node with the following cmd:
../target/release/encointer-client-notee -u wss://kusama.api.encointer.org -p 443 list-reputables -v

The number of the total reputables matches the one of reputableCount.

@brenzi is this what you had somewhat in mind?

Output:

Listing the number of reputables for each community and ceremony for the last 5 cycles
Community ID: u0qj944rhWE
Ceremony ID 39: Total reputables: 26
Ceremony ID 40: Total reputables: 34
Ceremony ID 41: Total reputables: 29
Ceremony ID 42: Total reputables: 29
Ceremony ID 43: Total reputables: 27
Community ID: dpcmj33LUs9
Ceremony ID 39: Total reputables: 2
Ceremony ID 40: Total reputables: 1
Ceremony ID 41: Total reputables: 2
Ceremony ID 42: Total reputables: 2
Ceremony ID 43: Total reputables: 1
u0qj944rhWE,39,5Dz7iJ9F6WFsWjUzbMqSKS2edJrjyp8np7VYy7fVf8SBAfr8
u0qj944rhWE,39,5FeLdean9oRsuxArhmFN2Vj3oQLubRWRQAhTtW3JtTZt1Mp7
u0qj944rhWE,39,5DZrgWMLZXfLpEDm31ziBaABtnfzRUqH67bn86vGaf5X2k58
u0qj944rhWE,39,5DUBgzYP6VuM1zjK2i93AiHQ8vWCPiYUREJj1pzoaTvH4Hnp
u0qj944rhWE,39,5EZQGJmQTiziwmsA7yPYSt391GC68yb8zy3EMsqnsupavX73
[...]
u0qj944rhWE,43,5FCNDbzNgXqW5cYWxvBwS6mwFXPKtKDN5fyQV7s2bsUaPdHS
u0qj944rhWE,43,5DDDjK2HoUxYXuTGCyefhQ5sVf4cWorpx2Pa71xuR14Cv6tw
u0qj944rhWE,43,5HjQdjjztuW7q3Fp275Xo3x7hhLs66EuusP3ep6B4CKpujLy
dpcmj33LUs9,39,5FnSLeCqTtosUzsuG8cWKwKwn8QHhvAL2RsPnSnDj6XXSt1W
dpcmj33LUs9,39,5FbSE4RZC2yF2iJSr7JMUvpZTKAVgfkwUacCKGDYpPbrx2gW
dpcmj33LUs9,40,5FbSE4RZC2yF2iJSr7JMUvpZTKAVgfkwUacCKGDYpPbrx2gW
dpcmj33LUs9,41,5HYadoL9oy7oHN5MBEVg74Sy5et8HyjW426qDhDthLvnxnkN
dpcmj33LUs9,41,5FnSLeCqTtosUzsuG8cWKwKwn8QHhvAL2RsPnSnDj6XXSt1W
dpcmj33LUs9,42,5FnSLeCqTtosUzsuG8cWKwKwn8QHhvAL2RsPnSnDj6XXSt1W
dpcmj33LUs9,42,5FbSE4RZC2yF2iJSr7JMUvpZTKAVgfkwUacCKGDYpPbrx2gW
dpcmj33LUs9,43,5FbSE4RZC2yF2iJSr7JMUvpZTKAVgfkwUacCKGDYpPbrx2gW

Output without verbose, but with --at:

../target/release/encointer-client-notee -u wss://kusama.api.encointer.org -p 443 list-reputables --at 0x3e30d484e418eaea816d1c4864787240b87e101021fbabbdbcc2c52ef3102b64
Listing the number of reputables for each community and ceremony for the last 5 cycles
Community ID: u0qj944rhWE
Ceremony ID 30: Total reputables: 35
Ceremony ID 31: Total reputables: 31
Ceremony ID 32: Total reputables: 39
Ceremony ID 33: Total reputables: 48
Ceremony ID 34: Total reputables: 52
Community ID: dpcmj33LUs9
Ceremony ID 30: Total reputables: 0
Ceremony ID 31: Total reputables: 0
Ceremony ID 32: Total reputables: 0
Ceremony ID 33: Total reputables: 0
Ceremony ID 34: Total reputables: 1

closes #315

@brenzi
Copy link
Member

brenzi commented Jun 15, 2023

I'll need to check the numbers and the wording, but it looks great.

@brenzi
Copy link
Member

brenzi commented Jun 15, 2023

strange, I get the following error:

./target/release/encointer-client-notee -u wss://kusama.api.encointer.org -p 443 list-reputables -v
[2023-06-15T11:30:40Z INFO  substrate_api_client::api::api_client] Got genesis hash: 0x7dd99936c1e9e6d1ce7d90eb6f33bea8393b4bf87677d675aa63c9cb3e8c5b5b
[2023-06-15T11:30:41Z INFO  substrate_api_client::api::api_client] Runtime Version: RuntimeVersion { spec_name: "encointer-parachain", impl_name: "encointer-parachain", authoring_version: 1, spec_version: 12, impl_version: 1, apis: [([221, 113, 141, 92, 197, 50, 98, 212], 1), ([223, 106, 203, 104, 153, 7, 96, 155], 4), ([55, 227, 151, 252, 124, 145, 245, 228], 1), ([64, 254, 58, 212, 1, 248, 149, 154], 6), ([210, 188, 152, 151, 238, 208, 143, 21], 3), ([247, 139, 39, 139, 229, 63, 69, 76], 2), ([171, 60, 5, 114, 41, 31, 235, 139], 1), ([188, 157, 137, 144, 79, 91, 146, 63], 1), ([55, 200, 187, 19, 80, 169, 162, 168], 1), ([234, 147, 227, 241, 111, 61, 105, 98], 2), ([140, 223, 158, 62, 11, 109, 136, 203], 1), ([117, 119, 173, 86, 114, 151, 183, 217], 1), ([186, 224, 47, 235, 30, 122, 46, 9], 1)], transaction_version: 2, state_version: 0 }
[2023-06-15T11:30:41Z INFO  substrate_api_client::api::rpc_api::state] storage key is: 0xa7d291a8132b2cc65c41da45f4de76795b9f3fcf38b37a818f89b07b85604d63
[2023-06-15T11:30:41Z INFO  substrate_api_client::api::rpc_api::state] storage key is: 0x26dc3fa0a77526a8494180a4789f68834d03567cbac6404a5303f63909f6a2d8
Listing the number of reputables for each community and ceremony for the last 5 cycles
Community ID: u0qj944rhWE
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: RpcClient(Client(Call(Custom(ErrorObject { code: ServerError(4002), message: "count exceeds maximum value. value: 4294967295, max: 1000", data: None }))))', client/src/main.rs:1861:80
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

@brenzi
Copy link
Member

brenzi commented Jun 15, 2023

with the above fix I was able to test against a local dev node, just running bootstrap_demo_community.py twice. same result:

Listing the number of reputables for each community and ceremony for the last 3 cycles
Community ID: sqm1v79dF6b
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: RpcClient(Client(Call(Custom(ErrorObject { code: ServerError(4002), message: "count exceeds maximum value. value: 4294967295, max: 1000", data: None }))))', client/src/main.rs:1861:80
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

client/src/main.rs Outdated Show resolved Hide resolved
@brenzi
Copy link
Member

brenzi commented Jun 15, 2023

ok, since the 0.9.42 merge we can't test against kusama anymore until we have an rpc node running with the newest version (breaking changes in client).

Listing the number of reputables for each community and ceremony for the last 5 cycles
Community ID: u0qj944rhWE
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Codec(Error { cause: None, desc: "unexpected first byte decoding Option" })', client/src/main.rs:1867:67
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

I'll try to spawn a local one for testing

@haerdib
Copy link
Contributor Author

haerdib commented Jun 15, 2023

Pushed the fixes. It is working for me now.

@brenzi
Copy link
Member

brenzi commented Jun 16, 2023

ok, I believe it now does what it should. however, the numbers don't match to the explorer ones....need to find out why

could be a difference in which cycle range is queried (depending on current ceremony phase?)

@brenzi
Copy link
Member

brenzi commented Jun 16, 2023

most likely, our explorer silently counts noshows as reputables. encointer/explorer#132

Copy link
Member

@brenzi brenzi left a comment

Choose a reason for hiding this comment

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

LGTM.
thanks a lot @haerdib very nice work!

@brenzi brenzi marked this pull request as ready for review June 16, 2023 13:44
@brenzi brenzi merged commit cbb5f02 into master Jun 17, 2023
brenzi added a commit that referenced this pull request Aug 23, 2023
…-reputations-commitment (#343)

* Faucet (#333)

* integrate faucet locally

* benchmarking for faucet and reputation commitments

* implement faucet cli

* implement faucet integration tests

* fix cli and weights

* weights

* clippy

* unpatch pallets

* taplo fmt

* update cargo.lock

* bump v1.4.0

* [cli] add list-reputables (#332)

* add list-reputables

* naming and underflow fix

* fix option query and max numbers

* refactor names and change to correct storage. not yet ok

* extracting AccountId key from doublemap storagekey tail

* count noshows as well

* fmt

* fix the merge

---------

Co-authored-by: Alain Brenzikofer <[email protected]>
Co-authored-by: brenzi <[email protected]>
Co-authored-by: Alain Brenzikofer <[email protected]>

* bump 1.4.1

* whitelist bypass integration (#335)

* whitelist bypass integration

* bump versions

---------

Co-authored-by: Alain Brenzikofer <[email protected]>

* faucet cli improvements (#337)

* faucet cli imporvements

* add help for whitelist

* fix hardcoded event index

---------

Co-authored-by: Alain Brenzikofer <[email protected]>

* fix try runtime (#342)

* fix missing feature flags

* fix node build

* add try-runtime and benchmarks to CI

* fmt

* [node] fix feature flag

---------

Co-authored-by: Christian Langenbacher <[email protected]>

* community metadata extension migration (#341)

* integrate communitymetadata extension. builds

* rename ceremonies migration accordingly

* add try-runtime and benchmarks to CI

* point to explicit release branch of pallets

* bump versions

* fmt

* lift patches

* minor version bump

* GHA: fix deprecation warnings (save-state, set-output, Nodejs12) (#338)

* gha: bump rust-cache action

* gha: bump setup-python action

* gha: remove deprecated set-output commands

* gha: bump cancel-action action

* gha: bump cache action

* gha: bump docker/login-action

* gha: bump docker/setup-buildx-action

* gha: bump actions/checkout

* gha: bump docker/build-push-action

* gha: bump dev-drprasad/delete-tag-and-release

* gha: specify actions/checkout action version

* gha: specify actions/download-artifact action version

* extend changes to new job

---------

Co-authored-by: brenzi <[email protected]>
Co-authored-by: Alain Brenzikofer <[email protected]>

* Faucet (#333)

* integrate faucet locally

* benchmarking for faucet and reputation commitments

* implement faucet cli

* implement faucet integration tests

* fix cli and weights

* weights

* clippy

* unpatch pallets

* taplo fmt

* update cargo.lock

* teerex followup

* client: remove mistakenly added pallet-encointer-communities

* client: add logs to bootstrap_demo_community.py

---------

Co-authored-by: pifragile <[email protected]>
Co-authored-by: Alain Brenzikofer <[email protected]>
Co-authored-by: Bigna Härdi <[email protected]>
Co-authored-by: brenzi <[email protected]>
Co-authored-by: Alain Brenzikofer <[email protected]>
Co-authored-by: Christian Langenbacher <[email protected]>
Co-authored-by: echevrier <[email protected]>
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.

[cli] command list-reputables
2 participants