Platform

Platform

new Platform()

Handles all functions related to the blockcluster platform operation

Source:

Classes

Platform

Methods

(async) acceptInvite(options) → {Promise.<any>}

Accepts an invite sent using the inviteViaEmail() function

Parameters:
Name Type Description
options object

Invite options

Properties
Name Type Description
inviteId string

Id of the invite to accept

locationCode string

Location code from the list of available location from fetchLocations() function

networkConfigId string

Id of the network type from the fetchNetworkType() function

Source:
Returns:

Instance id or error

Type
Promise.<any>

(async) acceptPrivatehiveChannelInvite(inviteId, peerId) → {string}

Accepts an invite to join a channel

Parameters:
Name Type Description
inviteId string

InviteID to be accepted

peerId string

InstanceID of the peer to join the channel

Source:
Returns:

InstanceID of the joined peer

Type
string

(async) createNetwork(options) → {Promise.<(string|err)>}

Creates a blockcluster node

Parameters:
Name Type Description
options object

Network options

Properties
Name Type Description
networkName string

Name of the network to be created

networkConfigId string

Id of the network type from the fetchNetworkType() function

locationCode string

Location code from the list of available location from fetchLocations() function

Source:
Returns:

Id of the network which was created

Type
Promise.<(string|err)>

(async) createPrivatehiveNetwork(options) → {string}

Creates a privatehive node

Parameters:
Name Type Description
options object

Options

Properties:
Name Type Attributes Description
options.peerId string <optional>

Peer Id to which the orderer joins. Required only incase of orderer type

options.locationCode string

Location code where the network should be deployed

options.type peer | orderer

Type of network. Either peer or orderer

options.voucherCode string <optional>

Voucher code to be applied

options.name string

Name of the network. Required

options.orgName string

Organization to which the node belongs to

options.ordererType solo | kafka <optional>

Type of orderer to be created. Solo or Kafka. Required only if type is orderer

options.networkConfigId stirng

ID of network configuration

options.diskSpace number <optional>

Disk space required for this node. Applicable only if network configuration has isDiskChangeable = true

Source:
Returns:

Instance ID of the created network

Type
string

(async) deleteNetwork(networkId) → {Promise.<any>}

Deletes a network from the blockcluster platform

Parameters:
Name Type Description
networkId string

Id of the network to be deleted

Source:
Returns:

Response of the delete operation

Type
Promise.<any>

(async) deletePrivatehiveNetwork(networkId) → {string}

Delets a privatehive node

Parameters:
Name Type Description
networkId string

Instance ID of the network to be deleted

Source:
Returns:

InstanceID of deleted network

Type
string

(async) fetchLocations(serviceopt) → {Promise.<array>}

Fetches all the applicable locations. You need to pass the location code in any create or invite request

Parameters:
Name Type Attributes Default Description
service dynamo | privatehive <optional>
dynamo

Service for which the locations are to be fetched

Source:
Returns:

List of locations

Type
Promise.<array>

(async) fetchNetworkTypes(serviceopt) → {Promise.<array>}

Fetches all the applicable network types. You need to pass the network type id in any create or invite request

Parameters:
Name Type Attributes Default Description
service dynamo | privatehive <optional>
dynamo

Service for which the configurations are to be fetched

Source:
Returns:

List of network types

Type
Promise.<array>

getPrivatehiveNode(nodeInfo) → {PrivatehiveNode}

Returns privatehive node object to operate on it

Parameters:
Name Type Description
nodeInfo object

Node information details. Can be fetched from listPrivatehiveNetworks(instanceId)

Source:
Returns:

Privatehive node instance

Type
PrivatehiveNode

(async) inviteUserToChannel(params) → {string}

Invites a user to a HLF channel. The invited user can select the peer which will join the channel

Parameters:
Name Type Description
params object

Options

Properties:
Name Type Description
params.email string

Email of the user to be invited

params.peerId string

Instance ID of the peer to be invited

params.channelName string

Channel to which the user should be invited to

params.ordererDomain string

Domain of the orderer

params.ordererConnectionDetails string

Connection details of the orderer like "grpc://1.2.3.4:1234"

Source:
Returns:

Invite ID

Type
string

(async) inviteViaEmail(options) → {Promise.<string>}

Invites another use to join a node on the blockcluster platform

Parameters:
Name Type Description
options object

Invite options

Properties
Name Type Description
inviteToEmail string

Email id of the user to be invited. The email id should be a user of blockcluster to be able to join the network. If the user is not on the blockcluster platform then an account in pending state will be created with this email id

networkId string

Id of the network to which the new node should join

networkType string.<(peer|authority)>

Type of network the new network will be

Source:
Returns:

Invite id of the invite. Use this invite id to accept

Type
Promise.<string>

(async) joinNetwork(options) → {Promise.<any>}

Creates a network which will be joined to an existing network having all the details

Parameters:
Name Type Description
options object

Network options

Properties
Name Type Description
networkName string

Name of the network to be created

nodeType string.<(authority|peer)>

Type of network

genesisFileContent string

Content of genesis block

totalENodes Array.<string>

List of enode urls to be joined

impulseURL string

URL of impulse

assetsContractAddress string

Asset smart contract address

atomicSwapContractAddress string

Atomic Swap smart contract address

streamsContractAddress string

Steams smart contract address

impulseContractAddress string

Impulse smart contract address

locationCode string

Location code from the list of available location from fetchLocations() function

networkConfigId string

Id of the network type from the fetchNetworkType() function

Source:
Returns:

Instance id or error message

Type
Promise.<any>

(async) listPrivatehiveChannelInvites() → {Array.<Invite>}

Lists all pending privatehive channel invites

Source:
Returns:

List of invites

Type
Array.<Invite>

(async) listPrivatehiveNetworks(instanceIdopt, options) → {Array.<Node>}

Lists details of privatehive networks

Parameters:
Name Type Attributes Description
instanceId string <optional>

If provided then fetches details of only this instance

options object

Additional filters

Properties:
Name Type Attributes Description
options.showDeleted bool <optional>

If true then shows all the deleted networks as well

options.nodeType peer | orderer <optional>

Queries only a particular type of node

options.locationCode string <optional>

Queries networks only in this location

options.createdAfter date <optional>

Queries networks created after this date

options.createdBefore date <optional>

Queries networks created before this date

Source:
Returns:

Array of networks matching the filters

Type
Array.<Node>