|
15 | 15 |
|
16 | 16 | class CkbNodeConfigPath(Enum):
|
17 | 17 | 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", |
22 | 22 | )
|
23 | 23 | 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", |
26 | 26 | "source/template/specs/testnet.toml.j2",
|
27 |
| - "download/0.119.0", |
| 27 | + "download/0.120.0", |
28 | 28 | )
|
29 | 29 |
|
30 | 30 | 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", |
33 | 33 | "source/template/specs/mainnet.toml.j2",
|
34 |
| - "download/0.119.0", |
| 34 | + "download/0.120.0", |
35 | 35 | )
|
36 | 36 |
|
37 | 37 | 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", |
40 | 40 | "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", |
42 | 49 | )
|
43 | 50 |
|
44 | 51 | v119 = (
|
@@ -211,6 +218,22 @@ def connected(self, node):
|
211 | 218 | peer_address = node.get_peer_address()
|
212 | 219 | print("add node response:", self.getClient().add_node(peer_id, peer_address))
|
213 | 220 |
|
| 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 | + |
214 | 237 | def getClient(self) -> RPCClient:
|
215 | 238 | return self.client
|
216 | 239 |
|
@@ -262,6 +285,9 @@ def stop(self):
|
262 | 285 | self.ckb_pid = -1
|
263 | 286 | time.sleep(3)
|
264 | 287 |
|
| 288 | + def rmLockFile(self): |
| 289 | + run_command(f"cd {self.ckb_dir} && rm -rf data/db/LOCK") |
| 290 | + |
265 | 291 | def prepare(
|
266 | 292 | self,
|
267 | 293 | other_ckb_config={},
|
@@ -365,6 +391,7 @@ def subscribe_telnet(self, topic, other_url=None) -> telnetlib.Telnet:
|
365 | 391 | + topic
|
366 | 392 | + '"]}'
|
367 | 393 | )
|
| 394 | + print(f"host:{host},port:{port},topic_str:{topic_str}") |
368 | 395 | tn.write(topic_str.encode("utf-8") + b"\n")
|
369 | 396 | data = tn.read_until(b"}\n")
|
370 | 397 | if data:
|
|
0 commit comments