dshackle cli tool

This commit is contained in:
Maxksim Fomenkov
2022-09-06 14:47:05 +03:00
parent c85a294f46
commit 10bccb6852
8 changed files with 2277 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
const grpc = require("@grpc/grpc-js");
const path = require('path')
const protoLoader = require("@grpc/proto-loader");
const PROTO_PATH = path.join(__dirname, "../proto/blockchain.proto");
const options = {
keepCase: true,
longs: String,
enums: String,
defaults: true,
oneofs: true,
};
const packageDefinition = protoLoader.loadSync(PROTO_PATH, options);
const emerald = grpc.loadPackageDefinition(packageDefinition).emerald
export function describe(url, handler) {
const client = new emerald.Blockchain(
url,
grpc.credentials.createInsecure()
);
console.log('Connecting to: ' + url + '...')
client.Describe({}, handler);
}