Tools and instructions for the Raiden workshop at devcon4
Branch: master
Clone or download
loredanacirstea Merge pull request #3 from loredanacirstea/openapi
Add OpenApi yaml spec for Raiden API
Latest commit 235af9b Dec 7, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
game Remove unused files Nov 5, 2018
tools Add OpenApi yaml spec for Raiden API Dec 7, 2018
.gitignore Add gitignore Nov 1, 2018
Devcon4_Raiden_Workshop_slides.pdf adding slides Nov 5, 2018
README.md fix typo Dec 7, 2018

README.md

ETHSingapore Hackathon Raiden Network guide

This is the repo for the Raiden Network at the ETHSingapore hackathon. Below you'll find a list of links and information needed to get going with Raiden for the hackathon.

Prerequisites:

  • Access to an Ethereum Kovan RPC endpoint
  • A Kovan account and KETH. We've created a small tool that generates an account and sends KETH and tokens to it with just one simple command. Please see the onboarding section below for instructions.
  • The Raiden client itself. Please see the getting Raiden section below.
    • If you're on Windows we recommend that you install Raiden for Windows Subsystem for Linux (WSL)
  • We have created a gitter room that you can use for asking questions or find out where you can find us if you need help or want to discuss something face-to-face.

On-boarding:

We've created a simple script that generates a keystore / address and sends Kovan ETH and ETHSingaporeTokens to the generated address. Follow these simple steps:

macOS instructions

curl -O https://raiden-nightlies.ams3.digitaloceanspaces.com/onboarder-macOS.zip
  • Unzip the file:
unzip onboarder-macOS.zip
  • And run it:
./onboarder

Linux instructions

curl -O https://raiden-nightlies.ams3.digitaloceanspaces.com/onboarder-linux.tar.gz
  • Extract the file:
tar -xvzf onboarder-linux.tar.gz
  • And run it:
./onboarder

Getting Raiden

The fastest way to get up and running is to use the latest nightly binary releases. Just follow the instructions below.

macOS instructions

curl -O https://raiden-nightlies.ams3.digitaloceanspaces.com/raiden-nightly-2018-12-06T18-08-23-v0.18.1.dev57%2Bg786347b2-macOS.zip
  • Unzip the file:
unzip raiden-nightly-2018-12-06T18-08-23-v0.18.1.dev57%2Bg786347b2-macOS.zip

Linux instructions

curl -O https://raiden-nightlies.ams3.digitaloceanspaces.com/raiden-nightly-2018-12-06T17-58-34-v0.18.1.dev57%2Bg786347b2-linux.tar.gz
  • Extract the file:
tar xvzf raiden-nightly-2018-12-06T17-58-34-v0.18.1.dev57%2Bg786347b2-linux.tar.gz

Running Raiden:

Once Raiden is installed it's time to fire it up. This is done with the following command (Please make sure the replace raiden-binary with the actual binary you just created above):

./raiden-binary \
    --keystore-path keystore \
    --network-id kovan \
    --environment-type development \
    --eth-rpc-endpoint https://kovan.infura.io/v3/YOUR_INFURA_TOKEN

The node will ask you to accept the disclaimer and then ask you to choose which address you want to use. The list should only contain the one address the onboarder tool generated for you.

It will take a bit of time for the node to finish launching. You'll see that it's ready once you see the message stating that the Rest-API has been started.

You can now access the WebUI at http://localhost:5001/.

Tell the rest

You should now have running Raiden node. From here you can join the ETHSingaporeTokens network. We recommend posting your address in the gitter channel if you want to try it out with someone else hacking on Raiden. You can also check out how the network is growing by checking out the Raiden Explorer for the ETHSingaporeToken.

API commands:

Open channels

The first thing to do when Raiden is up and running is to open a channel with someone. You can do so by opening a channel with the node below, or to find another hacker building on Raiden and open a channel with him. For this you just have to replace the partner_address below with his/her address.

curl -i -X PUT http://localhost:5001/api/1/channels \
    -H 'Content-Type: application/json' --data-raw \
    '{"partner_address": "0x0bae0289AAA26845224F528F9B9DefE69e01606E", \
    "token_address": "0x98a345f06e3A5DFe28EE0af38dd0780b4C0ed73B", \
    "total_deposit": 10000000000000000000}'

Deposit

If you ever need to top up a channel, you can use the following command:

curl -i -X PATCH http://localhost:5001/api/1/channels/ \
0x98a345f06e3A5DFe28EE0af38dd0780b4C0ed73B/ADDRESS_OF_PARTNER \
-H 'Content-Type: application/json' \
--data-raw '{"total_deposit": 15000000000000000000}'

Make payments

To make payments, choose the address of the partner you've opened a channel with and do the following:

curl -i -X POST http://localhost:5001/api/1/payments/ \
0x98a345f06e3A5DFe28EE0af38dd0780b4C0ed73B/ADDRESS_OF_RECEIVER \
-H 'Content-Type: application/json' --data-raw '{"amount": 100000}'

Feel free to change the amounts of the payments.

Other resources