Skip to main content

ChannelInsights

List currently open channel with routing and uptime information.

Example request: http://localhost:8466/v1/faraday/insights

Source: faraday.proto

gRPC

rpc ChannelInsights (ChannelInsightsRequest) returns (ChannelInsightsResponse);

REST

HTTP MethodPath
GET /v1/faraday/insights

Code Samples

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

const GRPC_HOST = 'localhost:8465'
const MACAROON_PATH = 'FARADAY_DIR/regtest/faraday.macaroon'
const TLS_PATH = 'FARADAY_DIR/tls.cert'

const loaderOptions = {
keepCase: true,
longs: String,
enums: String,
defaults: true,
oneofs: true,
};
const packageDefinition = protoLoader.loadSync('faraday.proto', loaderOptions);
const frdrpc = grpc.loadPackageDefinition(packageDefinition).frdrpc;
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 frdrpc.FaradayServer(GRPC_HOST, creds);
let request = {};
client.channelInsights(request, function(err, response) {
console.log(response);
});
// Console output:
// {
// "channel_insights": <ChannelInsight>,
// }

Messages

frdrpc.ChannelInsightsRequest

Source: faraday.proto

note

This request has no parameters.

frdrpc.ChannelInsightsResponse

Source: faraday.proto

FieldgRPC TypeREST Type
channel_insights
ChannelInsight[]array

Nested Messages

frdrpc.ChannelInsight

FieldgRPC TypeREST Type
chan_point
stringstring
monitored_seconds
uint64string
uptime_seconds
uint64string
volume_incoming_msat
int64string
volume_outgoing_msat
int64string
fees_earned_msat
int64string
confirmations
uint32integer
private
boolboolean