A simple wrapper for the dcp-client DCP SDK intended to make it easier to use in NodeJS.
Require dcp-client as many times as you want just like any other npm package!
dcp-echoes
uses dcp-client
as a peer dependency, in simple configurations, it will use the dcp-client
specified in your project's package.json
. This may cause problems with more complex project dependencies.
Install dcp-client
and dcp-echoes
:
npm i dcp-client
npm i dcp-echoes
Require dcp-echoes
as many times as you please:
const { wallet, compute } = require('dcp-echoes');
const protocol = require('dcp-echoes').protocol;
const job = require('dcp-echoes').job;
Be warned, dcp-echoes invokes the initialization function for dcp-client. This means your code will break if you attempt to re-initialize dcp-client.
const wallet = require('dcp-echos').wallet;
const compute = require('dcp-echos').compute;
const dcp = require('dcp-client').initSync(); // THROWS AN ERROR ):
However, you are free to require dcp-echos after you have invoked dcp-client's initialization function.
const dcp1 = require('dcp-client').initSync();
const dcp2 = require('dcp-echoes'); // works fine (:
This code is not endorsed or supported by Distributive. I did this for my own use. Use at your own risk.