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

@delvtech/council-cli

v0.1.0

Published

``` █▀▀ █▀█ █ █ █▄ █ █▀▀ █ █ █▀▀ █ █ █▄▄ █▄█ █▄█ █ ▀█ █▄▄ █ █▄▄ █▄▄ █▄▄ █ ```

Downloads

18

Readme

█▀▀ █▀█ █ █ █▄ █ █▀▀ █ █     █▀▀ █   █
█▄▄ █▄█ █▄█ █ ▀█ █▄▄ █ █▄▄   █▄▄ █▄▄ █

Council CLI

A CLI for interfacing with the Council protocol.

Installation

The Council CLI isn't currently available as a stand alone package but can be used directly from the root of the council-kit monorepo or installed within the council monorepo.

  1. Clone the council-kit monorepo.
  2. Add "@council/cli": "*" to the app or package's package.json.
  3. Run install: yarn.

Basic Usage

The easiest way to use the CLI is to call it from within the monorepo:

yarn workspace @council/cli council

This will show the guided walkthrough which will have you select commands and prompt for input for the options.

Council CLI intro prompt screenshot

You can also call commands directly without using the prompts.

# start a local ethereum node server on port 8545
yarn workspace @council/cli council server -p 8545

You will be prompted for input on any required options that are missing from the command.

Help

You can use the --help option to get information on commands, options, descriptions, and defaults.

yarn workspace @council/cli council --help

Council help text screenshot

This option can be used at any level of the CLI. For example, to get help on the server command:

yarn workspace @council/cli council server --help

Council server help text screenshot

Deploying a local instance

The CLI has 2 commands to quickly get a local testnet started and deploy a default version of Council.

1. Start the local server

Use the server command to start the local testnet.

yarn workspace @council/cli council server -p 8545

This will start a testnet server hosted at http://127.0.0.1:8545 and show a list of generated accounts with their private keys and ETH balance.

Council server started message screenshot

3. Deploy the contracts

Use the deploy default command to deploy a default version of the contracts.

yarn workspace @council/cli council deploy default

Council default deployment screenshot

Creating proposals

To create a new proposal in Council, you must know the address of the target contract(s) that the CoreVoting contract will call when the proposal is executed and the data to call it with. The CLI includes encode commands which can be used to generate the call data for any Council contract and a proposal command that can be used to create and execute proposals.

To understand how it all works, let's walk through an example of creating a proposal to increase the default quorum to 1.5 million. We'll assume our deployment of Council is using a timelock contract so we'll also need to register the call with the timelock.

1. Encode the function data for the proposed actions

yarn workspace @council/cli council encode core-voting set-default-quorum --power 1500000 --decimals 18

This uses the set-default-quorum command to encode function data for a CoreVoting.setDefaultQuorum call. The --power option is used to define the new default quorum and the --decimals option scales the --power value by 10 ** decimals. The resulting call data is:

0x7d5709eb000000000000000000000000000000000000000000013da329b6336471800000

2. Encode the function data to register the call in the Timelock

Since the CoreVoting contract needs to go through the timelock to make any changes to the protocol, we have to use the call data we just generated to encode data for Timelock.registerCall.

yarn workspace @council/cli council encode timelock register-call --targets <voting-contract-address> --calldatas 0x7d5709eb000000000000000000000000000000000000000000013da329b6336471800000

The --targets option is used to identify the contract we want to register a call to. The --calldatas option is used to identify the data we want the registered call to use when it calls out target. We can use the encoded data we generated previously.

Replace the <voting-contract-address> with an actual address.

This results in the following call data:

0x88b49b83dc0bdcecdf6757652124a4cf28d00de01c12935d6fd3113205e645b0abb7cf28

3. Create the proposal

yarn workspace @council/cli council proposal create --address <voting-contract-address> --vaults <space-separated-vault-addresses> --targets <timelock-address> --calldatas 0x88b49b83dc0bdcecdf6757652124a4cf28d00de01c12935d6fd3113205e645b0abb7cf28 --last-call 648000 --ballot yes --wallet-key <wallet-private-key>

You can also just use yarn workspace @council/cli council proposal create to be prompted for all required options.