# demo-utils

> Utilities for a distributed country on Ethereum

Latest version **0.5.3** (published 2020-04-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install demo-utils
pnpm add demo-utils
yarn add demo-utils
bun add demo-utils
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.5.3 |
| Published | 2020-04-14 |
| First published | 2019-04-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 24 KB |
| Known vulnerabilities | 0 (+3 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 43 |
| Author | Paul Pham |
| Maintainers | cryptogoth |
| Keywords | ethereum, javascript, framework |

## Links

- npm: https://www.npmjs.com/package/demo-utils
- Repository: https://github.com/invisible-college/democracy
- Homepage: https://github.com/invisible-college/democracy#readme
- Issues: https://github.com/invisible-college/democracy/issues
- npm.io page: https://npm.io/package/demo-utils

## Dependencies (5)

- [ethjs](https://npm.io/package/ethjs.md) 0.4.0
- [colors](https://npm.io/package/colors.md) 1.3.3
- [dotenv](https://npm.io/package/dotenv.md) 7.0.0
- [immutable](https://npm.io/package/immutable.md) 4.0.0-rc.12
- [ethereumjs-util](https://npm.io/package/ethereumjs-util.md) 6.1.0

## Alternatives

- [@sveltejs/kit](https://npm.io/package/@sveltejs/kit.md) — 2.2M weekly downloads
- [@tangle-network/brand](https://npm.io/package/@tangle-network/brand.md) — 10.0K weekly downloads
- [seneca](https://npm.io/package/seneca.md) — 7.4K weekly downloads
- [@bsb/base](https://npm.io/package/@bsb/base.md) — 7.2K weekly downloads
- [@modern-js/plugin-swc](https://npm.io/package/@modern-js/plugin-swc.md) — 3.4K weekly downloads

## Recent versions

- 0.5.3 (latest) — 2020-04-14
- 0.5.1-alpha.0 — 2020-01-11
- 0.5.0 — 2020-01-11
- 0.4.9 — 2019-12-14
- 0.4.7-alpha.0 — 2019-11-18
- 0.4.2-alpha.1 — 2019-10-23
- 0.4.2-alpha.0 — 2019-10-23
- 0.4.1 — 2019-10-23
- 0.4.0 — 2019-10-21
- 0.3.7 — 2019-09-27
- 0.3.7-alpha.0 — 2019-09-19
- 0.3.5-alpha.4 — 2019-09-08
- 0.3.5-alpha.3 — 2019-09-08
- 0.3.5-alpha.2 — 2019-09-08
- 0.3.5-alpha.1 — 2019-09-08
- … 24 more at https://npm.io/package/demo-utils/versions

## README

<img src="./images/logo-purple.svg" width="25px" alt="Democracy.js Purple Pipe Logo"  align="right">
<img src="./images/logo-blue.svg" width="25px" alt="Democracy.js Blue Pipe Logo"  align="right">
<img src="./images/logo-gold.svg" width="25px" alt="Democracy.js Gold Pipe Logo" align="right">

democracy
=========

Minimalist tools for coordinating decentralized and private computation, currently on Ethereum.

Our first major integration is with the AZTEC Protocol, to enable trading of zero-knowledge assets.

[![npm version](https://badge.fury.io/js/democracy.js.svg)](https://badge.fury.io/js/democracy.js)
[![CircleCI](https://circleci.com/gh/invisible-college/democracy.svg?style=svg)](https://circleci.com/gh/invisible-college/democracy)
[![Gitter](https://badges.gitter.im/invisible-college/democracy.svg)](https://gitter.im/invisible-college/democracy?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)

[API Documentation](https://democracy.js.org/jsdocs/index.html)

You can include the top-level npm package `democracy.js` or just include the sub-packages you need.


## Install with npm

```
npm i democracy.js
```

Then in your modules

```
const demo = require('democracy.js')
```

## Get the Source Code to Experiment and Run Tests

You can perform all the following commands at a Unix terminal or in a [VS Code]() terminal.

Clone our git repo locally
```
git clone https://github.com/invisible-college/democracy
```

You'll need Node.js v11 or later and the Yarn package manager. Democracy.js is developed with `v11.14.0`.
We recommend using the [Node Version Manager](https://github.com/nvm-sh/nvm#installation), which you can install for any Unix shell (including Mac OSX). `bash` is used in the example below, you can pipe the command and use the shell profile file for your
favorite shell.

```
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.1/install.sh | bash
. ~/.nvm/nvm.sh
nvm install v11.14.0
curl -o- -L https://yarnpkg.com/install.sh | bash
```

Here the `yarn` script updated the path in your shell config file, probably `~/.bashrc`, with a line like
```
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
```

You can source it, or log out and log in again, and then find `yarn` in your path.
```
. ~/.bashrc
yarn global add lerna
```

Also add `postcss` if you plan to build any of the React app projects.
```
yarn global add postcss
```

We manage a monorepo of multiple packages with `lerna`.
You can build and test them all at once.
```
cd democracy
lerna bootstrap
lerna run init
lerna run test
```

# Where Are We Going?

Curious about what a future democracy holds? Us too!

Check out our current [RoadMap](./docs/RoadMap.md)

## REPL

To experiment with and administer Ethereum contracts, it's useful to have a central
console able to attach to any JSONRPC endpoint, whether it's on the mainnet or one
of the public testnets (Ropsten, Kovan, Rinkeby).

An example session looks like
```
NODE_ENV=TEST node
> demo = require('demo.js')
> eth = demo.getNetwork()       # you'll hit our public node at http://ganache.arcology.nyc
> eth.accounts().then((val) => accounts = vals)
                                # anything you would normally do (asyncly) with an Eth
```

If you cloned the repo above, you can get started with our test contracts.
As with any JS module, when you import, you are shown a vast menu of delicious options to call.
Unlike with most JS modules, when you call a Democracy function with you arguments,
it tells you what it expects.

The four steps of Ethereum development operate on an automatic contract (sometimes called a `smart contract` by the exuberant)
* compiling (from a high-level language like Solidity to EVM bytecode)
* linking (connecting multiple contracts together, like using a library, and in our case, attaching a deploy account)
* deploy (send a contract to a blockchain, where it will now live and act trustlessly according to its programming)
* operate (send and receive messages from your contract, especially from a web page or app)

The first three tasks we'll show you how to do below by interacting with Democracy in a console.
However, Democracy's real power comes in automating complicated builds and deploys, and then operating on it.

We'll add a blow-by-blow console below when our dust has settled from above.

## Other Links

[Democracy Subpackages](Subpackages.md)

## How to Contribute

Democracy is a framework for learning about distributed systems and community protocols,
as well as a gateway for our upcoming distributed country. Welcome,
especially if you are a beginner to Ethereum or programming.

Here are ways you can participate
* Download the source code, send us suggestions, improvements, tests, documentations, via pull requests
* Use us in your next Ethereum (or eventually, Secure Scuttlebutt) project!
  * The best way to decide what you want in a framework is to try building with it
* Meet and chat with us on [Gitter](https://gitter.im/invisible-college/democracy).

We are a project of the [Invisible College](http://invisible.college).

---
_Source: https://npm.io/package/demo-utils · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
