Platform

Platform

new Platform()

Handles all functions related to the blockcluster platform operation

Source:

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) 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) 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) fetchLocations() → {Promise.<array>}

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

Source:
Returns:

List of locations

Type
Promise.<array>

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

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

Source:
Returns:

List of network types

Type
Promise.<array>

(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>