ava-labs / avalanche-cli

Other
103 stars 63 forks source link

Node local status more info #2288

Closed arturrez closed 5 days ago

arturrez commented 1 week ago

Why this should be merged

enahnces status command to provide additional output like

❯ ./bin/avalanche node local status --blockchain local7
Local clusters:
- local7: /Users/artur/.avalanche-cli/local/local7  [Running]  [Healthy]
   - http://127.0.0.1:9652 [NodeID-4MtkX1qTU8CcKH7rjYURC9dYUyUKmJXuU] [Bootstrapped Syncing]
 publicKey: 0xa0cdfa7ba33f14144b503f1633a418b655aacbf997c0d6a71c62dbec9cda19b55a42d2e66e4413aa436605dc43e31206 | proofOfPossession: 0xadac53e59f70787593f9d851b58c75da7acf0fd50584c7a2c786ff3803034cb8bc308fc4de878558d7d670a73dbb8633052b4caf56aa7482afaceec7d3b24e75bdd28d5f66dab222678b0a9883aebacc983170ae66dfd60d28461186daf841ed 
   - http://127.0.0.1:9654 [NodeID-4727K8AQzG4Gp2RByJ646NxgNG7fTtYAb] [Bootstrapped Syncing]
 publicKey: 0x8fcb344d3c0d3aaf69601d58b4fba0275a6527e64d8765ee929262871fc29bb87158db21c704b594673e2845c01f5e15 | proofOfPossession: 0xa0a14fe5d4f288f1e40d0c0ff334abe24018d45b6b1fdd01129bcd9d650523cdd2b8c6aad276253a061aa9ade945dbba06172fd29751a6811a1548860af46e3e36ed9063bff934fbe47e300a50bf198b614815f3e3235d5f47828629fd894419 
   - http://127.0.0.1:9656 [NodeID-JHfVv8ynVVFz6DagQskERoZNHKo51BSmX] [Bootstrapped Syncing]
 publicKey: 0xa5d5404885d9aa5c57fcfb294887965a8ac8a65895e0053e4507073e229e97b785b9f89df50bee96e9214d7a66c60fe2 | proofOfPossession: 0xb75cfac4519aa7e3c2f38eac301e85f1cadb54a2ce63e7fe3d6c057587ffb51e73fdfb4abaeccb9567509db89461c9ab096b402a78a496f099d6422b6b221af662f14e39be31b1f315b41b112ab431127e35d52fa1d8e2cffaf586704135b7dc 
   - http://127.0.0.1:9658 [NodeID-8X775GbZVYocUy1atmdWptBxX4PUUwiF1] [Bootstrapped Syncing]
 publicKey: 0xa108786fa926fd3dac94dc19cf59b404d5dbc1f8442bd99220716b6e2cc6eaea574d485c269382faf695c98d87732949 | proofOfPossession: 0xb446b82218b99fcf11b11d6a0323d4528f0fd8ed3343b8f01f1375f1f341b1fca42831bffa3993f7fe8fb5568fc31f9906d2d482a1d439fcc7431f981ffd8497d527fcb4faf78eaf9a2a207f4b5044ede0802e751e7d9267e866b0362406ebd3 
   - http://127.0.0.1:9660 [NodeID-5LuHDu2nSgXK8DDaHhiEDWg28rYDeZwvE] [Bootstrapped Syncing]
 publicKey: 0x80a670b75e4893238ef800423411190513b734de7aa873534ca04e486a19e80672185cf56b8aebf7f33eb819f2d2f12a | proofOfPossession: 0xab0b03b54d415e3473ea25fb919c0110c583b383586fdbeaee391d880a96d72e5d0a26bfb9dd8ca01216f992cee52cb30f2e999cabdc607c6e89afd9b5fe089820383a63ae57174628b20f5f5d39ffd74bba264559f020dfad5062242a643468 
   - http://127.0.0.1:9662 [NodeID-4ZN6mRWBLXZL1XPp2Cq47F2ZyjYfHm35k] [Bootstrapped Syncing]
 publicKey: 0x95b6761ee43ceec0b914cbc765e2ead9e7463ba7d6c0c3fd09c9938d101c6ff72fc61c11025953644ece00580a6aa40e | proofOfPossession: 0xb23c640f6d0dc85cc6d4d0c1c8b3ce7f3e85c1bc10719fc9fcb9039bb5274d793e456040c21c7723583434f977a91a841389143f245a6caa842e721bab64cc0ee72933eefc2739237a884c68c55b6fb047370395a765aa0f92d6949d9913f805 
   - http://127.0.0.1:9650 [NodeID-LKT3k8zfZn5e6ZkDfvw5UyBGnCepeRbie] [Bootstrapped Syncing]
 publicKey: 0x87a1931d3aacd9a27901572f129791672261bbde73fc515ffcca6a3831c8a33c834f070193d539d57cbe1bdf792eaf07 | proofOfPossession: 0xa4d8816a2f261a0bf4da6679ca3f49907f39ef7403611a3ab9f46c9150c1658808628883df1c6795dcaf8541844364ea14670061782ca74d597f75ea0048a66fa4868ebc40f3ed57b3173a51c1de760bb417754a945f1e8741d84a1c811c80ec

also adds --blockchain flag

How this works

queries info from url, prints it on the screen

How this was tested

  // create a blockchain conf
go run main.go blockchain create <BlockchainName>

// create the local node connected to etna
go run main.go node local start <EtnaInstanceName> --etna-devnet --avalanchego-path <AVALANCHEGO_PATH>

// create subnet+blockchain+convert on the blokchain
go run main.go blockchain deploy <BlockchainName> --cluster <EtnaInstanceName> --bootstrap-endpoints http://127.0.0.1:9650

// restart the node with blockchain tracking
go run main.go node local track <EtnaInstanceName> <BlockchainName>

//get status
go run main.go node local status --blockchain <BlockchainName>


## How is this documented
sukantoraymond commented 1 week ago

Seems that --blockchain is actually filtering by clustername instead so should be --cluster?

I can also see that users use the 1 command subnet deploy so --blockchain flag here makes sense but then we will have to return all clusters that are syncing the the subnet

Also maybe we should do ./bin/avalanche node local status instead of using a flag

sukantoraymond commented 1 week ago

Proof of possession should be on a new line after public key

sukantoraymond commented 1 week ago

What does Bootstrapped Syncing mean? I think a node can be either bootstrapped, syncing or validating.

On that note, are we showing if a node is a bootstrap validator / a validator?

arturrez commented 1 week ago

addressed these comments. For the --blockhain flag we should require user to provide clusterName as we don't have a way to query this information for stopped local clusters. I added more infromation for the user as Bootrapped is related to Primary network with Syncing/Validating as a L1 status we get from corresponding RPC call. So this is similar to what we have for remote node status command

arturrez commented 1 week ago

current status after ui improvements image