LLM Notice: This documentation site supports content negotiation for AI agents. Request any page with Accept: text/markdown or Accept: text/plain header to receive Markdown instead of HTML. Alternatively, append ?format=md to any URL. All markdown files are available at /md/ prefix paths. For all content in one file, visit /llms-full.txt
Skip to main content

ping

A builder function that creates a ping interaction to test connectivity to the Flow Access Node.

The ping interaction is a simple way to test if the Flow Access Node is reachable and responding. This is useful for health checks, connectivity testing, and debugging network issues.

Import​

You can import the entire package and access the function:


_10
import * as fcl from "@onflow/fcl"
_10
_10
fcl.ping()

Or import directly the specific function:


_10
import { ping } from "@onflow/fcl"
_10
_10
ping()

Usage​


_22
import * as fcl from "@onflow/fcl";
_22
_22
// Simple ping to test connectivity
_22
try {
_22
const response = await fcl.send([fcl.ping()]);
_22
console.log("Access Node is reachable");
_22
} catch (error) {
_22
console.error("Access Node is not reachable:", error);
_22
}
_22
_22
// Use ping for health checks
_22
const healthCheck = async () => {
_22
try {
_22
await fcl.send([fcl.ping()]);
_22
return { status: "healthy", timestamp: new Date().toISOString() };
_22
} catch (error) {
_22
return { status: "unhealthy", error: error.message, timestamp: new Date().toISOString() };
_22
}
_22
};
_22
_22
const health = await healthCheck();
_22
console.log("Health status:", health);

Returns​


_10
export type InteractionBuilderFn = (
_10
ix: Interaction
_10
) => Interaction | Promise<Interaction>

A function that processes an interaction object


Rate this page