Skip to main content

GetInfo

GetInfo returns general information about the state of the Pool trader daemon.

Source: poolrpc/trader.proto

gRPC

rpc GetInfo (GetInfoRequest) returns (GetInfoResponse);

REST

HTTP MethodPath
GET /v1/pool/info

Code Samples

const fs = require('fs');
const grpc = require('@grpc/grpc-js');
const protoLoader = require('@grpc/proto-loader');

const GRPC_HOST = 'localhost:12010'
const MACAROON_PATH = 'POOL_DIR/regtest/pool.macaroon'
const TLS_PATH = 'POOL_DIR/tls.cert'

const loaderOptions = {
keepCase: true,
longs: String,
enums: String,
defaults: true,
oneofs: true,
};
const packageDefinition = protoLoader.loadSync('poolrpc/trader.proto', loaderOptions);
const poolrpc = grpc.loadPackageDefinition(packageDefinition).poolrpc;
process.env.GRPC_SSL_CIPHER_SUITES = 'HIGH+ECDSA';
const tlsCert = fs.readFileSync(TLS_PATH);
const sslCreds = grpc.credentials.createSsl(tlsCert);
const macaroon = fs.readFileSync(MACAROON_PATH).toString('hex');
const macaroonCreds = grpc.credentials.createFromMetadataGenerator(function(args, callback) {
let metadata = new grpc.Metadata();
metadata.add('macaroon', macaroon);
callback(null, metadata);
});
let creds = grpc.credentials.combineChannelCredentials(sslCreds, macaroonCreds);
let client = new poolrpc.Trader(GRPC_HOST, creds);
let request = {};
client.getInfo(request, function(err, response) {
console.log(response);
});
// Console output:
// {
// "version": <string>,
// "accounts_total": <uint32>,
// "accounts_active": <uint32>,
// "accounts_active_expired": <uint32>,
// "accounts_archived": <uint32>,
// "orders_total": <uint32>,
// "orders_active": <uint32>,
// "orders_archived": <uint32>,
// "current_block_height": <uint32>,
// "batches_involved": <uint32>,
// "node_rating": <NodeRating>,
// "lsat_tokens": <uint32>,
// "subscribed_to_auctioneer": <bool>,
// "new_nodes_only": <bool>,
// "market_info": <MarketInfoEntry>,
// }

Messages

poolrpc.GetInfoRequest

Source: poolrpc/trader.proto

note

This request has no parameters.

poolrpc.GetInfoResponse

Source: poolrpc/trader.proto

FieldgRPC TypeREST Type
version
stringstring
accounts_total
uint32integer
accounts_active
uint32integer
accounts_active_expired
uint32integer
accounts_archived
uint32integer
orders_total
uint32integer
orders_active
uint32integer
orders_archived
uint32integer
current_block_height
uint32integer
batches_involved
uint32integer
node_rating
NodeRatingobject
lsat_tokens
uint32integer
subscribed_to_auctioneer
boolboolean
new_nodes_only
boolboolean
market_info
MarketInfoEntry[]object

Nested Messages

poolrpc.GetInfoResponse.MarketInfoEntry

FieldgRPC TypeREST Type
key
uint32unknown
value
MarketInfounknown

poolrpc.MarketInfo

FieldgRPC TypeREST Type
num_asks
TierValue[]array
num_bids
TierValue[]array
ask_open_interest_units
TierValue[]array
bid_open_interest_units
TierValue[]array

poolrpc.MarketInfo.TierValue

FieldgRPC TypeREST Type
tier
NodeTierunknown
value
uint32unknown

poolrpc.NodeRating

FieldgRPC TypeREST Type
node_pubkey
bytesstring
node_tier
NodeTierstring

Enums

poolrpc.NodeTier

NameNumber
TIER_DEFAULT
0
TIER_0
1
TIER_1
2