LEGACY MONOREPO: this monorepo contains packages that are no longer being actively supported by the state channels project. They are provided here for reference.
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.
This repository is a monorepo, and contains the following packages maintained with lerna and yarn workspaces:
- channel-client : A JavaScript object interface for the state channels client API
- iframe-channel-provider : Thin wrapper around PostMessage communication between an App and a Wallet
- client-api-schema : JSON-RPC based schema definitions for the Client API with TypeScript typings
- xstate-wallet : A browser wallet implementation
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.
To build all packages:
yarn build
To clean all packages:
yarn clean
To lint all packages:
yarn lint:check
To also apply automatic fixes:
yarn lint:write
To run all tests:
yarn test
We follow the convention at https://github.com/conventional-changelog/commitlint/tree/master/%40commitlint/config-conventional. Your commits will be linted against this convention. You can do this yourself locally by running
yarn commitlint --from=HEAD~1 --verbose
For help authoring commits, you can check out https://commitizen.github.io/cz-cli/.
To publish you will need to trigger a github action:
- Select the actions tab
- Select whether you want to do a regular publish (
Publish Packages
) or a pre-release (Publish Packages (canary)
) - Click on
Run workflow
- Select the branch (regular publishes will fail unless on master)
- For regular publishes, a PR will be created to get the updated version and changelog info back into master. You should merge this immediately!
Sometimes things will go wrong on CI and the git tags will be created but the package will not be published. To fix this you can do the following locally:
# fetch down any publish tags
git fetch --tags
# push packages to the registries, without creating new releases
npx lerna publish from-package
You might need a npm login --registry https://testnet.thegraph.com/npm-registry/
if you don't
already have an access token in your .npmrc
.
These should adhere to the TSDoc standard. You can try the TSDoc playground.
Doc comments will appear in our documentation at https://docs.statechannels.org.
State Channels Forums: https://research.statechannels.org/