Skip to content

Commit

Permalink
docs(book): add bootstrapping with custom behaviour docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tqwewe committed Jan 17, 2025
1 parent 7b9fc4d commit febad08
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/distributed-actors/bootstrapping-actor-swarm.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ let actor_swarm = ActorSwarm::bootstrap_with_identity(keypair)?;

The `Keypair` generates a cryptographic identity for the node. This is useful for secure, verifiable communication between peers. The node will now be identified by its `PeerId`, derived from the keypair.

## Bootstrapping with Custom Behaviour

For more advanced use cases such as custom swarm configurations, or entirely custom behaviour, the actor swarm can be bootstrapped with the more flexible methods:

- `ActorSwarm::bootstrap_with_behaviour` for providing a custom behaviour.
- `ActorSwarm::bootstrap_with_swarm` for providing a custom swarm.
- `ActorSwarm::bootstrap_manual` for extremely manual processing of the actor swarm. (see [`examples/manual_swarm.rs`])

[`examples/manual_swarm.rs`]: https://github.com/tqwewe/kameo/blob/main/examples/manual_swarm.rs

## Listening on a Multiaddress

After bootstrapping the swarm, you need to instruct the node to listen on a specific network address. Kameo uses libp2p’s **multiaddress** format, which allows nodes to specify how they can be reached over the network. Multiaddresses define the protocol (e.g., TCP or QUIC) and the IP address/port combination.
Expand Down

0 comments on commit febad08

Please sign in to comment.