Skip to content

Conversation

@lthibault
Copy link
Contributor

@lthibault lthibault commented Nov 14, 2025

Parts of this may be a bit crude, but expect refinement over subsequent PRs. Recommending approaching this from the top-level Makefile and working down. In essence, we build examples/default-kernel into an empty dir, ipfs add it, and then embed the resulting CID in the ww binary as a default PID0 for the cell.

- Export is_ipfs_path() from loaders module for reuse
- Add path sanitization to prevent directory traversal attacks
- Refactor BootConfig to support both IPFS UnixFS and local filesystem paths
- Separate file I/O (read_file_content) from parsing (parse_multiaddrs_from_content)
- Update executor to pass boot_path and ipfs_url to BootConfig
- Add comprehensive tests for path sanitization and IPFS path detection
- All async operations properly handled for IPFS HTTP API calls
- Add router.capnp schema defining Router interface with addPeer and bootstrap methods
- Update build.rs to compile Cap'n Proto schemas
- Add capnp and capnp-rpc dependencies to Cargo.toml
- Add router_capnp module to src/lib.rs for generated code
- Add RouterCapability struct implementing router_capnp::router::Server
- Use MPSC channel to send KAD operations to executor
- Implement addPeer method to add peers to routing table
- Implement bootstrap method to trigger Kademlia bootstrap
- Export router module in src/cell/mod.rs
- Create Router capability in executor and expose as bootstrap capability
- Add create_host_rpc_system to Proc for host-side RPC setup
- Use tokio_util::compat for stream compatibility
- Process KAD operations (AddPeer, Bootstrap) in executor event loop
- Run RPC system concurrently with swarm event loop
- Add build.rs to default-kernel example to compile router schema
- Add capnpc build dependency to default-kernel Cargo.toml
- Update default-kernel to bootstrap Router client and add hardcoded IPFS bootstrap peers
- Extract peer IDs from multiaddrs and group addresses by peer
- Call Router.addPeer for each bootstrap peer, then call Router.bootstrap
@lthibault lthibault self-assigned this Nov 14, 2025
@lthibault lthibault added the enhancement New feature or request label Nov 14, 2025
- Downgrade libp2p from 0.56.0 to 0.55.0 to avoid buggy libp2p-kad 0.48.0
- Remove [patch.crates-io] section from root Cargo.toml
- Remove root .patches directory (no longer needed)
- Example patches in examples/default-kernel/.patches remain for WASM support
@mikelsr mikelsr self-requested a review November 18, 2025 07:43
@lthibault lthibault marked this pull request as ready for review November 18, 2025 23:08
@lthibault
Copy link
Contributor Author

@mikelsr I've pared the scope way back and arrived at something I'm quite pleased with. I will re-introduce capnp in a later PR. For now, we've got a default kernel that builds and embeds, and a PID0 that prints to stdout.

Hopefully this is a bit easier to review, too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants