Counterfactual 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 our whitepaper or a less technical written description. Further, if you want to dive into the specifications of the Counterfactual protocol you can read them here.
@counterfactual/cf-funding-protocol-contractsContracts implementation of the Counterfactual funding protocol
@counterfactual/cf-adjudicator-contractsContracts implementation of an AppInstance Adjudicator
Counterfactual-specific packagesPackage Version Description
@counterfactual/nodeThe core state channels client that a user runs
@counterfactual/cf.jsA JS API for interacting with off-chain apps
@counterfactual/node-providerWrapper around API calls to a Node
UtilitiesPackage Version Description
@counterfactual/typesShared type declarations
@counterfactual/typescript-typingsShims for external library typings
The Playground currently only supports the Kovan network.
Make sure you have Yarn v1.19.0 installed. For easy management of specific Yarn versions, we recommend using Yarn Version Manager (YVM).
To install the dependencies:
It is recommended (optional) that you installed
solc compiler binary on your machine (installation guide) and specify the following in your
To build all packages:
To clean all packages:
To lint all packages:
To also apply automatic fixes:
To run all tests:
To run E2E tests:
NODE_EXTENDED_PRIVATE_KEY="..." yarn test:e2e
See the "Funding the Hub Account for Playground Testing" section on the Simple Hub Server package for more information about
Copy the snippet above into CLI.