Beo Network Client
Overview
Connection management class that encapsulates REST calls to publicly exposed endpoints of Beo nodes. The methods provided in this class provide information on the Beo Blockchain
new BeoNetworkClient(host)
host
string
Example
// Connection to a local node
let local_connection = new BeoNetworkClient("http://localhost:3030");
// Connection to a public beacon node
let public_connection = new BeoNetworkClient("https://api.explorer.provable.com/v1");
BeoNetworkClient.setHost(host)
Set a new host for the networkClient
host
string
Example
// New connection to a public beacon node
let public_connection = BeoNetworkClient.setHost("https://api.explorer.provable.com/v1");
BeoNetworkClient.setAccount(account)
Set an account
Kind: instance method of BeoNetworkClient
account
Account
Example
let account = new Account();
connection.setAccount(account);
BeoNetworkClient.getAccount()
Return the Beo account used in the node connection
Kind: instance method of BeoNetworkClient
Example
let account = connection.getAccount();
BeoNetworkClient.getBlock(height)
Returns the block contents of the block at the specified block height
Kind: instance method of BeoNetworkClient
height
number
Example
let block = connection.getBlock(1234);
BeoNetworkClient.getBlockRange(start, end)
Returns a range of blocks between the specified block heights
Kind: instance method of BeoNetworkClient
start
number
end
number
Example
let blockRange = connection.getBlockRange(2050, 2100);
BeoNetworkClient.getProgram(programId)
Returns the source code of a program
Kind: instance method of BeoNetworkClient
programId
string
Example
let program = connection.getProgram("foo.Beo");
BeoNetworkClient.getProgramObject(programId)
Returns a program object from a program ID or program source code
Kind: instance method of BeoNetworkClient
programId
string
Example
let program = connection.getProgramObject("foo.Beo");
BeoNetworkClient.getProgramImports(programId)
Returns an object containing the source code of a program and the source code of all programs it imports
Kind: instance method of BeoNetworkClient
programId
string
Example
let program = connection.getProgramImports("foo.Beo");
BeoNetworkClient.getDeploymentTransactionIDForProgram(programId)
Returns the deployment transaction id associated with the specified program
Kind: instance method of BeoNetworkClient
programId
string
Example
let program = connection.getDeploymentTransactionIDForProgram("foo.Beo");
BeoNetworkClient.getDeploymentTransactionForProgram(programId)
Returns the deployment transaction associated with a specified program
Kind: instance method of BeoNetworkClient
programId
string
Last updated