-
Notifications
You must be signed in to change notification settings - Fork 29
SDK
Davide Miceli edited this page Jan 29, 2019
·
2 revisions
To handle a chainode peer, there is also the javascript SDK.
Follow the example:
'use strict';
// Require chainode package
const Chainode = require('chainode');
// Run peer
const runPeer = async () => {
try {
// Configurations
const configs = {...};
// Init the peer
const agent = new Chainode(configs);
await agent.start();
return agent;
} catch(err) {
console.error(err.message);
}
}
// Start peer
runPeer()
.then(peer => {
// Do something with peer...
})
.catch(console.error);