Skip to main content

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:


_10
import * as sdk from "@onflow/sdk"
_10
_10
sdk.nodeVersionInfo(opts)

Or import directly the specific function:


_10
import { nodeVersionInfo } from "@onflow/sdk"
_10
_10
nodeVersionInfo(opts)

Usage


_19
import * as fcl from "@onflow/fcl";
_19
_19
// Get node version information
_19
const versionInfo = await fcl.nodeVersionInfo();
_19
console.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
_19
const info = await fcl.nodeVersionInfo();
_19
if (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

Returns

Promise<NodeVersionInfo>


Rate this page