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(storage-provider-server): add p2p bootstrap and registration #666

Merged
merged 34 commits into from
Jan 16, 2025

Conversation

aidan46
Copy link
Contributor

@aidan46 aidan46 commented Jan 7, 2025

Description

This PR adds bootstrap and registration p2p node functionality to the polka-storage-provider-server. The node type is selected by passing the node-type argument into the CLI (bootstrap or registration). Configuration is read from a TOML file, see the example in the p2p-example-config folder. The P2P network supports an ED25519 private key in PEM file format.

The generate-peer-id command has been added to the polka-storage-provider-client. This command generates a peer ID from an ED25519 public key PEM file and writes it to a file or stdout, depending on the --file argument.

Note:
I have not added any P2P discovery, this will be implemented in the fetching application. I can add a discovery example if needed.

@aidan46 aidan46 self-assigned this Jan 7, 2025
@aidan46 aidan46 added the enhancement New feature or request label Jan 7, 2025
@aidan46 aidan46 added this to the Phase 3 milestone Jan 7, 2025
@aidan46 aidan46 linked an issue Jan 7, 2025 that may be closed by this pull request
@aidan46 aidan46 linked an issue Jan 7, 2025 that may be closed by this pull request
Cargo.toml Show resolved Hide resolved
storage-provider/client/src/commands/mod.rs Show resolved Hide resolved
storage-provider/client/src/commands/mod.rs Outdated Show resolved Hide resolved
storage-provider/server/p2p-example-config/private.pem Outdated Show resolved Hide resolved
storage-provider/server/p2p-example-config/bootstrap.toml Outdated Show resolved Hide resolved
storage-provider/server/src/main.rs Outdated Show resolved Hide resolved
storage-provider/server/src/main.rs Outdated Show resolved Hide resolved
storage-provider/server/src/p2p.rs Outdated Show resolved Hide resolved
@aidan46 aidan46 force-pushed the feat/peer-resolver branch from 13fb051 to a3e3803 Compare January 7, 2025 12:40
@aidan46 aidan46 added ready for review Review is needed and removed ready for review Review is needed labels Jan 10, 2025
examples/p2p-config/register.toml Outdated Show resolved Hide resolved
pallets/storage-provider/src/tests/mod.rs Outdated Show resolved Hide resolved
storage-provider/server/src/p2p.rs Outdated Show resolved Hide resolved
storage-provider/server/src/p2p.rs Outdated Show resolved Hide resolved
storage-provider/server/src/p2p.rs Outdated Show resolved Hide resolved
@aidan46 aidan46 added ready for review Review is needed and removed ready for review Review is needed labels Jan 13, 2025
@aidan46 aidan46 requested a review from a team January 13, 2025 06:37
@aidan46 aidan46 force-pushed the feat/peer-resolver branch from b246518 to 2044170 Compare January 14, 2025 09:21
@jmg-duarte jmg-duarte changed the title feat: Add P2P functionality feat(storage-provider-server): add p2p bootstrap and registration Jan 14, 2025
@aidan46 aidan46 added ready for review Review is needed and removed ready for review Review is needed labels Jan 15, 2025
@aidan46 aidan46 requested review from cernicc and jmg-duarte January 15, 2025 10:42
@aidan46 aidan46 added ready for review Review is needed and removed ready for review Review is needed labels Jan 15, 2025
@aidan46 aidan46 requested review from pete-eiger and removed request for jmg-duarte January 15, 2025 10:48
Copy link
Contributor

@jmg-duarte jmg-duarte left a comment

Choose a reason for hiding this comment

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

Looks good to me, I've left some comments that require addressing, others for discussion

docs/src/storage-provider-cli/server.md Outdated Show resolved Hide resolved
examples/rpc_publish.sh Outdated Show resolved Hide resolved
examples/p2p-config/bootstrap.toml Outdated Show resolved Hide resolved
examples/p2p-config/register.toml Outdated Show resolved Hide resolved
storage-provider/server/src/p2p.rs Outdated Show resolved Hide resolved
storage-provider/server/src/main.rs Outdated Show resolved Hide resolved
storage-provider/server/src/main.rs Show resolved Hide resolved
storage-provider/server/src/main.rs Outdated Show resolved Hide resolved
storage-provider/server/src/p2p.rs Outdated Show resolved Hide resolved
storage-provider/server/src/p2p.rs Outdated Show resolved Hide resolved
@aidan46 aidan46 added ready for review Review is needed and removed ready for review Review is needed labels Jan 15, 2025
@aidan46 aidan46 merged commit cba074e into develop Jan 16, 2025
5 checks passed
@aidan46 aidan46 deleted the feat/peer-resolver branch January 16, 2025 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request ready for review Review is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: Implement public key to Peer ID conversion feat: Implement resolver in sp-server
4 participants