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

Feat: Add peer-pub-key command to stacks-inspect #3633

Merged
merged 3 commits into from
Apr 4, 2023
Merged

Conversation

kantai
Copy link
Member

@kantai kantai commented Mar 23, 2023

Description

Specifying bootstrap_node entries in a stacks-node config file requires the peer's public key. Figuring out a peer's public key from its local_peer_seed isn't always trivial (you can get it from the logs during node bootup, but you don't necessarily want to have to deploy a node to figure out what its public key will be).

But, computing the public key from a peer seed value is pretty easy from the library, so I added a peer-pub-key command to stacks-inspect which can help in this case.

@codecov
Copy link

codecov bot commented Mar 23, 2023

Codecov Report

Merging #3633 (f6f4ea6) into develop (136220e) will decrease coverage by 54.84%.
The diff coverage is 23.52%.

@@             Coverage Diff              @@
##           develop    #3633       +/-   ##
============================================
- Coverage    84.93%   30.09%   -54.84%     
============================================
  Files          298      298               
  Lines       276611   276633       +22     
============================================
- Hits        234941    83260   -151681     
- Misses       41670   193373   +151703     
Impacted Files Coverage Δ
src/main.rs 0.00% <0.00%> (-0.08%) ⬇️
testnet/stacks-node/src/tests/neon_integrations.rs 69.18% <0.00%> (-10.51%) ⬇️
stacks-common/src/util/secp256k1.rs 34.28% <20.00%> (-43.55%) ⬇️
testnet/stacks-node/src/tests/epoch_21.rs 79.03% <83.33%> (+6.83%) ⬆️
testnet/stacks-node/src/neon_node.rs 81.65% <100.00%> (-2.41%) ⬇️

... and 263 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@pavitthrap pavitthrap left a comment

Choose a reason for hiding this comment

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

lgtm other than build issue

stacks-common/src/util/secp256k1.rs Show resolved Hide resolved
@@ -3808,25 +3807,6 @@ impl PeerThread {
}

impl StacksNode {
/// Create a StacksPrivateKey from a given seed buffer
pub fn make_node_private_key_from_seed(seed: &[u8]) -> StacksPrivateKey {
Copy link
Contributor

Choose a reason for hiding this comment

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

there's a build failure related to this function - it's used in more places

Copy link
Contributor

@obycode obycode left a comment

Choose a reason for hiding this comment

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

LGTM!

@kantai kantai merged commit 995ea8f into develop Apr 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

3 participants