Skip to content

Commit cbb9b9a

Browse files
V120 (#77)
* Update download.py * Update test_node.py * rename ci workflows name worklows and format code * Add RPC send_transaction should not include stack trace in the RPC response fix test * Add RPC send_transaction should not include stack trace in the RPC response fix test rename case * Update download.py * test 120-rc4 * test 120-rc4 format code * upgrade light-client * upgrade light-client * black ws.py * Update ci_integration_tests.yml * add 4702 testcase * add zhushi 4702 testcase * Update ci_integration_tests.yml * fix 4702 * update ws and 112 * update node * fix ci ws test failed --------- Co-authored-by: 15168316096 <15168316096@163.com>
1 parent eae6ac7 commit cbb9b9a

19 files changed

+1089
-26
lines changed

.github/workflows/ci_integration_tests.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@ permissions:
1515
jobs:
1616
build:
1717

18-
runs-on: ubuntu-22.04
18+
runs-on: ${{ matrix.os }}
19+
strategy:
20+
matrix:
21+
os: [ubuntu-22.04]
22+
23+
# os: [ubuntu-22.04, macos-latest]
24+
1925

2026
steps:
2127
- uses: actions/checkout@v3

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ test_cases := \
4040
test_cases/feature \
4141
test_cases/config \
4242
test_cases/miner \
43-
test_cases/get_fee_rate_statistics
43+
test_cases/get_fee_rate_statistics \
44+
test_cases/ws
4445

4546

4647
test:

download.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"0.117.0",
2424
"0.118.0",
2525
"0.119.0",
26+
"0.120.0",
2627
] # Replace with your versions
2728

2829
DOWNLOAD_DIR = "download"

download_ckb_light_client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"0.3.4",
2222
"0.3.5",
2323
"0.3.6",
24+
"0.4.1",
2425
] # Replace with your versions
2526

2627
DOWNLOAD_DIR = "download"

framework/test_light_client.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,14 @@ class CkbLightClientConfigPath(Enum):
3939
"download/0.3.6/ckb-light-client",
4040
)
4141

42+
V0_4_1 = (
43+
"source/template/ckb_light_client/0.3.0/testnet.toml.j2",
44+
"download/0.4.2/ckb-light-client",
45+
)
46+
4247
CURRENT_TEST = (
4348
"source/template/ckb_light_client/0.3.0/testnet.toml.j2",
44-
"download/0.3.6/ckb-light-client",
49+
"download/0.4.1/ckb-light-client",
4550
)
4651

4752
def __init__(self, ckb_light_client_config_path, ckb_light_bin_path):

framework/test_node.py

Lines changed: 40 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,30 +15,37 @@
1515

1616
class CkbNodeConfigPath(Enum):
1717
CURRENT_TEST = (
18-
"source/template/ckb/v118/ckb.toml.j2",
19-
"source/template/ckb/v118/ckb-miner.toml.j2",
20-
"source/template/ckb/v118/specs/dev.toml",
21-
"download/0.119.0",
18+
"source/template/ckb/v120/ckb.toml.j2",
19+
"source/template/ckb/v120/ckb-miner.toml.j2",
20+
"source/template/ckb/v120/specs/dev.toml",
21+
"download/0.120.0",
2222
)
2323
TESTNET = (
24-
"source/template/ckb/v118/ckb.toml.j2",
25-
"source/template/ckb/v118/ckb-miner.toml.j2",
24+
"source/template/ckb/v120/ckb.toml.j2",
25+
"source/template/ckb/v120/ckb-miner.toml.j2",
2626
"source/template/specs/testnet.toml.j2",
27-
"download/0.119.0",
27+
"download/0.120.0",
2828
)
2929

3030
CURRENT_MAIN = (
31-
"source/template/ckb/v118/ckb.toml.j2",
32-
"source/template/ckb/v118/ckb-miner.toml.j2",
31+
"source/template/ckb/v120/ckb.toml.j2",
32+
"source/template/ckb/v120/ckb-miner.toml.j2",
3333
"source/template/specs/mainnet.toml.j2",
34-
"download/0.119.0",
34+
"download/0.120.0",
3535
)
3636

3737
PREVIEW_DUMMY = (
38-
"source/template/ckb/v118/ckb.toml.j2",
39-
"source/template/ckb/v118/ckb-miner.toml.j2",
38+
"source/template/ckb/v120/ckb.toml.j2",
39+
"source/template/ckb/v120/ckb-miner.toml.j2",
4040
"source/template/specs/preview_dev.toml",
41-
"download/0.119.0",
41+
"download/0.120.0",
42+
)
43+
44+
v120 = (
45+
"source/template/ckb/v120/ckb.toml.j2",
46+
"source/template/ckb/v120/ckb-miner.toml.j2",
47+
"source/template/ckb/v120/specs/dev.toml",
48+
"download/0.120.0",
4249
)
4350

4451
v119 = (
@@ -211,6 +218,22 @@ def connected(self, node):
211218
peer_address = node.get_peer_address()
212219
print("add node response:", self.getClient().add_node(peer_id, peer_address))
213220

221+
def connected_ws(self, node):
222+
peer_id = node.get_peer_id()
223+
peer_address = node.get_peer_address()
224+
if "ws" not in peer_address:
225+
peer_address = peer_address + "/ws"
226+
print("add node response:", self.getClient().add_node(peer_id, peer_address))
227+
228+
def connected_all_address(self, node):
229+
peer_id = node.get_peer_id()
230+
node_info = node.client.local_node_info()
231+
for address in node_info["addresses"]:
232+
peer_address = address["address"].replace("0.0.0.0", "127.0.0.1")
233+
print(
234+
"add node response:", self.getClient().add_node(peer_id, peer_address)
235+
)
236+
214237
def getClient(self) -> RPCClient:
215238
return self.client
216239

@@ -262,6 +285,9 @@ def stop(self):
262285
self.ckb_pid = -1
263286
time.sleep(3)
264287

288+
def rmLockFile(self):
289+
run_command(f"cd {self.ckb_dir} && rm -rf data/db/LOCK")
290+
265291
def prepare(
266292
self,
267293
other_ckb_config={},
@@ -365,6 +391,7 @@ def subscribe_telnet(self, topic, other_url=None) -> telnetlib.Telnet:
365391
+ topic
366392
+ '"]}'
367393
)
394+
print(f"host:{host},port:{port},topic_str:{topic_str}")
368395
tn.write(topic_str.encode("utf-8") + b"\n")
369396
data = tn.read_until(b"}\n")
370397
if data:
0 Bytes
Binary file not shown.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Config generated by `ckb init --chain dev`
2+
3+
data_dir = "{{ ckb_miner_data_dir | default(ckb_data_dir) }}"
4+
5+
[chain]
6+
{# Choose the kind of chains to run, possible values: #}
7+
{# - { file = "specs/dev.toml" } #}
8+
{# - { bundled = "specs/testnet.toml" } #}
9+
{# - { bundled = "specs/mainnet.toml" } #}
10+
spec = {{ ckb_chain_spec }}
11+
12+
13+
[logger]
14+
filter = "{{ ckb_miner_logger_filter | default("info") }}"
15+
color = {{ ckb_miner_logger_color | default("true") }}
16+
log_to_file = {{ ckb_miner_logger_log_to_file | default("true") }}
17+
log_to_stdout = {{ ckb_miner_logger_log_to_stdout | default("true") }}
18+
19+
[sentry]
20+
# set to blank to disable sentry error collection
21+
dsn = "{{ ckb_miner_sentry_dsn | default("") }}"
22+
# if you are willing to help us to improve,
23+
# please leave a way to contact you when we have troubles to reproduce the errors.
24+
# org_contact = "{{ ckb_miner_sentry_org_contact | default() }}"
25+
26+
[miner.client]
27+
rpc_url = "http://{{ ckb_miner_rpc_url | default("127.0.0.1:8114") }}"
28+
block_on_submit = {{ ckb_miner_block_on_submit | default("true") }}
29+
30+
# block template polling interval in milliseconds
31+
poll_interval = {{ ckb_miner_poll_interval | default("1000") }}
32+
33+
#{% if ckb_miner_workers is defined %}
34+
# {% for worker in ckb_miner_workers %}
35+
# [[miner.workers]]
36+
# worker_type = "{{ worker.worker_type }}"
37+
# delay_type = "{{ worker.delay_type }}"
38+
# value = {{ worker.value }}
39+
# {% endfor %}
40+
#{% else %}
41+
[[miner.workers]]
42+
worker_type = "Dummy"
43+
delay_type = "Constant"
44+
value = 1000
45+
#{% endif %}

0 commit comments

Comments
 (0)