Skip to main content

Crate freenet

Crate freenet 

Source

Modules§

config
Peer node configuration.
dev_tool
Exports for the dev tool.
generated
Generated messages from the flatbuffers schema for the network monitor.
local_node
Exports to build a running local node.
server
Local server used to communicate with the peer core. Handles external client connections (HTTP/WebSocket).
simulation
Deterministic simulation testing framework. Deterministic simulation testing framework for Freenet.
storages
test_utils
tracing
Tracing and loging infrastructure. Includes our custom event log register. Tracing collectors, etc.
transport
Code for communicating with other peers over UDP, handles hole-punching, error handling, etc. Freenet Transport protocol implementation.
util

Macros§

deterministic_select
The deterministic_select! macro waits on multiple async operations simultaneously, returning when one of them completes. Branch ordering is determined by GlobalRng for deterministic but fair selection.

Structs§

Node
ShutdownHandle
Handle to trigger graceful shutdown of the node.

Enums§

EventLoopExitReason
Represents the different ways the event loop can exit.

Functions§

enable_abort_on_fatal_listener_exit
Enable the #4549 fast-exit behaviour: a fatal (non-graceful) network event listener exit will abort the process with [FATAL_LISTENER_EXIT_CODE] for a prompt service-manager restart, rather than risk hanging in teardown. Call once from the production node entry point. See [ABORT_ON_FATAL_LISTENER_EXIT].
enable_abort_on_redb_poison
Enable the #4604 redb-poison fast-exit. Once the contract storage layer detects that the redb database is poisoned (a transient I/O error left redb returning “Previous I/O error occurred. Please close and re-open the database.” from every transaction), the process exits so the service manager restarts it with a fresh handle and the health / auto-update hooks fire — instead of the node staying “running” while 100% of contract operations fail forever. Call once from the production node entry point. See [ABORT_ON_REDB_POISON].
enable_fast_crash_exit_code
Opt in to the distinct [FAST_CRASH_EXIT_CODE] for fast boot-crashes (#4551). Call ONLY from the production node entry point, and ONLY after confirming the supervising systemd unit advertises support for exit 45 (see the entry point’s marker check). See [EMIT_FAST_CRASH_EXIT_CODE].
run_local_node
run_network_node