Get Started with cardanocli-js
cardanocli-js wraps the cardano-cli in JavaScript and makes it possible to interact with the cli-commands much faster and more efficient.
#
Prerequisitescardano-node >= 1.26.1
node.js >= 12.19.0
#
Install#
NPMnpm install cardanocli-js
#
From sourcegit clone https://github.com/Berry-Pool/cardanocli-js.gitcd cardanocli-jsnpm install
#
Get startedconst CardanocliJs = require("cardanocli-js");const shelleyGenesisPath = "/home/ada/mainnet-shelley-genesis.json";
const cardanocliJs = new CardanocliJs({ shelleyGenesisPath });
const createWallet = (account) => { cardanocliJs.addressKeyGen(account); cardanocliJs.stakeAddressKeyGen(account); cardanocliJs.stakeAddressBuild(account); cardanocliJs.addressBuild(account); return cardanocliJs.wallet(account);};
const createPool = (name) => { cardanocliJs.nodeKeyGenKES(name); cardanocliJs.nodeKeyGen(name); cardanocliJs.nodeIssueOpCert(name); cardanocliJs.nodeKeyGenVRF(name); return cardanocliJs.pool(name);};
const wallet = createWallet("Ada");const pool = createPool("Berry");
console.log(wallet.paymentAddr);console.log(pool.vrf.vkey);
Visit cardanocli-js to see the complete API documentation.