Home

Awesome

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:

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 onboarder-macOS.zip
./onboarder

Linux instructions

curl -O https://raiden-nightlies.ams3.digitaloceanspaces.com/onboarder-linux.tar.gz
tar -xvzf onboarder-linux.tar.gz
./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 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
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 \
    --gas-price fast \
    --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/v1/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/v1/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/v1/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