You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Motivation
For debugging purposes, it is useful to access the shard index of the
validators for a fixed chain.
## Proposal
The implementation is straightforward:
* Add it as an endpoint to the proxy.
* Add it as a feature to the "linera" client.
## Test Plan
No test has been added to the CI.
However, the function has been tested locally with the following steps.
A: Starting the validators
```bash
./target/debug/linera storage delete-all --storage service:tcp:localhost:1235:table_a
rm -rf /tmp/WORK && mkdir -p /tmp/WORK
export RUST_BACKTRACE=full
./target/debug/linera net up --policy-config testnet --storage service:tcp:localhost:1235:table_a --validators 4 --shards 4 --path /tmp/WORK
```
B: Running the faucet
```bash
export LINERA_WALLET="/tmp/WORK/wallet_0.json"
export LINERA_KEYSTORE="/tmp/WORK/keystore_0.json"
export LINERA_STORAGE="rocksdb:/tmp/WORK/client_0.db"
./target/debug/linera faucet --amount 1000 --port 8079 --storage-path /tmp/WORK/faucet_storage.sqlite
```
C: Creating a chain, showing
```bash
rm -rf /tmp/WORK_B && mkdir -p /tmp/WORK_B
export LINERA_WALLET="/tmp/WORK_B/wallet_0.json"
export LINERA_KEYSTORE="/tmp/WORK_B/keystore_0.json"
export LINERA_STORAGE="rocksdb:/tmp/WORK_B/client_0.db"
export FAUCET_URL=http://localhost:8079
./target/debug/linera wallet init --faucet $FAUCET_URL
./target/debug/linera wallet request-chain --faucet $FAUCET_URL
./target/debug/linera wallet show
```
D: Showing up the result from the obtained `ChainId`
```bash
./target/debug/linera query-shard-info 42a1c60a969b9c6ce893fd3746ec6084e0c336820f1336fa40e39e4aa5708c5b
Querying validators for shard information about chain 42a1c60a969b9c6ce893fd3746ec6084e0c336820f1336fa40e39e4aa5708c5b.
Chain ID: 42a1c60a969b9c6ce893fd3746ec6084e0c336820f1336fa40e39e4aa5708c5b
Validator Shard Information:
Validator: 033f3e155e7c0c7fae94692df5501eeab55e98a8c086e568cb672d7a8270e7c08f
Address: grpc:localhost:13004
Total Shards: 4
Shard ID for chain: 0
Validator: 02b7742453a60ad3e2d615f59aa6b00d72d0b126ea9181264f3bd459eb1e42b557
Address: grpc:localhost:13003
Total Shards: 4
Shard ID for chain: 3
Validator: 03b99ffb3804db5fa05534a5eb0bc890add528acb66b39931bca878ee2b68f72a7
Address: grpc:localhost:13001
Total Shards: 4
Shard ID for chain: 2
Validator: 02e33d49cc2279adfdfea6cafa523d739f95969ebddd13a96720f0dffafb2dceb2
Address: grpc:localhost:13002
Total Shards: 4
Shard ID for chain: 1
```
## Release Plan
If this is feasible, then we should backport it to the TestNet Conway
branch.
## Links
None.
@@ -94,6 +95,7 @@ Client implementation and command-line tool for the Linera blockchain
94
95
*`process-inbox` — Process all pending incoming messages from the inbox of the given chain by creating as many blocks as needed to execute all (non-failing) messages. Failing messages will be marked as rejected and may bounce to their sender depending on their configuration
95
96
*`query-validator` — Show the version and genesis config hash of a new validator, and print a warning if it is incompatible. Also print some information about the given chain while we are at it
96
97
*`query-validators` — Show the current set of validators for a chain. Also print some information about the given chain while we are at it
98
+
*`query-shard-info` — Query validators for shard information about a specific chain
97
99
*`sync-validator` — Synchronizes a validator with the local state of chains
98
100
*`sync-all-validators` — Synchronizes all validators with the local state of chains
99
101
*`set-validator` — Add or modify a validator (admin only)
@@ -494,6 +496,18 @@ Show the current set of validators for a chain. Also print some information abou
494
496
495
497
496
498
499
+
## `linera query-shard-info`
500
+
501
+
Query validators for shard information about a specific chain
502
+
503
+
**Usage:**`linera query-shard-info <CHAIN_ID>`
504
+
505
+
###### **Arguments:**
506
+
507
+
*`<CHAIN_ID>` — The chain to query shard information for
508
+
509
+
510
+
497
511
## `linera sync-validator`
498
512
499
513
Synchronizes a validator with the local state of chains
0 commit comments