Request
This is a message type, which gets a reply with a response type message.
const network = require('ocore/network.js');
const ws = network.getInboundDeviceWebSocket(device_address);
// function parameters: websocket, command, params, bReroutable, callback
var tag = network.sendRequest(ws, 'get_witnesses', null, false, getParentsAndLastBallAndWitnessListUnit);
function getParentsAndLastBallAndWitnessListUnit(ws, req, witnesses) {
var params = {
witnesses: witnesses
};
network.sendRequest(ws, 'light/get_parents_and_last_ball_and_witness_list_unit', params, false,
function(ws, req, response) {
console.log(response);
}
);
}
//you can have your own timeout logic and delete a pending request like this
setTimeout(function() {
var deleted = network.deletePendingRequest(ws, tag); // true if request was deleted
}, 30*1000);Get node list
Get a list of witnesses
Get transaction data
Send transaction data
Send heartbeat that you don't sleep
Subscribe to transaction data
Synchronous transaction data
Get the hash tree
Get the main chain index
Send message to client that is connected to hub
Get temporary public key
Update temporary public key
Enable notifications
Disable notifications
Get list of chat bots
Get asset metadata
Get transaction history
Get chain link proofs
Get the parent unit and the witness unit
Get specific attestation unit
Get all attestation data about address
Pick divisible inputs for amount
Get address definition
Get balances of addresses
Get profile unit IDs of addresses
Get the current state of votes for system vars
Custom Request
Last updated
Was this helpful?