Skip to content
This repository was archived by the owner on May 13, 2022. It is now read-only.

Latest commit

 

History

History
54 lines (36 loc) · 2.06 KB

1-join-a-token-network.md

File metadata and controls

54 lines (36 loc) · 2.06 KB
description
To be able to make token payments in Raiden you first need to join the network of the token you're interested in making payments with.

Create a Token Network

Check if the token is registered

Before you can join a token network you need to determine whether the token has been registered and a network for the token has been created.

We can verify this by making a query to the tokens endpoint.

curl -i http://localhost:5001/api/v1/tokens

If the address exists in the list returned by the response you can go ahead and open a channel in that token network.

If the address is not in the list you'll have to register the token before you can open a channel.

Register a new token

Registering a new token is as simple as calling the tokens endpoint with a PUT request while providing the address of the token you want to register as a path parameter.

curl -i -X PUT http://localhost:5001/api/v1/tokens/0x9aBa529db3FF2D8409A1da4C9eB148879b046700 \
-H 'Content-Type: application/json'

If the call is successful the response will return a new address of the now newly created token network.

HTTP:/1.1 201 CREATED
Content-Type: application/json

{
    "token_network_address": "0xC4F8393fb7971E8B299bC1b302F85BfFB3a1275a"
}

Because this token was just registered by you, no one else will be connected to its network and you'll have to open a channel with another Raiden node.

{% page-ref page="2-open-a-channel.md" %}

{% hint style="info" %} Payment channels between parties are opened in token networks. {% endhint %}

{% hint style="warning" %} Registering a new token is currently only relevant on the testnets. The tokens allowed on the mainnet for the Alderaan release are DAI and W-ETH. At some point in future, you will be able to register new token networks for the Ethereum mainnet, too. {% endhint %}