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

@kosu/genesis-cli

v1.2.0

Published

Simple CLI for snap-shotting Kosu contract system to generate a Kosu network genesis file.

Downloads

1

Readme

Tool: gen-kosu

This package contains the source code for the binary gen-kosu, a CLI utility for generating a Kosu network genesis file generating a snapshot of the Kosu contract system state at a specific block height.

The package also exports all functions used to generate the genesis file for public audit and usage in other scripts.

Before being used for main-net or public test network's by validators, the tests and source should be independently verified for logical correctness.

Documentation

Documentation is hosted on docs.kosu.io and can also be found in the docs folder.

There is additional documentation within certain methods, and all potential validators are encouraged to read the snapshot logic and independently verify the programs correctness.

CLI

The primary entry-point for most users will be the gen-kosu binary, used to generate Kosu network genesis files.

For public networks, the genesis parameters must be established prior to usage of this script.

Install

Install the gen-kosu CLI with Yarn or NPM.

# with yarn
yarn global add @kosu/genesis-cli

# with npm
npm i -g @kosu/genesis-cli

Usage

The below is the output of gen-kosu --help.

Usage: gen-kosu [options]

Simple CLI for snap-shotting Kosu contract system to generate a Kosu network genesis file.

Be sure to view the documentation (docs.kosu.io) for more information and usage instructions.

The generated genesis JSON is printed directly to stdout if the program exits successfully.

The following options are required:
    -n, --chain-id <name>
    -p, --provider-url <url>
    -b, --snapshot-block <number>
    -t, --start-time <number>

Options:
  -V, --version                         output the version number
  -n, --chain-id <name>                 Specify the resulting Kosu chain ID
  -p, --provider-url <url>              HTTP Ethereum JSONRPC provider
  -b, --snapshot-block <number>         The block height at which to snapshot Kosu contract system state
  -t, --start-time <number>             Unix timestamp (in seconds) of network start
  -f, --finality-threshold <number>     Minimum age of Ethereum blocks before submitting attestations (default: "10")
  -l, --period-limit <number>           Maximum number of order messages to accept per rebalance period (default: "100000")
  -L, --period-length <number>          The length of each rebalance period (in Ethereum blocks) (default: "5")
  -m, --max-order-bytes <number>        The maximum size of a single order transaction (default: "4096")
  -B, --blocks-before-pruning <number>  Maximum age of attestations before pruning (default: "50")
  -o, --orders-limit <number>           The maximum number of orders to keep in state at time (default: "100")
  -h, --help                            output usage information

Develop

The exported functions within this package are intended to be useful outside the context of the CLI, and can be used in other scripts that need to snapshot contract system state.

All primary logic for generating the snapshot and genesis JSON is found in functions.ts.

Install dependencies

Install NPM dependencies

Build

Build the output files (to lib/) with yarn build (or npm run build).

Test

Run unit tests with yarn test (start the local CLI with yarn gen-kosu [options]).