Skip to content
TypeScript JavaScript Solidity CSS HTML Ruby Other
Branch: master
Clone or download
Latest commit e650171 Feb 15, 2020
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci app-wallet-interface: Build and deploy Netlify site from circleci Feb 12, 2020
.github Update .github/ISSUE_TEMPLATE/need-help.md Feb 4, 2020
.vscode Add launch.json config for debugging xstate-wallet Feb 10, 2020
bin Faster circle (#81) Sep 28, 2019
packages Fix other test Feb 14, 2020
patches Downgrade solc and do not use native solc in CI Feb 12, 2020
.dockerignore [heroku] Configuration for the hub to run on Heroku (#812) Jan 9, 2020
.eslintignore Init commit for channel-client Dec 9, 2019
.eslintrc.js Fix eslint changes Feb 13, 2020
.gitattributes
.gitignore Update gitignore Jan 10, 2020
.nvmrc Fix node version to 10.16.3 Sep 23, 2019
.prettierrc.js added eventemitter to rps Nov 7, 2019
.yarnclean Use .yarnclean hack Jan 15, 2020
.yarnrc Set registry to npmjs Nov 6, 2019
.yvmrc
CODE_OF_CONDUCT.md added initial scaffolding for the monorepo Sep 20, 2019
Dockerfile.hub.staging
LICENSE
lerna.json Set concurrency: 4 in lerna.json Feb 3, 2020
logo.svg Swap out logo Jan 23, 2020
netlify-ignore.sh Update netlify-ignore.sh for wallet Dec 18, 2019
netlify.toml Netlify ignore script scoped to deploy previews Nov 13, 2019
package.json
readme.md Update readme with wallet-protocols and xstate-wallet Feb 7, 2020
tsconfig.json Consolidate tsconfig.json of every package Dec 5, 2019
yarn.lock Add ajv as a dependency Feb 13, 2020

readme.md


State Channels

Simple off-chain applications framework for Ethereum.

circleci license


statechannels is a simple off-chain framework for building state channel applications on top of the Ethereum blockchain. It aims to make it simpler to build permissionless applications that have instant finality with zero-fee transactions.

You can learn more about what state channels are by reading one or other of the whitepapers underpinning the project, or a less technical written description.

Packages

This repository is a monorepo, and contains the following packages maintained with lerna and yarn workspaces:

Contributing

Installing dependencies

Make sure you have Yarn v1.17.3 installed. For easy management of specific Yarn versions, we recommend using Yarn Version Manager (YVM).

To install the dependencies:

yarn

from the monorepo root.

Building packages

To build all packages:

yarn build

Clean

To clean all packages:

yarn clean

Lint

To lint all packages:

yarn lint:check

To also apply automatic fixes:

yarn lint:fix

Tests

To run all tests:

yarn test

Development Flow

The rps, nitro-protocol, wallet, and hub packages will need to interact with a local blockchain when running and testing locally.

Running locally

When running locally, it's often important to have the packages pointing to the same contracts on the same local blockchain.

When started via yarn start the rps, wallet, and hub packages will:

  1. Check for a "shared ganache" instance running at the SHARED_GANACHE_PORT, as defined in their .env file. (This is currently set the same for all packages.) This shared ganache instance can be started by running yarn start:shared-ganache from any of the packages.
  2. If the shared ganache instance is found, they will deploy contracts to this instance, and make the addresses available in the application via process.ENV. Details of the deployed contract will also be stored in the monorepo/ganache-deployments.json file, so that if another project attempts to deploy another contract with the same args and bytecode, the address of the existing contract will be returned instead.
  3. If no shared ganache instance is found, the package will start their own ganache instance, which won't be shared with any other package.

TL;DR: to share deployed contracts between packages in development, you must start a shared ganache server with yarn start:shared-ganache.

Community

State Channels Forums: https://research.statechannels.org/

You can’t perform that action at this time.