Skip to content

Commit bd8a780

Browse files
hackaugustopalango
authored andcommitted
Documentation for the tools [skip tests]
- This also moved the kill_if_no_output.py to the .circleci folder, since the tool is only useful for the CI. - It also makes sure every tool is executable and has a hash-bang, which uses the `/bin/env` instead of the system binaries.
1 parent 6a4156c commit bd8a780

File tree

9 files changed

+118
-39
lines changed

9 files changed

+118
-39
lines changed

.circleci/run_tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ dormant_timeout=570
2424
# raiden/tests/conftest.py::auto_enable_gevent_monitoring_signal
2525
dormant_signal=SIGUSR1
2626

27-
./tools/kill_if_no_output.py \
27+
./.circleci/kill_if_no_output.py \
2828
--dormant-timeout=${dormant_timeout} \
2929
--dormant-signal=${dormant_signal} \
3030
--kill-timeout=15 \

tools/README.md

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
tools
2+
-----
3+
4+
- `parallel_tests.sh`: Tool to execute the test suite in parallel, useful to
5+
run multiple integration tests at the same time.
6+
- `startcluster.py`: This tool will generate a genesis file with a few
7+
pre-funded accounts to be used as Raidne accounts, and then run a local
8+
Geth private chain, useful for debugging.
9+
- `genesis_builder.py`: This tool will generate a genesis file.
10+
- `transfer_eth.py`: This is just a simple tool to send a eth transfer using
11+
the provided private key.
12+
13+
debugging
14+
---------
15+
16+
- `mint.sh`: Tool to mint test tokens. Usage:
17+
18+
```sh
19+
./mint.sh 0xf9BA8aDF7F7024D7de8eB37b4c981CFFe3C88Ea7 127.0.0.1:5001 127.0.0.1:5002 127.0.0.1:5000
20+
```
21+
22+
The first argument is the test token with the `mintFor` function, the others
23+
are endpoints of running Raiden nodes.
24+
25+
Note: Each of the running nodes must have test ETH on their accounts.
26+
27+
- `channels_with_minimum_balance.py`: Tool to open multiple channels. It needs
28+
a JSON file with the following format:
29+
30+
31+
```json
32+
{
33+
"networks": {
34+
"0xf9BA8aDF7F7024D7de8eB37b4c981CFFe3C88Ea7": [
35+
{
36+
"node1": "node0",
37+
"minimum_capacity1": 1130220,
38+
"node2": "node1",
39+
"minimum_capacity2": 1130220
40+
},
41+
{
42+
"node1": "node1",
43+
"minimum_capacity1": 1130220,
44+
"node2": "node2",
45+
"minimum_capacity2": 1130220
46+
}
47+
]
48+
},
49+
"nodes": {
50+
"node0": {
51+
"address": "0x5c11cc525590d9Ff8C7E4Af1704A39Df6c3884b5",
52+
"endpoint": "http://127.0.0.1:5000"
53+
},
54+
"node1": {
55+
"address": "0xa9FA88442c404716623155d150c526D8F1ae82E5",
56+
"endpoint": "http://127.0.0.1:5001"
57+
},
58+
"node2": {
59+
"address": "0x9df878E37C4B851bbe44841e72299F6f317C685C",
60+
"endpoint": "http://127.0.0.1:5005"
61+
}
62+
}
63+
}
64+
```
65+
66+
Under `networks` we have the *token address*, and under each token address
67+
there is a list of channels. The channels have the description of the minimum
68+
capacity and both participants. If the node happens to already have a channel
69+
with the partner, and the capacity is equal-or-over the minimum amount, nothing
70+
is done. If the channel exists and there is not sufficient balance, the script
71+
will do a deposit. If the channel does not exist the script will open it.
72+
73+
The key `nodes` gives the local endpoint of *running* Raiden nodes, which the
74+
script will use. Each key in `nodes` dictionary defines a name, these names are
75+
then used as `node1` and `node2` to define the channel participants.
76+
77+
Note: Each of the running nodes must have test ETH on their accounts.
78+
Note: For the deposit to work properly the nodes must have some of the required
79+
tokens, for a test token one can use `mint.sh` to acquire some.
80+
81+
- `stress_test_transfers.py`: Script to run nodes and do some transfers. The
82+
- script requires a configuration file, like so:
83+
84+
```ini
85+
[DEFAULT]
86+
keystore-path = ./keys
87+
eth-rpc-endpoint = parity.goerli.ethnodes.brainbot.com:8545
88+
network-id = goerli
89+
token-address = 0xf9BA8aDF7F7024D7de8eB37b4c981CFFe3C88Ea7
90+
pathfinding-service-address = https://pfs-goerli.services-dev.raiden.network
91+
92+
[node1]
93+
address = 0x5c11cc525590d9Ff8C7E4Af1704A39Df6c3884b5
94+
password-file = ./keys/pass-UTC--2019-11-22T13-47-42.489814312Z--5c11cc525590d9ff8c7e4af1704a39df6c3884b5
95+
96+
[node2]
97+
address = 0xa9FA88442c404716623155d150c526D8F1ae82E5
98+
password-file = ./keys/pass-UTC--2019-11-22T13-49-45.745576867Z--a9fa88442c404716623155d150c526d8f1ae82e5
99+
100+
[node3]
101+
address = 0x9df878E37C4B851bbe44841e72299F6f317C685C
102+
password-file = ./keys/pass-UTC--2019-11-22T13-50-19.904075843Z--9df878e37c4b851bbe44841e72299f6f317c685c
103+
```
104+
105+
This script does not take into account fees, therefore it must the no-fee PFS
106+
(as per the example configuration above).
107+
108+
pylint
109+
------
110+
111+
- `assert_checker.py`: Style tool that requires messages to all asserts.
112+
- `gevent_checker.py`: Enforces some rules regarding gevent that are necessary
113+
for Raiden to work properly.

tools/check_circleci_config.py

100644100755
File mode changed.

tools/debugging/gather-test-addresses.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/usr/bin/env python
12
import json
23
import re
34
import string

tools/debugging/stress_test_transfers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ def run_stress_test(
442442

443443
config = StressTestConfiguration(
444444
initiator_target_pairs=[paths_for_mediated_transfers(running_nodes)],
445-
concurrency=[10],
445+
concurrency=[50],
446446
planners=[do_fifty_transfer_up_to],
447447
schedulers=[scheduler_preserve_order],
448448
)

tools/dummy_resolver_server.py

100644100755
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/usr/bin/env python
12
import json
23
import logging
34
from hashlib import sha256

tools/gas_cost_measures.py

100644100755
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/usr/bin/env python
12
from os import urandom
23

34
# increase block gas limit

tools/genesis_builder.py

Lines changed: 0 additions & 37 deletions
This file was deleted.

0 commit comments

Comments
 (0)