JS API Reference

Class: NetworkApiAdapter

shared/yagna/adapters/network-api-adapter.NetworkApiAdapter

Implements

Table of contents

Constructors

Methods

Constructors

constructor

new NetworkApiAdapter(yagnaApi): NetworkApiAdapter

Parameters

NameType
yagnaApiYagnaApi

Returns

NetworkApiAdapter

Defined in

src/shared/yagna/adapters/network-api-adapter.ts:6

Methods

createNetwork

createNetwork(options): Promise<Network>

Creates a new network with the specified options.

Parameters

NameTypeDescription
optionsObjectNetworkOptions
options.ipstring-
options.mask?string-
options.gateway?string-

Returns

Promise<Network>

Implementation of

INetworkApi.createNetwork

Defined in

src/shared/yagna/adapters/network-api-adapter.ts:8


removeNetwork

removeNetwork(network): Promise<void>

Removes an existing network.

Parameters

NameTypeDescription
networkNetworkThe network to be removed.

Returns

Promise<void>

Implementation of

INetworkApi.removeNetwork

Defined in

src/shared/yagna/adapters/network-api-adapter.ts:22


createNetworkNode

createNetworkNode(network, nodeId, nodeIp): Promise<NetworkNode>

Creates a new node within a specified network.

Parameters

NameTypeDescription
networkNetworkThe network to which the node will be added.
nodeIdstringThe ID of the node to be created.
nodeIpstringOptional IP address for the node. If not provided, the first available IP address will be assigned.

Returns

Promise<NetworkNode>

Implementation of

INetworkApi.createNetworkNode

Defined in

src/shared/yagna/adapters/network-api-adapter.ts:35


removeNetworkNode

removeNetworkNode(network, node): Promise<void>

Removes an existing node from a specified network.

Parameters

NameTypeDescription
networkNetworkThe network from which the node will be removed.
nodeNetworkNodeThe node to be removed.

Returns

Promise<void>

Implementation of

INetworkApi.removeNetworkNode

Defined in

src/shared/yagna/adapters/network-api-adapter.ts:56


getIdentity

getIdentity(): Promise<string>

Returns the identifier of the requesor

Returns

Promise<string>

Implementation of

INetworkApi.getIdentity

Defined in

src/shared/yagna/adapters/network-api-adapter.ts:70

Was this helpful?