npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

secretstore-contracts

v0.3.0

Published

Secret Store permissioning and service contracts collection and toolkit.

Downloads

12

Readme

Secret Store contracts and toolkit

Collection of Secret Store permissioning contracts, service contracts and related tooling.

Purpose: To have a central collection of aforementioned contracts, and have a command line tool that makes deployment/checking of these contracts easy.

Disclaimer: The contracts are not audited yet, thus they are not recommended to be relied on in a production environment.

If you wonder how to set up a Secret Store cluster, check out the official config guide and peek into our other repo.

Maintainers

Primary: Adam Nagy (@ngyam)

Quickstart and examples

If you want the command line tool to be available globally:

npm install -g secretstore-contracts

Then:

secretstore-contracts <command> [options]

If you just want to use it somewhere locally:

git clone https://github.com/energywebfoundation/secretstore-contracts.git
cd secretstore-contracts
npm install

Then:

node index.js <command> [options]

Or

npm start <command> [options]

Examples

# Deploys a fire and forget permissioning contract and returns its address
secretstore-contracts deploypermission --contract FireAndForget --docid 0xfefefefe --accounts 0x3144de21da6de18061f818836fa3db8f3d6b6989
#>> PermissionerFireAndForget deployed at: 0x05EF6cF073Ca90F9CC936F049934B27F75D7ea89

secretstore-contracts checkpermissions --address 0x05EF6cF073Ca90F9CC936F049934B27F75D7ea89 --docid 0xfefefefe --accounts 0x3144de21da6de18061f818836fa3db8f3d6b6989
#>> 0x3144de21da6de18061f818836fa3db8f3d6b6989: true

To show help and available commands/flags just type

secretstore-contracts --help
# or
secretstore-contracts <command> --help

Contracts

They can be found in the contracts folder.

  • Permissioning contract interface

  • Simple permissioning contracts

    • Static: contract with burned-in addresses and doc-key
    • FireAndForget: one shot contract to only permisison one doc key with accounts. Can be set only in the constructor.
    • NoDoc: contract that allows access to all the given addresses irrespective of the document key
    • Dynamic: registry type contract to add an arbitrary number of doc keys and accounts
  • Nodes-set contract with migration support: Taken from here and described here.

  • Registry: a proper permissining registry contract implementation with ownership/admin support

  • Relay: a permissioning relay contract for upgradeability

  • ERC165Query and interface. Contract that can query which interface other contracts implement according to ERC165.

Contributing

Please read contributing and our code of conduct for details.

Getting started (as a dev)

Prerequisites

  • node, npm, truffle

Setting up

git clone https://github.com/energywebfoundation/secretstore-contracts.git
cd secretstore-contracts
npm install -D

Running the tests

ACHTUNG: make sure to start an Ethereum node first.

Then simply:

npm run test

Compiling contracts

If you want to compile the contracts, use Truffle

truffle compile

Deployment and migration

To deploy simple contracts, use the deployer cl tool. The relay/registry contract is not supported by the tool yet. To deploy those, just simply run

truffle migrate

Versioning

We use SemVer for versioning. Version number is bumped with bumpversion tool.

License

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

Acknowledgments

  • Special thanks to Parity