A promise-based node.js library for communicating with PUFFScoin daemon.
npm install --save puffscoin-rpc-promise
Start puffscoin daemon with rpc support:
./gpuffs --rpc
Connect to daemon endpoint and send rpc commands:
const PuffscoinRpc = require('puffscoin-rpc-promise');
let puffs = new PuffscoinRpc('http://localhost:11363');
// call named wrappers
puffs.web3_sha3('0x12345678').then(result) => {
console.log(result);
});
// or call raw commands
puffs.call('web3_sha3', '0x12345678').then(result) => {
console.log(result);
});