Skip to main content

Class: Connectivity

Defined in: bee-js/src/modules/connectivity.ts:12

Peer, topology and network connectivity operations.

Accessed as bee.connectivity.

Constructors

Constructor

new Connectivity(context): Connectivity

Defined in: bee-js/src/modules/connectivity.ts:13

Parameters

context

BeeContext

Returns

Connectivity

Methods

checkConnection()

checkConnection(requestOptions?): Promise<void>

Defined in: bee-js/src/modules/connectivity.ts:21

Pings the Bee node to see if there is a live Bee node on the given URL.

Parameters

requestOptions?

BeeRequestOptions

Options for making requests, such as timeouts, custom HTTP agents, headers, etc.

Returns

Promise<void>

Throws

If connection was not successful throw error


getBlocklist()

getBlocklist(requestOptions?): Promise<Peer[]>

Defined in: bee-js/src/modules/connectivity.ts:71

Fetches the list of blocked peers for this node.

Parameters

requestOptions?

BeeRequestOptions

Options for making requests, such as timeouts, custom HTTP agents, headers, etc.

Returns

Promise<Peer[]>


getNodeAddresses()

getNodeAddresses(requestOptions?): Promise<NodeAddresses>

Defined in: bee-js/src/modules/connectivity.ts:62

Fetches the overlay, underlay, Ethereum, and other addresses of the Bee node.

Parameters

requestOptions?

BeeRequestOptions

Options for making requests, such as timeouts, custom HTTP agents, headers, etc.

Returns

Promise<NodeAddresses>


getPeers()

getPeers(requestOptions?): Promise<Peer[]>

Defined in: bee-js/src/modules/connectivity.ts:80

Gets list of peers for this node.

Parameters

requestOptions?

BeeRequestOptions

Options for making requests, such as timeouts, custom HTTP agents, headers, etc.

Returns

Promise<Peer[]>


getTopology()

getTopology(requestOptions?): Promise<Topology>

Defined in: bee-js/src/modules/connectivity.ts:101

Fetches topology and connectivity information of the Bee node.

Parameters

requestOptions?

BeeRequestOptions

Options for making requests, such as timeouts, custom HTTP agents, headers, etc.

Returns

Promise<Topology>


isConnected()

isConnected(requestOptions?): Promise<boolean>

Defined in: bee-js/src/modules/connectivity.ts:31

Pings the Bee node to see if there is a live Bee node on the given URL.

Parameters

requestOptions?

BeeRequestOptions

Options for making requests, such as timeouts, custom HTTP agents, headers, etc.

Returns

Promise<boolean>

true if successful, false on error


isGateway()

isGateway(requestOptions?): Promise<boolean>

Defined in: bee-js/src/modules/connectivity.ts:49

Checks the /gateway endpoint to see if the remote API is a gateway.

Do note that this is not a standard way to check for gateway nodes, but some of the gateway tooling expose this endpoint.

Parameters

requestOptions?

BeeRequestOptions

Options for making requests, such as timeouts, custom HTTP agents, headers, etc.

Returns

Promise<boolean>


ping()

ping(peer, requestOptions?): Promise<PingResponse>

Defined in: bee-js/src/modules/connectivity.ts:111

Pings a specific peer to check its availability.

Parameters

peer

Overlay address of the peer to be pinged.

string | PeerAddress

requestOptions?

BeeRequestOptions

Options for making requests, such as timeouts, custom HTTP agents, headers, etc.

Returns

Promise<PingResponse>


removePeer()

removePeer(peer, requestOptions?): Promise<RemovePeerResponse>

Defined in: bee-js/src/modules/connectivity.ts:90

Disconnects from a specific peer.

Parameters

peer

Overlay address of the peer to be removed.

string | PeerAddress

requestOptions?

BeeRequestOptions

Options for making requests, such as timeouts, custom HTTP agents, headers, etc.

Returns

Promise<RemovePeerResponse>

💬 Get Help