Setup Cryptocurrency API

If you have created your own cryptocurrency and if your coin is ready, it’s time to set up the API.

Command to Setup Cryptocurrency API using Node.js and Bitcoin Core

Command to Setup Directories

mkdir webwallet

cd webwallet

npm init

Command To Install Bitcoin Core Package of Node Js

npm install bitcoin-core

Code to invoke API Calls


const Client = require('bitcoin-core');

const wallet1 = new Client({
	host: '',
	port: '6332',
	password: 'yourpassword'

wallet1.command('getbalance').then((responses) => console.log(responses));	

wallet1.command('getnewaddress').then((responses) => console.log(responses));	
wallet1.sendToAddress('NRGte5USJJZt2ErUwoteuEsQRvCq9T3jJR', 0.1,  'Any Text', 'Any Text');

About The Author