Expand description
start the bootstrapping system using start_bootstrap_server
Once your node will be ready, you may want other to bootstrap from you.
ยงListener
Runs in the server-dedication tokio async runtime Accepts bootstrap connections in an async-loop Upon connection, pushes the accepted connection onto a channel for the worker loop to consume
ยงUpdater
Runs on a dedicated thread. Signal sent my manager stop method terminates the thread.
Shares an Arc<RwLock>> guarded list of white and blacklists with the main worker.
Periodically does a read-only check to see if list needs updating.
Creates an updated list then swaps it out with write-locked list
Assuming no errors in code, this is the only write occurrence, and is only a pointer-swap
under the hood, making write contention virtually non-existent.
ยงWorker loop
- Checks if the stopper has been invoked.
- Checks if the client is permitted under the white/black list rules
- Checks if there are not too many active sessions already
- Checks if the client has attempted too recently
- All checks have passed: spawn a thread on which to run the bootstrap session
This thread creates a new tokio runtime, and runs it with
block_on
Structsยง
- Bootstrap
Manager - handle on the bootstrap server
- Bootstrap
Server ๐
Functionsยง
- manage_
bootstrap ๐ - run_
bootstrap_ ๐session - To be called from a
thread::spawninvocation - start_
bootstrap_ server - See module level documentation for details
- step_
timeout_ ๐duration - stream_
bootstrap_ information