Type Method
bootstrap(url:username:password:timeout:)
Bootstrap the direct RPC bridge using explicit credentials.
static func bootstrap(url: URL, username: String, password: String, timeout: Duration = .seconds(30)) async throws
Parameters
-
url
-
The RPC endpoint URL (e.g., http://127.0.0.1:8332).
-
username
-
RPC username.
-
password
-
RPC password.
-
timeout
-
Maximum time to wait for the RPC server (default 30s).
Mentioned In
Discussion
Polls until the RPC server is ready, then calls the hidden _bridge_init RPC via HTTP to capture the NodeContext for direct dispatch. After this method returns, the auto-detecting transport inside RPCClient(url:username:password:) routes non-wallet RPCs through DirectTransport automatically.
Throws
The last transport error if the timeout expires, or CancellationError if the task is cancelled.