Skip to main content

GetVersion

GetVersion returns the current version and build information of the running daemon.

Source: verrpc/verrpc.proto

gRPC

rpc GetVersion (VersionRequest) returns (Version);

REST

HTTP MethodPath
GET /v2/versioner/version

Code Samples

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

const GRPC_HOST = 'localhost:10009'
const MACAROON_PATH = 'LND_DIR/data/chain/bitcoin/regtest/admin.macaroon'
const TLS_PATH = 'LND_DIR/tls.cert'

const loaderOptions = {
keepCase: true,
longs: String,
enums: String,
defaults: true,
oneofs: true,
};
const packageDefinition = protoLoader.loadSync(['lightning.proto', 'verrpc/verrpc.proto'], loaderOptions);
const verrpc = grpc.loadPackageDefinition(packageDefinition).verrpc;
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 verrpc.Versioner(GRPC_HOST, creds);
let request = {};
client.getVersion(request, function(err, response) {
console.log(response);
});
// Console output:
// {
// "commit": <string>,
// "commit_hash": <string>,
// "version": <string>,
// "app_major": <uint32>,
// "app_minor": <uint32>,
// "app_patch": <uint32>,
// "app_pre_release": <string>,
// "build_tags": <string>,
// "go_version": <string>,
// }

Messages

verrpc.VersionRequest

Source: verrpc/verrpc.proto

note

This request has no parameters.

verrpc.Version

Source: verrpc/verrpc.proto

FieldgRPC TypeREST Type
commit
stringstring
commit_hash
stringstring
version
stringstring
app_major
uint32integer
app_minor
uint32integer
app_patch
uint32integer
app_pre_release
stringstring
build_tags
string[]array
go_version
stringstring