Function substrate_cli_test_utils::start_node
source · pub fn start_node() -> Child
Expand description
Starts a new Substrate node in development mode with a temporary chain.
This function creates a new Substrate node using the substrate
binary.
It configures the node to run in development mode (--dev
) with a temporary chain (--tmp
),
sets the WebSocket port to 45789 (--ws-port=45789
).
§Returns
A Child
process representing the spawned Substrate node.
§Panics
This function will panic if the substrate
binary is not found or if the node fails to start.
§Examples
ⓘ
use my_crate::start_node;
let child = start_node();
// Interact with the Substrate node using the WebSocket port 45789.
// When done, the node will be killed when the `child` is dropped.