1.1.0 • Published 4 years ago

secretstore v1.1.0

Weekly downloads
10
License
GPL-3.0
Repository
github
Last release
4 years ago

EnergyWeb's Secret Store JS client

npm version

Secret Store JS client, an Npm package for interacting with OpenEthereum's Secret Store rpc and session modules. Abstraction layer on top of the official secretstore RPC API and secretstore sessions. Naming conventions follow the underlying APIs'.

Maintainers

Primary: Adam Nagy (@ngyam)

Documentation

https://energywebfoundation.github.io/secretstore-js/index.html

The documentation is for this package and its functions. For more information on how Secret Store works, please refer to the OpenEthereum wiki. Most of the function descriptions have been copied from there.

Quickstart

In your project:

npm install secretstore

or

yarn add secretstore

Then

Javascript

const secretstore = require("secretstore");

// using the OpenEthereum's secretstore rpc module
// should be used on your local node for trust reasons
const sslac = new secretstore.SecretStoreRpcApiClient("http://127.0.0.1:8545");
sslac.<method>...

// using the OpenEthereum's secretstore session module
const sssc = new secretstore.SecretStoreSessionClient("http://127.0.0.1:8090");
sssc.<method>...

Typescript

import {SecretStoreRpcApiClient, SecretStoreSessionClient} from "secretstore";

// using the OpenEthereum's secretstore rpc module
// should be used on your local node for trust reasons
const sslac = new SecretStoreRpcApiClient("http://127.0.0.1:8545");
sslac.<method>...

// using the OpenEthereum's secretstore session module
const sssc = new SecretStoreSessionClient("http://127.0.0.1:8090");
sssc.<method>...

If you wonder how to set up a Secret Store cluster, check out the official config guide and peek into the nodes_ss_dev/ folder.

Note: Non-session Secret Store RPC calls work with a regular Parity client too, which is not compiled with the special secretstore feature.

Examples

Tested with

Contributing

Please read contributing and our code of conduct for details.

Getting started (as a dev)

Prerequisites

  • node, npm

Installing

git clone https://github.com/energywebfoundation/secretstore-js.git
cd secretstore-js
yarn

Running the tests

ACHTUNG: make sure to start the local secret store cluster first.

Your Secret Store enabled Parity/OpenEthereum client binary has to be placed in the root folder of the project with the name parity. It is shown in the official tutorial how to compile with Secret Store enabled. Use latest master branch preferably.

Then:

  1. start nodes
yarn start
  1. run tests
yarn test
  1. When done fiddling around:
yarn stop
  1. Optional: if you need to clean up chaindb/secretstore
yarn clear

To fill up the test accounts with some ethers, you can use the nodes_ss_dev/funclocals.sh script.

Versioning

We use SemVer for versioning.

License

This project is licensed under GPL-3.0 - see the LICENSE file for details.

Acknowledgments

  • Special thanks to Parity
1.1.0

4 years ago

1.0.0

4 years ago

0.1.0

5 years ago

0.0.3

5 years ago

0.0.2

6 years ago

0.0.1

6 years ago