Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
d10r committed May 12, 2018
1 parent 4b93f23 commit 91379e8
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## About

This is the first PoC implementation of Streems (for a definition, read below).
This is the first PoC implementation of *Streems* (for a definition, read below).
It includes a contract, a minimal web interface and an interactive test web interface.

Note that most of this was written in mid 2017, thus targets Solidity v0.4.13.
Expand All @@ -11,12 +11,12 @@ It still compiles (last version tested: v0.4.23), but with a lot of warnings. Th
The goal of this code was to proof feasibilty of continuous transfers (a kind of on-chain value streaming).
Core logic is in ` Streem.sol` which implements a minimal [ERC20 token](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md) (to be more precise - a subset of it as it lacks implementation of `transferFrom()`, `approve()` and `allowance()`).

The contracts allow only one outgoing and one incoming Streem per account in order to keep things simple.
The contracts allow only one outgoing and one incoming streem per account in order to keep things simple.
This has the side effect of making **nested cycles** impossible to build up.
**Simple cycles** are supposed to be handled correctly by this implementation (no proof given though).

This approach was not further pursued, because I found no simple solution for how to avoid the building up of uncomputable dependency graphs.
While Streems can be chained, such chains make computing the balance at the end of such a Streem chain expensive (as it recurses through that chain) - to a point where it could exceed the block gas limit and thus become effectively uncomputable on-chain. Which would also mean that the last Streem of such a chain couldn't be closed anymore, because closing requires on-chain computation of the balance.
While streems can be chained, such chains make computing the balance at the end of such a streem chain expensive (as it recurses through that chain) - to a point where it could exceed the block gas limit and thus become effectively uncomputable on-chain. Which would also mean that the last Streem of such a chain couldn't be closed anymore, because closing requires on-chain computation of the balance.
Since I didn't find a satisfying solution to this problem, this PoC wasn't developed further, instead we switched focus the concept of **Basic Streems** (as described below).

We also decided to limit Solidity implementations to PoCs and testing purposes and started a native implementation of Basic Streems in [Parity](https://github.com/paritytech/parity).
Expand All @@ -26,19 +26,20 @@ There's no conventional tests ([like e.g. here](https://github.com/lab10-coop/Pl

## How to run

Needs [truffle](http://truffleframework.com/) ganache-cli installed: `npm install -g truffle ganache-cli`
Start dev chain: `ganache-cli`
Then, in another tab, enter the backend directory and run `./deploy.sh` which will deploy the contract to the dev testnet and update frontend bindings.
TODO: Add watcher option.
Requires nodejs installed (tested with latest LTS).

* Install [truffle](http://truffleframework.com/) and [ganache-cli](https://github.com/trufflesuite/ganache-cli): `npm install -g truffle ganache-cli`
* Start dev chain: `ganache-cli`
* In another shell, cd into the backend directory and run `./deploy.sh` which will deploy the contract to the dev testnet and update frontend bindings.

You can now interact with the contract in various ways
* using `truffle console`
* using [remix](http://remix.ethereum.org/) (connect it to the local testnet, paste the contract code and load the contract at the deployed address)
* with the web app at `streem.html`
* with the interactive test web app at `test.html`
* with the web frontend at `streem.html`
* with the test web frontend at `test.html`

In order to use the web apps, you need a webserver which can serve the static content in frontend directory.
Now you can point a browser to `streem.html` or `test.html`. In order to have the Apps connect to the locally running ganache-cli, the browser should not inject web3 (e.g. if you have Metamask installed, disabled it).
Since the web frontends are written in plain HTML and JS, no build process and not even a webserver are needed. Just open `streem.html` or `test.html` in a web browser with solid ES6 support.
In order to have the Apps connect to the locally running ganache-cli, the browser should not inject web3 (e.g. if you have Metamask installed, disabled it).

The contract can of course also be deployed to a public testnet (there's for example a [deployment on Rinkeby](https://rinkeby.etherscan.io/address/0xf73f6bd052061bb84913be57d5f7565b0aa38827)). In order to access such a contract via the web frontend, hardcode the address in the Javascript file and open it in a browser with web3 injected and connected to the respective network.

Expand Down

0 comments on commit 91379e8

Please sign in to comment.