nodeVersionInfo
Retrieve version information from the connected Flow Access Node.
This function returns detailed information about the Flow node's version, including the protocol version, spork information, and node-specific details. This is useful for debugging, compatibility checks, and understanding the network state.
Import
You can import the entire package and access the function:
_10import * as sdk from "@onflow/sdk"_10_10sdk.nodeVersionInfo(opts)
Or import directly the specific function:
_10import { nodeVersionInfo } from "@onflow/sdk"_10_10nodeVersionInfo(opts)
Usage
_19import * as fcl from "@onflow/fcl";_19_19// Get node version information_19const versionInfo = await fcl.nodeVersionInfo();_19console.log(versionInfo);_19// {_19// semver: "v0.37.13",_19// commit: "12345abcd",_19// spork_id: "mainnet-23",_19// protocol_version: "2.13.10",_19// spork_root_block_height: "88483760",_19// node_root_block_height: "88483760"_19// }_19_19// Check compatibility_19const info = await fcl.nodeVersionInfo();_19if (info.protocol_version.startsWith("2.13")) {_19 console.log("Compatible with current protocol version");_19}
Parameters
opts
(optional)
- Type:
any
- Description: Optional parameters for the request