Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wiwichips/dcp-echoes
Simple wrapper for dcp-client which makes it easier to require. (Note: it will forcibly spawn a process briefly)
https://github.com/wiwichips/dcp-echoes
Last synced: 2 days ago
JSON representation
Simple wrapper for dcp-client which makes it easier to require. (Note: it will forcibly spawn a process briefly)
- Host: GitHub
- URL: https://github.com/wiwichips/dcp-echoes
- Owner: wiwichips
- Created: 2024-02-18T13:15:43.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-02-18T16:50:21.000Z (9 months ago)
- Last Synced: 2024-10-17T18:43:26.667Z (20 days ago)
- Language: JavaScript
- Size: 28.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# dcp-echoes
A simple wrapper for the [dcp-client](https://www.npmjs.com/package/dcp-client) DCP SDK intended to make it easier to use in NodeJS.
## Usage
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:
```js
const { wallet, compute } = require('dcp-echoes');
const protocol = require('dcp-echoes').protocol;
const job = require('dcp-echoes').job;
```## Note
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.```js
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.
```js
const dcp1 = require('dcp-client').initSync();
const dcp2 = require('dcp-echoes'); // works fine (:
```# Disclaimer
This code is not endorsed or supported by Distributive. I did this for my own use. Use at your own risk.