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

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

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');
Facebook Comments
(Visited 45 times, 1 visits today)

Leave A Comment

Your email address will not be published. Required fields are marked *