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

@daostack/ganache

v0.0.0-alpha.50-v3

Published

A fully migrated Ganache with all DAOstack base contracts migrated and an example DAO.

Downloads

9

Readme

npm (scoped) Docker Pulls

DAOstack Migration

Migration scripts and a ganache with all DAOstack contracts and an example DAO already migrated. This repo is exposed both as an npm package, a CLI and a docker container which you can use as a drop-in replacement for ganache-cli.

Commands

  1. ganache - start a local Ganache process.
  2. migrate:base - migrate base contracts.
  3. migrate:dao - migrate DAO.
  4. migrate - migrate base contracts & DAO.
  5. build:docker - build the daostack/ganache docker image.
  6. publish:docker - push the daostack/ganache image to DockerHub.

Configuration

Package config

Configration related to the migration process lives in the config section in package.json. You can override it locally using npm config set @daostack/ganache:<key> <value> Available configurable parameters:

  • mnemonic - the mnemonic used to generate accounts.
  • total_accounts - the number of accounts to generate.
  • provider - the web3 provider to be used.
  • gasPriceGWei - the gas price in GWei units to use in transactions.

Example: npm config set @daostack/ganache:provider https://kovan.infura.io/v3/<infura key> - run on kovan using infura.

params.json

Configuration related to specific contract params can be configured in params.json.

Note: This file also includes the migrationVersion which must be incremented before publishing a new version.

Versioning

Both the npm package and the docker image are versioned according to the @daostack/arc package and the migration version. Example: @daostack/arc@<arc version> -> npm: @daostack/ganache@<arcversion>-v<migration version> and dockerhub: daostack/ganache:X.Y.Z-v<migration version>

Use the docker image

  1. docker pull daostack/ganache
  2. docker run daostack/ganache ... - use arguments as specified in ganache-cli

Use as a library

  1. npm install @daostack/ganache
  2. const Ganache = require('@daostack/ganache') // instead of: require('ganache-cli') - use as a drop-in replacement for the ganache-cli library.

The library also exposes the two migration scripts migrateBase & migrateDAO:

const { migrateBase, migrateDAO } = require("@daostack/ganache");
const web3 = new Web3(...);
await migrateBase(web3); // migrates all base contracts writes addresses to 'base.json' and returns them.
await migrateDAO(web3); // migrates new DAO writes info to 'dao.json' and returns them.

base.json

To get the base migrated contract addresses:

const base = require("@daostack/ganache/base.json");
const {
  // Base contract addresses
  DAOToken,
  DaoCreator,
  UController,
  GenesisProtocol,
  SchemeRegistrar,
  UpgradeScheme,
  GlobalConstraintRegistrar,
  ContributionReward,
  AbsoluteVote,
  QuorumVote,
  SimpleICO,
  TokenCapGC,
  VestingScheme,
  VoteInOrganizationScheme,
  OrganizationRegister
} = migration;

dao.json

To get information about the migrated DAO:

const base = require("@daostack/ganache/dao.json");
const {
  orgName,            // name of the dao
  Avatar              // avatar address
  NativeToken,        // native token address
  NativeReputation    // native reputation address
} = migration;

The Migrated DAO

The migrated DAO is a simple DAO with the following configuration:

  • using UController as a controller.
  • founders - first 5 accounts generated from mnemonic each with 1000 native token and 1000 reputation.
  • no native token cap.
  • schemes:
    • SchemeRegistrar
      • permissions: all permissions (0x0000001F)
      • voting machine: AbsoluteVote(votePerc=50,ownerVote=true)
    • GlobalConstraintRegistrar
      • permissions: manage global constraints (0x00000004)
      • voting machine: AbsoluteVote(votePerc=50,ownerVote=true)
    • UpgradeScheme
      • permissions: manage schemes + upgrade controller (0x0000000A)
      • voting machine: AbsoluteVote(votePerc=50,ownerVote=true)
    • ContributionReward
      • orgNativeTokenFee: no fee.
      • permissions: no permissions (0x00000000)
      • voting machine: GenesisProtocol(<details in params.json file>)