Skip to content

Instantly share code, notes, and snippets.

View CosminNechifor's full-sized avatar

Cosmin Nechifor CosminNechifor

View GitHub Profile
@CosminNechifor
CosminNechifor / payment events
Created August 22, 2018 16:07
payment events
➜ raiden git:(master) ✗ GET http://localhost:5001/api/1/payments/0x0f114A1E9Db192502E7856309cc899952b3db1ED/0x000D91Cf263a11F9BfCeE3752E5B03FC1196CE98 | jq
[
{
"target": "0x000D91Cf263a11F9BfCeE3752E5B03FC1196CE98",
"amount": 1,
"block_number": 3889943,
"event": "EventPaymentSentSuccess"
},
{
"target": "0x000D91Cf263a11F9BfCeE3752E5B03FC1196CE98",
```
Traceback (most recent call last):
File "src/gevent/greenlet.py", line 716, in gevent._greenlet.Greenlet.run
File "/home/cosmin/Documents/WORK/GITHUB/raiden/raiden/network/transport/matrix.py", line 733, in _handle_presence_change
address = self._validate_userid_signature(user)
File "/home/cosmin/.virtualenvs/raiden/lib/python3.6/site-packages/cachetools/__init__.py", line 87, in wrapper
v = method(self, *args, **kwargs)
File "/home/cosmin/Documents/WORK/GITHUB/raiden/raiden/network/transport/matrix.py", line 874, in _validate_userid_signature
displayname = user.get_display_name()
Welcome to Raiden, version 0.5.2.dev69+g39936e5b!
----------------------------------------------------------------------
| This is an Alpha version of experimental open source software |
| released under the MIT license and may contain errors and/or bugs. |
| Use of the software is at your own risk and discretion. No |
| guarantee whatsoever is made regarding its suitability for your |
| intended purposes and its compliance with applicable law and |
| regulations. It is up to the user to determine the software´s |
| quality and suitability and whether its use is compliant with its |
| respective regulatory regime, especially in the case that you are |
Traceback (most recent call last):
File "/home/cosmin/.virtualenvs/raiden/bin/raiden", line 11, in <module>
load_entry_point('raiden', 'console_scripts', 'raiden')()
File "/home/cosmin/Documents/WORK/GITHUB/raiden/raiden/__main__.py", line 11, in main
run(auto_envvar_prefix='RAIDEN') # pylint: disable=no-value-for-parameter
File "/home/cosmin/.virtualenvs/raiden/lib/python3.6/site-packages/click/core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "/home/cosmin/.virtualenvs/raiden/lib/python3.6/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/home/cosmin/.virtualenvs/raiden/lib/python3.6/site-packages/click/core.py", line 1043, in invoke
2018-08-22 15:15:10 [debug ] JSONRPCClient created [raiden.network.rpc.client] available_nonce=130 sender=8a0ce8bd
2018-08-22 15:15:34 [debug ] Matrix homeserver RTT times [raiden.network.transport.matrix] rtt_times=[('https://transport03.raiden.network', 0.024615666666666664), ('https://transport01.raiden.network', 0.03385766666666667), ('https://transport02.raiden.network', 0.13154366666666664)]
2018-08-22 15:15:34 [info ] Automatically selecting matrix homeserver based on RTT [raiden.network.transport.matrix] homeserver=https://transport03.raiden.network rtt=0.024615666666666664
2018-08-22 15:15:39 [info ] Lock 140512549059496 acquired on /home/cosmin/.raiden/netid_3/8a0ce8bd/.lock [filelock]
2018-08-22 15:15:39 [debug ] Restoring from snapshot [raiden.storage.wal]
2018-08-22 15:15:39 [debug ] Replaying state changes [raiden.storage.wal] num_state_changes=4264
2018-08-22 15:16:18 [debug ] Restored state from WAL [raiden.raiden_service] last_restored
kedTransfer", "chain_id": 3, "message_identifier": 2755282458377241524, "payment_identifier": 1535375290695, "nonce": 1, "token_network_address": "0x9fe1f19d8c0d2591fd01486e575b44f4220ef241", "token": "0x0f114a1e9db192502e7856309cc899952b3db1ed", "channel_identifier": 135, "transferred_amount": 0, "locked_amount": 3, "recipient": "0x008311788dff04e3c0426a3eb19622b2035ba49d", "locksroot": "0x7ce2d272092b93eee56023e0557fb5d2b03dc77662bee65073edbf4ed894f1c6", "lock": {"type": "Lock", "amount": 3, "expiration": 3919865, "secrethash": "0x3a6898a1a592e0d4d121eb683cd6a455a68dd8edbddfd4d263d39c6380d22a33"}, "target": "0x008311788dff04e3c0426a3eb19622b2035ba49d", "initiator": "0x6738746934688d3b0a28832ab6fb4aff979f7c4a", "fee": 0, "signature": "0xa40be3a45eed6f58ba61055f7fdf79408852b123e7213dc2ad6eee74a76ea81100a20f7b6dd42c362b33edb7348bc587f045bb7edc6ce72ac1cfeaa9c7e31c071b"} room=<Room id="!YNAdfghBaIkadUCCRU:transport03.raiden.network" alias="#raiden_ropsten_0x008311788dff04e3c0426a3eb19622b2035ba49d_0x67387469346
This file has been truncated, but you can view the full file.
2018-08-28 09:12:56 [debug ] JSONRPCClient created [raiden.network.rpc.client] available_nonce=13 sender=808fefd9
2018-08-28 09:13:00 [debug ] Matrix homeserver RTT times [raiden.network.transport.matrix] rtt_times=[('https://transport03.raiden.network', 0.022293999999999998), ('https://transport01.raiden.network', 0.114384), ('https://transport02.raiden.network', 0.12312766666666668)]
2018-08-28 09:13:00 [info ] Automatically selecting matrix homeserver based on RTT [raiden.network.transport.matrix] homeserver=https://transport03.raiden.network rtt=0.022293999999999998
2018-08-28 09:13:00 [info ] Lock 140340473822904 acquired on /home/cosmin/.raiden/netid_3/808fefd9/.lock [filelock]
2018-08-28 09:13:00 [debug ] No snapshot found, replaying all state changes [raiden.storage.wal]
2018-08-28 09:13:00 [debug ] Replaying state changes [raiden.storage.wal] num_state_changes=0
2018-08-28 09:13:00 [debug ] No recoverable state available, created inital state [raiden.raiden
@CosminNechifor
CosminNechifor / Script
Created August 28, 2018 10:11
Script I've used to send the payments
import requests
import click
def perform_request(token_address, partner_address, transaction_num):
url = f'http://localhost:5001/api/1/payments/{token_address}/{partner_address}'
print(f'post on:{url}')
requests.post(
url,
headers={'Content-Type': 'application/json'},
json={'amount': 1},
(raiden) ➜ Documents python sender.py
post on:http://localhost:5001/api/1/payments/0x0f114A1E9Db192502E7856309cc899952b3db1ED/0x2A93dd057fFBa07d0DAFFfbfA534C09e457c40d7
Post executed
post on:http://localhost:5001/api/1/payments/0x0f114A1E9Db192502E7856309cc899952b3db1ED/0x2A93dd057fFBa07d0DAFFfbfA534C09e457c40d7
Post executed
post on:http://localhost:5001/api/1/payments/0x0f114A1E9Db192502E7856309cc899952b3db1ED/0x2A93dd057fFBa07d0DAFFfbfA534C09e457c40d7
Post executed
post on:http://localhost:5001/api/1/payments/0x0f114A1E9Db192502E7856309cc899952b3db1ED/0x2A93dd057fFBa07d0DAFFfbfA534C09e457c40d7
Post executed
post on:http://localhost:5001/api/1/payments/0x0f114A1E9Db192502E7856309cc899952b3db1ED/0x2A93dd057fFBa07d0DAFFfbfA534C09e457c40d7
This file has been truncated, but you can view the full file.
2018-08-28 09:12:56 [debug ] JSONRPCClient created [raiden.network.rpc.client] available_nonce=13 sender=808fefd9
2018-08-28 09:13:00 [debug ] Matrix homeserver RTT times [raiden.network.transport.matrix] rtt_times=[('https://transport03.raiden.network', 0.022293999999999998), ('https://transport01.raiden.network', 0.114384), ('https://transport02.raiden.network', 0.12312766666666668)]
2018-08-28 09:13:00 [info ] Automatically selecting matrix homeserver based on RTT [raiden.network.transport.matrix] homeserver=https://transport03.raiden.network rtt=0.022293999999999998
2018-08-28 09:13:00 [info ] Lock 140340473822904 acquired on /home/cosmin/.raiden/netid_3/808fefd9/.lock [filelock]
2018-08-28 09:13:00 [debug ] No snapshot found, replaying all state changes [raiden.storage.wal]
2018-08-28 09:13:00 [debug ] Replaying state changes [raiden.storage.wal] num_state_changes=0
2018-08-28 09:13:00 [debug ] No recoverable state available, created inital state [raiden.raiden