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: generate and use private key from environment variable and add support for dnsaddr seed peers #27

Conversation

ksrichard
Copy link
Collaborator

@ksrichard ksrichard commented Aug 7, 2024

Description

In order to generate a private key earlier that can be used at any start from env vars, we needed a solution.
Now there is a new cli option called --generate-identity. With this option, you can generate a new identity (an encoded libp2p private key) that can be used to set value later for SHA_P2POOL_IDENTITY environment variable (the command outputs a json where private_key field is the one need to use).
If that var is set, when starting p2pool with --stable-peer flag, it will look for first for this env var and tries to decode and use it.
Also /dnsaddr/* seed peer addresses were not supported, now it is supported, so p2pool will parse all the TXT DNS records and add them to kademlia to bootstrap.

Motivation and Context

How Has This Been Tested?

cargo build --release
export SHA_P2POOL_IDENTITY=$(./target/release/sha_p2pool --generate-identity | jq -r '.private_key')
./target/release/sha_p2pool --stable-peer

After starting/stopping many times p2pool, the peer ID remains the same.

What process can a PR reviewer use to test or verify this change?

See testing.

Breaking Changes

  • None
  • Requires data directory on base node to be deleted
  • Requires hard fork
  • Other - Please specify

@ksrichard ksrichard changed the title feat(cli): generate and use private key from environment variable feat: generate and use private key from environment variable and add support for dnsaddr multi addresses Aug 8, 2024
@ksrichard ksrichard changed the title feat: generate and use private key from environment variable and add support for dnsaddr multi addresses feat: generate and use private key from environment variable + add support for dnsaddr multi addresses Aug 8, 2024
@ksrichard ksrichard changed the title feat: generate and use private key from environment variable + add support for dnsaddr multi addresses feat: generate and use private key from environment variable and add support for dnsaddr seed peers Aug 8, 2024
@ksrichard ksrichard marked this pull request as ready for review August 8, 2024 08:39
@stringhandler stringhandler added this pull request to the merge queue Aug 8, 2024
Merged via the queue into tari-project:development with commit 2a94f40 Aug 8, 2024
11 checks passed
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.

2 participants