├── .gitignore ├── tools ├── onboarder │ ├── hooks │ │ └── hook-eth_hash.py │ ├── setup.py │ ├── onboarder.spec │ └── onboarder.py ├── onboarding-server │ ├── requirements.txt │ ├── Dockerfile │ ├── traefik.conf │ ├── docker-compose.yml │ └── onboarding_server.py └── raiden_open_api.yaml ├── game ├── assets │ ├── cat.png │ ├── sky.png │ ├── bomb.png │ ├── carlos.png │ ├── deva.png │ ├── doge.png │ ├── dude.png │ ├── flag.png │ ├── heart.png │ ├── heart1.png │ ├── heart2.png │ ├── heiko.png │ ├── star.png │ ├── platform.png │ ├── unicorn.png │ └── vitalik.png └── game.html ├── Devcon4_Raiden_Workshop_slides.pdf └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | .env 2 | -------------------------------------------------------------------------------- /tools/onboarder/hooks/hook-eth_hash.py: -------------------------------------------------------------------------------- 1 | hiddenimports = ['eth_hash.backends.pycryptodome'] 2 | -------------------------------------------------------------------------------- /game/assets/cat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raiden-network/workshop/HEAD/game/assets/cat.png -------------------------------------------------------------------------------- /game/assets/sky.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raiden-network/workshop/HEAD/game/assets/sky.png -------------------------------------------------------------------------------- /game/assets/bomb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raiden-network/workshop/HEAD/game/assets/bomb.png -------------------------------------------------------------------------------- /game/assets/carlos.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raiden-network/workshop/HEAD/game/assets/carlos.png -------------------------------------------------------------------------------- /game/assets/deva.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raiden-network/workshop/HEAD/game/assets/deva.png -------------------------------------------------------------------------------- /game/assets/doge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raiden-network/workshop/HEAD/game/assets/doge.png -------------------------------------------------------------------------------- /game/assets/dude.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raiden-network/workshop/HEAD/game/assets/dude.png -------------------------------------------------------------------------------- /game/assets/flag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raiden-network/workshop/HEAD/game/assets/flag.png -------------------------------------------------------------------------------- /game/assets/heart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raiden-network/workshop/HEAD/game/assets/heart.png -------------------------------------------------------------------------------- /game/assets/heart1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raiden-network/workshop/HEAD/game/assets/heart1.png -------------------------------------------------------------------------------- /game/assets/heart2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raiden-network/workshop/HEAD/game/assets/heart2.png -------------------------------------------------------------------------------- /game/assets/heiko.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raiden-network/workshop/HEAD/game/assets/heiko.png -------------------------------------------------------------------------------- /game/assets/star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raiden-network/workshop/HEAD/game/assets/star.png -------------------------------------------------------------------------------- /game/assets/platform.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raiden-network/workshop/HEAD/game/assets/platform.png -------------------------------------------------------------------------------- /game/assets/unicorn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raiden-network/workshop/HEAD/game/assets/unicorn.png -------------------------------------------------------------------------------- /game/assets/vitalik.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raiden-network/workshop/HEAD/game/assets/vitalik.png -------------------------------------------------------------------------------- /Devcon4_Raiden_Workshop_slides.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raiden-network/workshop/HEAD/Devcon4_Raiden_Workshop_slides.pdf -------------------------------------------------------------------------------- /tools/onboarding-server/requirements.txt: -------------------------------------------------------------------------------- 1 | click==6.7 2 | structlog==18.2.0 3 | eth-utils==1.2.1 4 | Flask==1.0.2 5 | gunicorn==19.9.0 6 | raiden>=0.15.0 7 | redis==2.10.6 8 | web3==4.7.1 9 | -------------------------------------------------------------------------------- /tools/onboarding-server/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.6 2 | LABEL maintainer="Ulrich Petri " 3 | 4 | ADD requirements.txt /requirements.txt 5 | RUN pip install -r /requirements.txt 6 | 7 | ADD onboarding_server.py /onboarding_server.py 8 | 9 | ENTRYPOINT ["python3", "/onboarding_server.py"] 10 | -------------------------------------------------------------------------------- /tools/onboarder/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | 3 | setup( 4 | name='onboarder', 5 | version='1.0', 6 | description='', 7 | long_description='', 8 | author='Brainbot Labs Est.', 9 | author_email='contact@brainbot.li', 10 | license='MIT', 11 | zip_safe=False, 12 | install_requires=[ 13 | 'click==6.7', 14 | 'eth-keyfile==0.5.1', 15 | 'eth-utils==1.2.1', 16 | 'requests==2.20.0', 17 | ], 18 | entry_points={ 19 | 'console_scripts': [ 20 | 'onboarder = onboarder:main' 21 | ] 22 | } 23 | ) 24 | -------------------------------------------------------------------------------- /tools/onboarding-server/traefik.conf: -------------------------------------------------------------------------------- 1 | debug = false 2 | 3 | logLevel = "INFO" 4 | defaultEntryPoints = ["https","http"] 5 | 6 | [entryPoints] 7 | [entryPoints.http] 8 | address = ":80" 9 | [entryPoints.http.redirect] 10 | entryPoint = "https" 11 | [entryPoints.https] 12 | address = ":443" 13 | [entryPoints.https.tls] 14 | 15 | [retry] 16 | 17 | [docker] 18 | watch = true 19 | exposedbydefault = false 20 | 21 | [acme] 22 | storage = "/etc/traefik/acme.json" 23 | entryPoint = "https" 24 | OnHostRule = true 25 | 26 | [acme.httpChallenge] 27 | entryPoint = "http" 28 | -------------------------------------------------------------------------------- /tools/onboarder/onboarder.spec: -------------------------------------------------------------------------------- 1 | # -*- mode: python -*- 2 | import os 3 | 4 | 5 | block_cipher = None 6 | 7 | a = Analysis( 8 | ['onboarder.py'], 9 | pathex=[], 10 | binaries=[], 11 | datas=[], 12 | hiddenimports=[], 13 | hookspath=['hooks'], 14 | runtime_hooks=[], 15 | excludes=[], 16 | win_no_prefer_redirects=False, 17 | win_private_assemblies=False, 18 | cipher=block_cipher, 19 | noarchive=False, 20 | ) 21 | pyz = PYZ( 22 | a.pure, a.zipped_data, 23 | cipher=block_cipher, 24 | ) 25 | exe = EXE( 26 | pyz, 27 | a.scripts, 28 | a.binaries, 29 | a.zipfiles, 30 | a.datas, 31 | [], 32 | name='onboarder', 33 | debug=False, 34 | bootloader_ignore_signals=False, 35 | strip=False, 36 | upx=True, 37 | runtime_tmpdir=None, 38 | console=True, 39 | ) 40 | -------------------------------------------------------------------------------- /tools/onboarding-server/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3" 2 | 3 | services: 4 | onb_server: 5 | build: . 6 | restart: always 7 | volumes: 8 | - /etc/onboarding_server:/config 9 | - /var/log/onboarding_server:/log 10 | command: 11 | - "--keystore-file" 12 | - "/config/keystore" 13 | - "--password" 14 | - "${KEYSTORE_PASSWORD}" 15 | - "--eth-rpc-url" 16 | - "${ETH_RPC_URL}" 17 | - "--token-address" 18 | - "${TOKEN_ADDRESS}" 19 | - "--bind-addr" 20 | - "0.0.0.0:80" 21 | - "--public-url" 22 | - "${PUBLIC_URL}" 23 | - "--redis-host" 24 | - "redis" 25 | - "--log-path" 26 | - "/log" 27 | - "--tx-timeout" 28 | - "${TX_TIMEOUT}" 29 | labels: 30 | - "traefik.enable=true" 31 | - "traefik.port=80" 32 | - "traefik.frontend.rule=Host:${SERVER_NAME}" 33 | 34 | redis: 35 | restart: always 36 | image: redis:latest 37 | 38 | traefik: 39 | image: traefik:1.7 40 | restart: always 41 | ports: 42 | - 80:80 43 | - 443:443 44 | volumes: 45 | - /etc/traefik:/etc/traefik 46 | - /var/run/docker.sock:/var/run/docker.sock 47 | command: --acme.email=${LETSENCRYPT_EMAIL} 48 | -------------------------------------------------------------------------------- /tools/onboarder/onboarder.py: -------------------------------------------------------------------------------- 1 | import hashlib 2 | import json 3 | import os 4 | from datetime import datetime 5 | from getpass import getuser 6 | from pathlib import Path 7 | from uuid import uuid4, getnode 8 | 9 | import click 10 | import requests 11 | from eth_keyfile import create_keyfile_json 12 | from eth_utils import to_checksum_address 13 | 14 | 15 | def make_keystore(output_path: str): 16 | password = click.prompt( 17 | 'Enter new password for keyfile', 18 | hide_input=True, 19 | confirmation_prompt=True, 20 | ).encode() 21 | now = datetime.utcnow().replace(microsecond=0) 22 | target_path = Path(output_path) 23 | target_path.mkdir(parents=True, exist_ok=True) 24 | keyfile_file = target_path.joinpath(f'UTC--{now.isoformat().replace(":", "-")}Z--{uuid4()!s}') 25 | keyfile_content = create_keyfile_json(os.urandom(32), password) 26 | keyfile_file.write_text(json.dumps(keyfile_content)) 27 | return str(keyfile_file), keyfile_content['address'] 28 | 29 | 30 | def fetch_eth(faucet_base_url, address): 31 | client_hash = hashlib.sha256(f'{getnode()}-{getuser()}'.encode()).hexdigest() 32 | resp = requests.post(faucet_base_url, json={'address': address, 'client_hash': client_hash}) 33 | return 199 < resp.status_code < 300, resp 34 | 35 | 36 | @click.command() 37 | @click.option( 38 | '-o', '--output-path', 39 | type=click.Path(file_okay=False, dir_okay=True), 40 | default=Path('keystore'), 41 | show_default=True, 42 | ) 43 | @click.option('--faucet-url', default='https://faucet.workshop.raiden.network') 44 | def main(output_path, faucet_url): 45 | click.secho('Generating keyfile', fg='yellow') 46 | keyfile_file_path, address = make_keystore(output_path) 47 | click.echo( 48 | click.style('Wrote keyfile to ', fg='blue') + 49 | click.style(keyfile_file_path, fg='green') 50 | ) 51 | click.echo( 52 | click.style('Address: ', fg='blue') + 53 | click.style(to_checksum_address(address), fg='green') 54 | ) 55 | click.secho('Fetching Kovan Eth and Workshop tokens from faucet', fg='yellow') 56 | success, response = fetch_eth(faucet_url, address) 57 | if success: 58 | click.secho('Succesfully funded address', fg='green') 59 | else: 60 | click.echo( 61 | click.style('Failed funding account: ', fg='red') + 62 | click.style(f'{response.status_code} {response.text}') 63 | ) 64 | 65 | 66 | if __name__ == "__main__": 67 | main() 68 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ETHSingapore Hackathon Raiden Network guide 2 | 3 | This is the repo for the Raiden Network at the ETHSingapore hackathon. 4 | Below you'll find a list of links and information needed to get going with Raiden for the hackathon. 5 | 6 | ### Prerequisites: 7 | - Access to an Ethereum Kovan RPC endpoint 8 | - For example through [Infura](https://infura.io/login) 9 | - 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](#on-boarding) below for instructions. 10 | - The Raiden client itself. Please see the [getting Raiden](#getting-raiden) section below. 11 | - If you're on Windows we recommend that you install Raiden for Windows Subsystem for Linux (WSL) 12 | - We have created [a gitter room](https://gitter.im/raiden-network/eth-singapore-hackathon) 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. 13 | 14 | ### On-boarding: 15 | 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: 16 | 17 | #### macOS instructions 18 | - Download the onboarder [macOS binary](https://raiden-nightlies.ams3.digitaloceanspaces.com/onboarder-macOS.zip): 19 | ```sh 20 | curl -O https://raiden-nightlies.ams3.digitaloceanspaces.com/onboarder-macOS.zip 21 | ``` 22 | - Unzip the file: 23 | ```sh 24 | unzip onboarder-macOS.zip 25 | ``` 26 | - And run it: 27 | ```sh 28 | ./onboarder 29 | ``` 30 | 31 | #### Linux instructions 32 | - Download the onboarder [linux binary](https://raiden-nightlies.ams3.digitaloceanspaces.com/onboarder-linux.tar.gz): 33 | ```sh 34 | curl -O https://raiden-nightlies.ams3.digitaloceanspaces.com/onboarder-linux.tar.gz 35 | ``` 36 | - Extract the file: 37 | ```sh 38 | tar -xvzf onboarder-linux.tar.gz 39 | ``` 40 | - And run it: 41 | ```sh 42 | ./onboarder 43 | ``` 44 | 45 | ### Getting Raiden 46 | The fastest way to get up and running is to use the latest nightly binary releases. Just follow the instructions below. 47 | 48 | #### macOS instructions 49 | - Download the [latest nightly macOS binary](https://raiden-nightlies.ams3.digitaloceanspaces.com/raiden-nightly-2018-12-06T18-08-23-v0.18.1.dev57%2Bg786347b2-macOS.zip): 50 | ```sh 51 | curl -O https://raiden-nightlies.ams3.digitaloceanspaces.com/raiden-nightly-2018-12-06T18-08-23-v0.18.1.dev57%2Bg786347b2-macOS.zip 52 | ``` 53 | - Unzip the file: 54 | ```sh 55 | unzip raiden-nightly-2018-12-06T18-08-23-v0.18.1.dev57%2Bg786347b2-macOS.zip 56 | ``` 57 | 58 | #### Linux instructions 59 | - Download the [latest nightly linux binary](https://raiden-nightlies.ams3.digitaloceanspaces.com/raiden-nightly-2018-12-06T17-58-34-v0.18.1.dev57%2Bg786347b2-linux.tar.gz): 60 | ```sh 61 | curl -O https://raiden-nightlies.ams3.digitaloceanspaces.com/raiden-nightly-2018-12-06T17-58-34-v0.18.1.dev57%2Bg786347b2-linux.tar.gz 62 | ``` 63 | - Extract the file: 64 | ```sh 65 | tar xvzf raiden-nightly-2018-12-06T17-58-34-v0.18.1.dev57%2Bg786347b2-linux.tar.gz 66 | ``` 67 | 68 | ### Running Raiden: 69 | 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): 70 | ```sh 71 | ./raiden-binary \ 72 | --keystore-path keystore \ 73 | --network-id kovan \ 74 | --gas-price fast \ 75 | --environment-type development \ 76 | --eth-rpc-endpoint https://kovan.infura.io/v3/YOUR_INFURA_TOKEN 77 | ``` 78 | 79 | 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. 80 | 81 | It will take a bit of time for the node to finish launching. 82 | You'll see that it's ready once you see the message stating that the Rest-API has been started. 83 | 84 | You can now access the WebUI at [http://localhost:5001/](http://localhost:5001). 85 | 86 | #### Tell the rest 87 | 88 | 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. 89 | You can also check out how the network is growing by checking out the [Raiden Explorer](https://kovan.explorer.raiden.network/tokens/0x98a345f06e3A5DFe28EE0af38dd0780b4C0ed73B) for the ETHSingaporeToken. 90 | 91 | ### API commands: 92 | 93 | #### Open channels 94 | 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. 95 | 96 | ```sh 97 | curl -i -X PUT http://localhost:5001/api/v1/channels \ 98 | -H 'Content-Type: application/json' --data-raw \ 99 | '{"partner_address": "0x0bae0289AAA26845224F528F9B9DefE69e01606E", \ 100 | "token_address": "0x98a345f06e3A5DFe28EE0af38dd0780b4C0ed73B", \ 101 | "total_deposit": 10000000000000000000}' 102 | ``` 103 | 104 | #### Deposit 105 | If you ever need to top up a channel, you can use the following command: 106 | ```sh 107 | curl -i -X PATCH http://localhost:5001/api/v1/channels/ \ 108 | 0x98a345f06e3A5DFe28EE0af38dd0780b4C0ed73B/ADDRESS_OF_PARTNER \ 109 | -H 'Content-Type: application/json' \ 110 | --data-raw '{"total_deposit": 15000000000000000000}' 111 | ``` 112 | 113 | #### Make payments 114 | To make payments, choose the address of the partner you've opened a channel with and do the following: 115 | ```sh 116 | curl -i -X POST http://localhost:5001/api/v1/payments/ \ 117 | 0x98a345f06e3A5DFe28EE0af38dd0780b4C0ed73B/ADDRESS_OF_RECEIVER \ 118 | -H 'Content-Type: application/json' --data-raw '{"amount": 100000}' 119 | ``` 120 | 121 | Feel free to change the amounts of the payments. 122 | 123 | ### Other resources 124 | - [API documentation](https://raiden-network.readthedocs.io/en/latest/rest_api.html) 125 | - [Raiden installation instructions](https://raiden-network.readthedocs.io/en/latest/overview_and_guide.html#installation) 126 | - [Getting Started with Raiden API](https://raiden-network.readthedocs.io/en/latest/api_walkthrough.html) 127 | - [ETHSingaporeToken](https://kovan.etherscan.io/address/0x98a345f06e3A5DFe28EE0af38dd0780b4C0ed73B#code) 128 | - [Hackathon Gitter Room](https://gitter.im/raiden-network/eth-singapore-hackathon) 129 | -------------------------------------------------------------------------------- /tools/onboarding-server/onboarding_server.py: -------------------------------------------------------------------------------- 1 | from gevent.monkey import patch_all # isort:skip # noqa 2 | patch_all() # isort:skip # noqa 3 | 4 | import json 5 | import os 6 | import time 7 | from datetime import datetime 8 | from typing import Set, Union 9 | 10 | import click 11 | import structlog 12 | from eth_utils import encode_hex, is_address, to_checksum_address 13 | from flask import Flask, Response, request 14 | from gunicorn.app.base import BaseApplication 15 | from redis import StrictRedis 16 | from web3 import HTTPProvider, Web3 17 | from web3.gas_strategies.time_based import fast_gas_price_strategy 18 | 19 | from raiden.accounts import Account 20 | from raiden.log_config import configure_logging 21 | from raiden.network.rpc.client import JSONRPCClient, check_address_has_code 22 | from raiden.network.rpc.smartcontract_proxy import ContractProxy 23 | from raiden.utils.typing import TransactionHash 24 | from raiden_contracts.constants import CONTRACT_CUSTOM_TOKEN 25 | from raiden_contracts.contract_manager import ContractManager, contracts_precompiled_path 26 | 27 | REDIS_KEY_KNOWN_ADDR = 'onboarding:known_addr' 28 | REDIS_KEY_KNOWN_CLIENT = 'onboarding:known_client' 29 | log = structlog.get_logger('onboarding_server') 30 | 31 | 32 | class GunicornApplication(BaseApplication): 33 | def __init__(self, app, options=None): 34 | self.options = options or {} 35 | self.application = app 36 | super().__init__() 37 | 38 | def load_config(self): 39 | for key, value in self.options.items(): 40 | if key not in self.cfg.settings or value is None: 41 | continue 42 | self.cfg.set(key.lower(), value) 43 | 44 | def load(self): 45 | return self.application 46 | 47 | 48 | def _get_token_ctr(client, token_address) -> ContractProxy: 49 | token_contract = ContractManager(contracts_precompiled_path()).get_contract(CONTRACT_CUSTOM_TOKEN) 50 | check_address_has_code(client, token_address, 'Token') 51 | return client.new_contract_proxy(token_contract['abi'], token_address) 52 | 53 | 54 | def wait_for_txs( 55 | client_or_web3: Union[Web3, JSONRPCClient], 56 | txhashes: Set[TransactionHash], 57 | timeout: int = 360, 58 | ): 59 | if isinstance(client_or_web3, Web3): 60 | web3 = client_or_web3 61 | else: 62 | web3 = client_or_web3.web3 63 | start = time.monotonic() 64 | outstanding = False 65 | txhashes = set(txhashes) 66 | while txhashes and time.monotonic() - start < timeout: 67 | remaining_timeout = timeout - (time.monotonic() - start) 68 | if outstanding != len(txhashes) or int(remaining_timeout) % 10 == 0: 69 | outstanding = len(txhashes) 70 | log.debug( 71 | "Waiting for tx confirmations", 72 | outstanding=outstanding, 73 | timeout_remaining=int(remaining_timeout), 74 | ) 75 | for txhash in txhashes.copy(): 76 | tx = web3.eth.getTransactionReceipt(txhash) 77 | if tx and tx['blockNumber'] is not None: 78 | status = tx.get('status') 79 | if status is not None and status == 0: 80 | raise RuntimeError(f"Transaction {encode_hex(txhash)} failed.") 81 | txhashes.remove(txhash) 82 | time.sleep(.1) 83 | time.sleep(1) 84 | if len(txhashes): 85 | txhashes_str = ', '.join(encode_hex(txhash) for txhash in txhashes) 86 | raise RuntimeError( 87 | f"Timeout waiting for txhashes: {txhashes_str}", 88 | ) 89 | 90 | 91 | @click.command() 92 | @click.option('--keystore-file', required=True, type=click.Path(exists=True, dir_okay=False)) 93 | @click.password_option('--password', envvar='ACCOUNT_PASSWORD', required=True) 94 | @click.option('--eth-rpc-url', required=True) 95 | @click.option('--token-address', required=True) 96 | @click.option('--bind-addr', default='127.0.0.1:8088', show_default=True) 97 | @click.option('--public-url') 98 | @click.option('--redis-host', default='localhost', show_default=True) 99 | @click.option('--redis-port', default=6379, show_default=True) 100 | @click.option('--faucet-amount-eth', default=5 * 10 ** 17, show_default=True) 101 | @click.option('--faucet-amount-tokens', default=100 * 10 ** 18, show_default=True) 102 | @click.option('--faucet-timeout', default=3600, show_default=True) 103 | @click.option( 104 | '--log-path', 105 | default=os.getcwd(), 106 | type=click.Path(file_okay=False, dir_okay=True, exists=True), 107 | ) 108 | @click.option('--tx-timeout', default=360, show_default=True) 109 | def main( 110 | keystore_file, 111 | password, 112 | eth_rpc_url, 113 | token_address, 114 | bind_addr, 115 | public_url, 116 | redis_host, 117 | redis_port, 118 | faucet_amount_eth, 119 | faucet_amount_tokens, 120 | faucet_timeout, 121 | log_path, 122 | tx_timeout, 123 | ): 124 | log_file_name = f'onboarding-server.{datetime.now().isoformat()}.log' 125 | log_file_name = os.path.join(log_path, log_file_name) 126 | click.secho(f'Writing log to {log_file_name}', fg='yellow') 127 | configure_logging( 128 | {'': 'INFO', 'raiden': 'DEBUG', 'onboarding_server': 'DEBUG'}, 129 | debug_log_file_name=log_file_name, 130 | _first_party_packages=frozenset(['raiden', 'onboarding_server']), 131 | ) 132 | 133 | with open(keystore_file, 'r') as keystore: 134 | account = Account(json.load(keystore), password, keystore_file) 135 | log.info("Using account", account=to_checksum_address(account.address)) 136 | client = JSONRPCClient( 137 | Web3(HTTPProvider(eth_rpc_url)), 138 | privkey=account.privkey, 139 | gas_price_strategy=fast_gas_price_strategy, 140 | ) 141 | 142 | token_ctr = _get_token_ctr(client, token_address) 143 | 144 | if public_url is None: 145 | public_url = f'http://{bind_addr}/' 146 | 147 | redis = StrictRedis(redis_host, redis_port) 148 | 149 | app = Flask(__name__) 150 | 151 | @app.route('/', methods=['GET']) 152 | def index(): 153 | return f''' 154 | 155 | 156 |
157 |

Raiden Hands on Workshop @ devcon iv

158 |

Kovan ETH & {token_ctr.contract.call().name()} faucet

159 |
160 |
161 | 162 |
163 |

164 | To request KETH and tokens send a POST request to {public_url} with a JSON body 165 | containing {{"address": "<eth-address>", "client_hash": "<client-auth-hash>"}}. 166 |

167 | ''' 168 | 169 | @app.route('/', methods=['POST']) 170 | def faucet(): 171 | if not request.json: 172 | log.info('Invlid request', remote=request.remote_addr) 173 | return Response( 174 | '{"result": "error", "error": "Invalid request"}', 175 | status=406, 176 | content_type='application/json', 177 | ) 178 | address = request.json.get('address') 179 | client_hash = request.json.get('client_hash') 180 | if not address or not is_address(address) or not client_hash: 181 | log.info('Invlid request.', remote=request.remote_addr, address=address, client_hash=client_hash) 182 | return Response( 183 | '{"result": "error", "error": "Invalid request. address or client_hash missing."}', 184 | status=406, 185 | content_type='application/json', 186 | ) 187 | address = to_checksum_address(address) 188 | address_key = f'{REDIS_KEY_KNOWN_ADDR}:{address}' 189 | client_key = f'{REDIS_KEY_KNOWN_CLIENT}:{client_hash}' 190 | if redis.get(address_key) is not None or redis.get(client_key) is not None: 191 | log.info('Quota exceeded', address=address, client_hash=client_hash) 192 | return Response( 193 | '{"result": "error", "error": "quota exceeded"}', 194 | status=429, 195 | content_type='application/json', 196 | ) 197 | log.info('Fauceting', target=address) 198 | txhashes = { 199 | client.send_transaction(address, faucet_amount_eth), 200 | token_ctr.transact('mintFor', faucet_amount_tokens, address) 201 | } 202 | try: 203 | wait_for_txs(client, txhashes, timeout=tx_timeout) 204 | except RuntimeError as ex: 205 | return Response( 206 | json.dumps({'result': 'error', 'error': str(ex)}), 207 | status=503, 208 | content_type='application/json', 209 | ) 210 | log.info('Successfully fauceted', address=address) 211 | redis.set(address_key, '1', ex=faucet_timeout) 212 | redis.set(client_key, '1', ex=faucet_timeout) 213 | return Response('{"result": "success"}', content_type='application/json') 214 | 215 | GunicornApplication(app, {'bind': bind_addr, 'worker_class': 'gevent'}).run() 216 | 217 | 218 | if __name__ == "__main__": 219 | main() 220 | -------------------------------------------------------------------------------- /game/game.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Making your first Phaser 3 Game - Part 10 6 | 7 | 8 | 14 | 15 | 16 | 289 |
  • 290 | 291 | 292 | 293 | 294 |
  • 295 |
    296 | 297 | -------------------------------------------------------------------------------- /tools/raiden_open_api.yaml: -------------------------------------------------------------------------------- 1 | openapi: "3.0.2" 2 | info: 3 | description: "Raiden Network client API" 4 | version: "1.0.0" 5 | title: "Raiden Network" 6 | contact: 7 | email: "contact@raiden.network" 8 | servers: 9 | - url: "http://localhost:5001/api/1" 10 | description: "Development server" 11 | tags: 12 | - name: "raiden_network" 13 | description: "Raiden Network" 14 | externalDocs: 15 | description: "Find out more" 16 | url: "https://raiden-network.readthedocs.io/en/stable/rest_api.html" 17 | paths: 18 | /address: 19 | get: 20 | tags: 21 | - "address" 22 | summary: "Query your address" 23 | description: "When raiden starts, you choose an ethereum address which will also be your raiden address." 24 | responses: 25 | 200: 26 | description: "successful operation" 27 | content: 28 | application/json: 29 | schema: 30 | type: "object" 31 | properties: 32 | our_address: 33 | type: "string" 34 | /tokens/{token_address}: 35 | put: 36 | tags: 37 | - "tokens" 38 | summary: "Registers a token" 39 | description: "If a token is not registered yet (i.e.: A token network for that token does not exist in the registry), we need to register it by deploying a token network contract for that token." 40 | parameters: 41 | - name: "token_address" 42 | in: "path" 43 | description: "Token address" 44 | required: true 45 | schema: 46 | type: "string" 47 | responses: 48 | 201: 49 | description: "Created.A token network for the token has been successfully created" 50 | content: 51 | application/json: 52 | schema: 53 | type: "object" 54 | properties: 55 | token_network_address: 56 | type: "string" 57 | 402: 58 | description: "Payment Required. Insufficient ETH to pay for the gas of the register on-chain transaction" 59 | 404: 60 | description: "Not Found. The given token address is invalid" 61 | 409: 62 | description: "Conflict. The token was already registered before, or the registering transaction failed." 63 | 501: 64 | description: "Not Implemented. Registering a token only works on testnet temporarily. On mainnet this error is returned." 65 | /channels: 66 | get: 67 | tags: 68 | - "channels" 69 | summary: "Get a list of all unsettled channels" 70 | description: "Get a list of all unsettled channels" 71 | responses: 72 | 200: 73 | description: "Successful query" 74 | content: 75 | application/json: 76 | schema: 77 | type: "array" 78 | items: 79 | $ref: "#/components/schemas/Channel" 80 | 500: 81 | description: "Internal Server Error – Internal Raiden node error" 82 | put: 83 | tags: 84 | - "channels" 85 | summary: "Opens (i. e. creates) a channel" 86 | description: "Opens (i. e. creates) a channel" 87 | requestBody: 88 | description: "Channel data payload" 89 | content: 90 | 'application/json': 91 | schema: 92 | properties: 93 | partner_address: 94 | type: "string" 95 | description: "The partner we want to open a channel with" 96 | token_address: 97 | type: "string" 98 | description: "The token we want to be used in the channel" 99 | total_deposit: 100 | type: "integer" 101 | format: "int264" 102 | description: "Total amount of tokens to be deposited to the channel" 103 | settle_timeout: 104 | type: "integer" 105 | format: "int264" 106 | description: "The amount of blocks that the settle timeout should have" 107 | required: 108 | - "partner_address" 109 | - "token_address" 110 | - "total_deposit" 111 | - "settle_timeout" 112 | responses: 113 | 201: 114 | description: "Created. Channel created successfully" 115 | content: 116 | application/json: 117 | schema: 118 | $ref: "#/components/schemas/Channel" 119 | 400: 120 | description: "Bad Request. Provided JSON is in some way malformed" 121 | 402: 122 | description: "Payment Required. Insufficient ETH to pay for the gas of the channel open on-chain transaction" 123 | 408: 124 | description: "Request Timeout. Deposit event was not read in time by the Ethereum node" 125 | 409: 126 | description: "Conflict. Invalid input, e. g. too low a settle timeout" 127 | 500: 128 | description: "Internal Server Error. Internal Raiden node error" 129 | /channels/{token_address}: 130 | get: 131 | tags: 132 | - "channels" 133 | summary: "Get a list of all unsettled channels for the given token address" 134 | description: "Get a list of all unsettled channels for the given token address" 135 | parameters: 136 | - name: "token_address" 137 | in: "path" 138 | description: "Token address" 139 | required: true 140 | schema: 141 | type: "string" 142 | responses: 143 | 200: 144 | description: "Successful query" 145 | content: 146 | application/json: 147 | schema: 148 | $ref: "#/components/schemas/Channel" 149 | 404: 150 | description: "Not Found. The given token address is not a valid eip55-encoded Ethereum addres" 151 | 500: 152 | description: "Internal Server Error. Internal Raiden node error" 153 | /channels/{token_address}/{partner_address}: 154 | get: 155 | tags: 156 | - "channels" 157 | summary: "Query information about one of your channels" 158 | description: "The channel is specified by the address of the token and the partner’s address." 159 | parameters: 160 | - name: "token_address" 161 | in: "path" 162 | description: "Token address" 163 | required: true 164 | schema: 165 | type: "string" 166 | - name: "partner_address" 167 | in: "path" 168 | description: "Token address" 169 | required: true 170 | schema: 171 | type: "string" 172 | responses: 173 | 200: 174 | description: "Successful query" 175 | content: 176 | application/json: 177 | schema: 178 | $ref: "#/components/schemas/Channel" 179 | 404: 180 | description: "Not Found. The given token address is not a valid eip55-encoded Ethereum addres or the channel does not exist" 181 | 500: 182 | description: "Internal Server Error. Internal Raiden node error" 183 | patch: 184 | tags: 185 | - "channel" 186 | summary: "This request is used to close a channel or to increase the deposit in it" 187 | description: "This request is used to close a channel or to increase the deposit in it" 188 | requestBody: 189 | description: "Channel data payload" 190 | content: 191 | 'application/json': 192 | schema: 193 | type: "object" 194 | properties: 195 | state: 196 | description: "Desired new state; the only valid choice is 'closed'" 197 | type: "string" 198 | enum: [ 199 | "closed" 200 | ] 201 | total_deposit: 202 | description: "The increased total deposit" 203 | type: "string" 204 | enum: [ 205 | "closed" 206 | ] 207 | parameters: 208 | - name: "partner_address" 209 | in: "path" 210 | description: "The partner we want to open a channel with" 211 | required: true 212 | schema: 213 | type: "string" 214 | - name: "token_address" 215 | in: "path" 216 | description: "The token we want to be used in the channel" 217 | required: true 218 | schema: 219 | type: "string" 220 | responses: 221 | 200: 222 | description: "OK. Success" 223 | content: 224 | application/json: 225 | schema: 226 | $ref: "#/components/schemas/Channel" 227 | 400: 228 | description: "Bad Request. The provided JSON is in some way malformed, or there is nothing to do since neither state nor total_deposit have been given, or the value of state is not a valid channel state." 229 | 402: 230 | description: "Payment Required. Insufficient balance to do a deposit, or insufficient ETH to pay for the gas of the on-chain transaction" 231 | 404: 232 | description: "Payment Required. Insufficient balance to do a deposit, or insufficient ETH to pay for the gas of the on-chain transaction" 233 | 408: 234 | description: "Request Timeout. Deposit event was not read in time by the Ethereum node" 235 | 409: 236 | description: "Conflict. Provided channel does not exist or state and total_deposit have been attempted to update in the same request or attempt to deposit token amount lower than on-chain balance of the channel attempt to deposit more tokens than the testing limit" 237 | 500: 238 | description: "Internal Server Error. Internal Raiden node error" 239 | /tokens: 240 | get: 241 | tags: 242 | - "tokens" 243 | summary: "Returns a list of addresses of all registered tokens" 244 | description: "Returns a list of addresses of all registered tokens" 245 | responses: 246 | 200: 247 | description: "Successful query" 248 | content: 249 | application/json: 250 | schema: 251 | type: "array" 252 | items: 253 | type: "string" 254 | 500: 255 | description: "Internal Server Error. Internal Raiden node error" 256 | /tokens/{token_address}/partners: 257 | get: 258 | tags: 259 | - "partners" 260 | summary: "Returns a list of all partners" 261 | description: "Returns a list of all partners with whom you have non-settled channels for a certain token" 262 | parameters: 263 | - name: "token_address" 264 | in: "path" 265 | description: "Token address" 266 | required: true 267 | schema: 268 | type: "string" 269 | responses: 270 | 200: 271 | description: "Successful query" 272 | content: 273 | application/json: 274 | schema: 275 | type: "array" 276 | items: 277 | type: "object" 278 | properties: 279 | partner_address: 280 | type: "string" 281 | description: "The partner we have a channel with" 282 | channel: 283 | type: "string" 284 | description: "The partner we have a channel with" 285 | 300: 286 | description: "Found. If the user accesses the channel link endpoint" 287 | 400: 288 | description: "Not Found. The token does not exist the token address is not a valid eip55-encoded Ethereum address" 289 | 500: 290 | description: "Internal Server Error. Internal Raiden node error" 291 | /connections: 292 | get: 293 | tags: 294 | - "connections" 295 | summary: "Query details of all joined token networks" 296 | description: "The request will return a JSON object where each key is a token address for which you have open channels" 297 | responses: 298 | 200: 299 | description: "OK. Success" 300 | content: 301 | application/json: 302 | schema: 303 | $ref: "#/components/schemas/Connection" 304 | 500: 305 | description: "Internal Server Error. Internal Raiden node error" 306 | /connections/{token_address}: 307 | put: 308 | tags: 309 | - "connections" 310 | summary: "Automatically join a token network" 311 | description: "The request will only return once all blockchain calls for opening and/or depositing to a channel have completed" 312 | parameters: 313 | - name: "token_address" 314 | in: "path" 315 | description: "Token address" 316 | required: true 317 | schema: 318 | type: "string" 319 | requestBody: 320 | description: "Channel data payload" 321 | content: 322 | 'application/json': 323 | schema: 324 | type: "object" 325 | properties: 326 | initial_channel_target: 327 | description: "Number of channels to open proactively" 328 | type: "string" 329 | joinable_funds_target: 330 | description: "Fraction of funds that will be used to join channels opened by other participants" 331 | type: "number" 332 | format: "float" 333 | funds: 334 | description: "Amount of funding you want to put into the network" 335 | type: "integer" 336 | format: "int264" 337 | responses: 338 | 204: 339 | description: "No Content. For a successful connection creation" 340 | 402: 341 | description: "Payment Required. If any of the channel deposits fail due to insufficient ETH balance to pay for the gas of the on-chain transactions" 342 | 404: 343 | description: "Not Found. The given token address is not a valid eip55-encoded Ethereum address" 344 | 408: 345 | description: "Request Timeout. If a timeout happened during any of the transactions" 346 | 409: 347 | description: "Conflict. If any of the provided input to the call is invalid" 348 | 500: 349 | description: "Internal Server Error. Internal Raiden node error" 350 | delete: 351 | tags: 352 | - "connections" 353 | summary: "Leave a token network" 354 | description: "The request will only return once all blockchain calls for closing/settling a channel have completed" 355 | parameters: 356 | - name: "token_address" 357 | in: "path" 358 | description: "The partner we want to open a channel with" 359 | required: true 360 | schema: 361 | type: "string" 362 | responses: 363 | 200: 364 | description: "OK. For successfully leaving a token network" 365 | content: 366 | application/json: 367 | schema: 368 | type: "array" 369 | description: "The response is a list with the addresses of all closed channels" 370 | items: 371 | type: "string" 372 | 404: 373 | description: "Not Found. The given token address is not a valid eip55-encoded Ethereum address" 374 | 500: 375 | description: "Internal Server Error. Internal Raiden node error" 376 | /payments: 377 | get: 378 | tags: 379 | - "payments" 380 | summary: "Query the payment history" 381 | description: "This includes successful (EventPaymentSentSuccess) and failed (EventPaymentSentFailed) sent payments as well as received payments (EventPaymentReceivedSuccess)" 382 | responses: 383 | 200: 384 | description: "OK. For successful query" 385 | content: 386 | application/json: 387 | schema: 388 | type: "array" 389 | items: 390 | $ref: "#/components/schemas/PaymentEvent" 391 | 404: 392 | description: "Not Found – The given token and / or partner addresses are not valid eip55-encoded Ethereum addresses" 393 | 409: 394 | description: "Conflict – If the given block number or token_address arguments are invalid" 395 | 500: 396 | description: "Internal Server Error. Internal Raiden node error" 397 | /payments/{token_address}: 398 | get: 399 | tags: 400 | - "payments" 401 | summary: "Query the payment history" 402 | description: "This includes successful (EventPaymentSentSuccess) and failed (EventPaymentSentFailed) sent payments as well as received payments (EventPaymentReceivedSuccess)" 403 | parameters: 404 | - name: "token_address" 405 | in: "path" 406 | description: "Token address" 407 | required: true 408 | schema: 409 | type: "string" 410 | responses: 411 | 200: 412 | description: "OK. For successful query" 413 | content: 414 | application/json: 415 | schema: 416 | type: "array" 417 | items: 418 | $ref: "#/components/schemas/PaymentEvent" 419 | 404: 420 | description: "Not Found – The given token and / or partner addresses are not valid eip55-encoded Ethereum addresses" 421 | 409: 422 | description: "Conflict – If the given block number or token_address arguments are invalid" 423 | 500: 424 | description: "Internal Server Error. Internal Raiden node error" 425 | /payments/{token_address}/{target_address}: 426 | post: 427 | tags: 428 | - "payments" 429 | summary: "Initiate a payment." 430 | description: "The request will only return once the payment either succeeded or failed" 431 | parameters: 432 | - name: "token_address" 433 | in: "path" 434 | description: "Token address" 435 | required: true 436 | schema: 437 | type: "string" 438 | - name: "target_address" 439 | in: "path" 440 | description: "The partner we want to open a channel with" 441 | required: true 442 | schema: 443 | type: "string" 444 | requestBody: 445 | description: "Channel data payload" 446 | content: 447 | 'application/json': 448 | schema: 449 | type: "object" 450 | properties: 451 | amount: 452 | description: "Amount to be sent to the target" 453 | type: "integer" 454 | format: "int256" 455 | identifier: 456 | description: "Identifier of the payment" 457 | type: "integer" 458 | format: "int256" 459 | required: 460 | - amount 461 | responses: 462 | 200: 463 | description: "OK. Successful payment" 464 | content: 465 | application/json: 466 | schema: 467 | type: "object" 468 | properties: 469 | initiator_address: 470 | type: "string" 471 | target_address: 472 | type: "string" 473 | token_address: 474 | type: "string" 475 | amount: 476 | type: "integer" 477 | format: "int256" 478 | identifier: 479 | type: "integer" 480 | format: "int256" 481 | 400: 482 | description: "Bad Request – If the provided json is in some way malformed" 483 | 402: 484 | description: "Payment Required – If the payment can’t start due to insufficient balance" 485 | 404: 486 | description: "Not Found – The given token and / or target addresses are not valid eip55-encoded Ethereum addresses" 487 | 408: 488 | description: "Request Timeout – If a timeout happened during the payment" 489 | 409: 490 | description: "Conflict – If the address or the amount is invalid or if there is no path to the target, or if the identifier is already in use for a different payment" 491 | 500: 492 | description: "Internal Server Error. Internal Raiden node error" 493 | get: 494 | tags: 495 | - "payments" 496 | summary: "Query the payment history" 497 | description: "This includes successful (EventPaymentSentSuccess) and failed (EventPaymentSentFailed) sent payments as well as received payments (EventPaymentReceivedSuccess)" 498 | parameters: 499 | - name: "token_address" 500 | in: "path" 501 | description: "Token address" 502 | required: true 503 | schema: 504 | type: "string" 505 | - name: "target_address" 506 | in: "path" 507 | description: "Token address" 508 | required: true 509 | schema: 510 | type: "string" 511 | responses: 512 | 200: 513 | description: "OK. For successful query" 514 | content: 515 | application/json: 516 | schema: 517 | type: "array" 518 | items: 519 | $ref: "#/components/schemas/PaymentEvent" 520 | 404: 521 | description: "Not Found – The given token and / or partner addresses are not valid eip55-encoded Ethereum addresses" 522 | 409: 523 | description: "Conflict – If the given block number or token_address arguments are invalid" 524 | 500: 525 | description: "Internal Server Error. Internal Raiden node error" 526 | /_debug/blockchain_events/network: 527 | get: 528 | tags: 529 | - "events" 530 | summary: "Query for token network creations" 531 | description: "Query for token network creations" 532 | parameters: 533 | - name: "from_block" 534 | in: "query" 535 | description: "From block" 536 | schema: 537 | type: "integer" 538 | format: "int64" 539 | - name: "to_block" 540 | in: "query" 541 | description: "To block" 542 | schema: 543 | type: "integer" 544 | format: "int64" 545 | - name: "limit" 546 | in: "query" 547 | description: "Limit results" 548 | schema: 549 | type: "integer" 550 | format: "int64" 551 | - name: "offset" 552 | in: "query" 553 | description: "Offset" 554 | schema: 555 | type: "integer" 556 | format: "int64" 557 | responses: 558 | 200: 559 | description: "OK. For successful query" 560 | content: 561 | application/json: 562 | schema: 563 | type: "array" 564 | items: 565 | type: "object" 566 | properties: 567 | args: 568 | type: "object" 569 | properties: 570 | token_address: 571 | type: "string" 572 | token_network_address: 573 | type: "string" 574 | event: 575 | type: "string" 576 | logIndex: 577 | type: "integer" 578 | format: "int64" 579 | transactionIndex: 580 | type: "integer" 581 | format: "int64" 582 | transactionHash: 583 | type: "string" 584 | address: 585 | type: "string" 586 | blockHash: 587 | type: "string" 588 | block_number: 589 | type: "integer" 590 | format: "int64" 591 | 400: 592 | description: "Bad Request – If the provided json is in some way malformed" 593 | 409: 594 | description: "Conflict – If the given block number argument is invalid" 595 | 500: 596 | description: "Internal Server Error. Internal Raiden node error" 597 | /_debug/blockchain_events/tokens/{token_address}: 598 | get: 599 | tags: 600 | - "events" 601 | summary: "Query for token network creations" 602 | description: "Query for token network creations" 603 | parameters: 604 | - name: "token_address" 605 | in: "path" 606 | description: "Token address" 607 | required: true 608 | schema: 609 | type: "string" 610 | - name: "from_block" 611 | in: "query" 612 | description: "From block" 613 | schema: 614 | type: "integer" 615 | format: "int64" 616 | - name: "to_block" 617 | in: "query" 618 | description: "To block" 619 | schema: 620 | type: "integer" 621 | format: "int64" 622 | - name: "limit" 623 | in: "query" 624 | description: "Limit results" 625 | schema: 626 | type: "integer" 627 | format: "int64" 628 | - name: "offset" 629 | in: "query" 630 | description: "Offset" 631 | schema: 632 | type: "integer" 633 | format: "int64" 634 | responses: 635 | 200: 636 | description: "OK. For successful query" 637 | content: 638 | application/json: 639 | schema: 640 | type: "array" 641 | items: 642 | type: "object" 643 | properties: 644 | args: 645 | type: "object" 646 | properties: 647 | token_address: 648 | type: "string" 649 | token_network_address: 650 | type: "string" 651 | event: 652 | type: "string" 653 | logIndex: 654 | type: "integer" 655 | format: "int64" 656 | transactionIndex: 657 | type: "integer" 658 | format: "int64" 659 | transactionHash: 660 | type: "string" 661 | address: 662 | type: "string" 663 | blockHash: 664 | type: "string" 665 | block_number: 666 | type: "integer" 667 | format: "int64" 668 | 404: 669 | description: "Not Found – The given token address is not a valid eip55-encoded Ethereum address or does not exist" 670 | 409: 671 | description: "Conflict – If the given block number or token_address arguments are invalid" 672 | 500: 673 | description: "Internal Server Error. Internal Raiden node error" 674 | /_debug/blockchain_events/payment_network/{token_address}/channels/{partner_address}: 675 | get: 676 | tags: 677 | - "events" 678 | summary: "Query for blockchain_events" 679 | description: "Query for blockchain_events tied to all the channels which are part of the token network. If the partner_address is not provided it will show the events for all the channels" 680 | parameters: 681 | - name: "token_address" 682 | in: "path" 683 | description: "Token address" 684 | required: true 685 | schema: 686 | type: "string" 687 | - name: "partner_address" 688 | in: "path" 689 | description: "Partner address" 690 | required: true 691 | schema: 692 | type: "string" 693 | - name: "from_block" 694 | in: "query" 695 | description: "From block" 696 | schema: 697 | type: "integer" 698 | format: "int64" 699 | - name: "to_block" 700 | in: "query" 701 | description: "To block" 702 | schema: 703 | type: "integer" 704 | format: "int64" 705 | - name: "limit" 706 | in: "query" 707 | description: "Limit results" 708 | schema: 709 | type: "integer" 710 | format: "int64" 711 | - name: "offset" 712 | in: "query" 713 | description: "Offset" 714 | schema: 715 | type: "integer" 716 | format: "int64" 717 | responses: 718 | 200: 719 | description: "OK. For successful query" 720 | content: 721 | application/json: 722 | schema: 723 | type: "array" 724 | items: 725 | type: "object" 726 | properties: 727 | args: 728 | type: "object" 729 | properties: 730 | channel_identifier: 731 | type: "string" 732 | participant1_amount: 733 | type: "integer" 734 | format: "int64" 735 | participant2_amount: 736 | type: "integer" 737 | format: "int64" 738 | event: 739 | type: "string" 740 | logIndex: 741 | type: "integer" 742 | format: "int64" 743 | transactionIndex: 744 | type: "integer" 745 | format: "int64" 746 | transactionHash: 747 | type: "string" 748 | address: 749 | type: "string" 750 | blockHash: 751 | type: "string" 752 | block_number: 753 | type: "integer" 754 | format: "int64" 755 | 404: 756 | description: "Not Found – The given token and / or partner addresses are not valid eip55-encoded Ethereum addresses, or the channel for the given partner does not exist" 757 | 409: 758 | description: "Conflict – If the given block number argument is invalid" 759 | 500: 760 | description: "Internal Server Error. Internal Raiden node error" 761 | /_debug/raiden_events: 762 | get: 763 | tags: 764 | - "events" 765 | summary: "Query for Raiden internal node events" 766 | description: "Query for Raiden internal node events" 767 | responses: 768 | 200: 769 | description: "OK. For successful query" 770 | content: 771 | application/json: 772 | schema: 773 | type: "array" 774 | items: 775 | type: "object" 776 | 500: 777 | description: "Internal Server Error. Internal Raiden node error" 778 | components: 779 | schemas: 780 | Channel: 781 | type: "object" 782 | properties: 783 | token_network_identifier: 784 | type: "string" 785 | channel_identifier: 786 | type: "integer" 787 | format: "int264" 788 | partner_address: 789 | type: "string" 790 | token_address: 791 | type: "string" 792 | balance: 793 | type: "integer" 794 | format: "int264" 795 | total_deposit: 796 | type: "integer" 797 | format: "int264" 798 | state: 799 | type: "string" 800 | description: "Channel Status" 801 | enum: 802 | - "opened" 803 | - "closed" 804 | - "settled" 805 | settle_timeout: 806 | type: "integer" 807 | format: "int264" 808 | reveal_timeout: 809 | type: "integer" 810 | format: "int264" 811 | xml: 812 | name: "Channel" 813 | Connection: 814 | type: "object" 815 | properties: {} 816 | PaymentEvent: 817 | type: "object" 818 | properties: 819 | event: 820 | type: "string" 821 | amount: 822 | type: "integer" 823 | format: "int64" 824 | initiator: 825 | type: "string" 826 | identifier: 827 | type: "integer" 828 | format: "int64" 829 | --------------------------------------------------------------------------------