dTok Dai Card
dTok is a decentralized pay-as-you-go live streaming platform
This dTok stream viewing dApp inspired by SpankCard (based on Dai Card) and Austin Griffith's burner wallet, dTok is hosted in the browser, which utilizes Connext's Indra payment channels. More information at DTok.
For Dai Card-specific documentation please see the Dai Card repo.
See it live at: https://dtok.stake.capital
- Node 9+
- Make sure you have indra running locally. Check out the instructions in the indra repo.
Ensure that you have the following installed:
make: (probably already installed) Install w
brew install makeor
apt install makeor similar.
jq: (probably not installed yet) Install w
brew install jqor
apt install jqor similar.
git clone https://github.com/ConnextProject/indra.git cd indra npm start
From the card's project root (e.g.
git clone https://github.com/ConnextProject/card.git && cd card), run one of the following:
Using a containerized webpack dev server (recommended):
Using a local webpack dev server:
npm install npm start
The above step will take a while to completely finish because the webpack dev server takes a long time to wake up. Monitor it with:
bash ops/logs.sh server
- Check it out
- If you started with
npm start, browse to
- If you started with
make start, browse to
- NOTE: If you started the card with
makeand you can view the Indra dashboard here:
- (for Rinkeby development) If you would like to use Indra on Rinkeby, ensure that
Rinkebyis selected from the settings dialog (located in the upper right corner of the application). This will use the already-deployed Rinkeby Indra hub.
All multi-streams data is handled via the
To compile the contract with Truffle, simply run (first, ensure that you have Truffle installed via
npm install -g truffle):
To deploy the contract locally, you can run Ganache using:
ganache-cli (if Ganache isn't installed yet, simply run:
npm install -g ganache-cli). Run ganache-cli on network 4447:
ganache-cli -i 4447
Once Ganache is running, migrate the contracts using:
To run the tests during local development, start the test watcher with:
npm run start-test
This will start an ongoing e2e tester that will re-run any time the tests are changed. Works well with webpack dev server but you'll have to manually re-trigger the tests after changing the card's source code.
You can also run the more heavy-duty e2e tests that will be run as part of CI integration with:
npm run test
To maximise the ease of onboarding new users, prefunded dai-card wallets can be used to generated and then shared. For example, if the prefunded wallet's mnemonic is the follow:
toilet civil kite grass little slogan critic whale guilt risk banner quarter
Then the following URL can be shared for a user to access the pre-funded wallet:
Currently, these pre-funded wallets must be generated manually. (We plan to include a script for generating them programmatically in the future).