Skip to content

Commit

Permalink
Rollback the timelord changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mariano54 committed May 20, 2022
1 parent c7f619d commit 81a37ee
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 13 deletions.
24 changes: 16 additions & 8 deletions tests/setup_nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,11 @@ async def setup_full_system(
introducer_iter = setup_introducer(shared_b_tools, uint16(0))
introducer, introducer_server = await introducer_iter.__anext__()

timelord1_port = find_available_listen_port("timelord1")
timelord2_port = find_available_listen_port("timelord2")
vdf1_port = find_available_listen_port("vdf1")
vdf2_port = find_available_listen_port("vdf2")

# Then start the full node so we can use the port for the farmer and timelord
full_node_1_iter = setup_full_node(
consensus_constants,
Expand Down Expand Up @@ -458,25 +463,25 @@ async def setup_full_system(
farmer_port,
consensus_constants,
)
timelord_iter = setup_timelord(full_node_1_port, uint16(0), uint16(0), False, consensus_constants, b_tools)
timelord, _ = await timelord_iter.__anext__()
timelord_port = timelord.timelord.get_vdf_server_port()
timelord_iter = setup_timelord(
timelord2_port, full_node_1_port, uint16(0), vdf1_port, False, consensus_constants, b_tools
)
# timelord_port = timelord.timelord.get_vdf_server_port()

timelord_bluebox_iter = setup_timelord(
full_node_2_port, uint16(0), uint16(0), True, consensus_constants, b_tools_1
timelord1_port, 1000, uint16(0), vdf2_port, True, consensus_constants, b_tools_1
)
timelord_bluebox, timelord_bluebox_server = await timelord_bluebox_iter.__anext__()
timelord_bluebox_port = timelord_bluebox.timelord.get_vdf_server_port()
# timelord_bluebox_port = timelord_bluebox.timelord.get_vdf_server_port()

node_iters = [
introducer_iter,
harvester_iter,
farmer_iter,
setup_vdf_clients(shared_b_tools, shared_b_tools.config["self_hostname"], timelord_port),
setup_vdf_clients(shared_b_tools, shared_b_tools.config["self_hostname"], vdf1_port),
timelord_iter,
full_node_1_iter,
full_node_2_iter,
setup_vdf_client(shared_b_tools, shared_b_tools.config["self_hostname"], timelord_bluebox_port),
setup_vdf_client(shared_b_tools, shared_b_tools.config["self_hostname"], vdf2_port),
timelord_bluebox_iter,
]
if connect_to_daemon:
Expand All @@ -492,7 +497,10 @@ async def num_connections():
await time_out_assert_custom_interval(10, 3, num_connections, 1)

vdf_clients = await node_iters[3].__anext__()
timelord, _ = await timelord_iter.__anext__()

vdf_bluebox_clients = await node_iters[7].__anext__()
timelord_bluebox, timelord_bluebox_server = await timelord_bluebox_iter.__anext__()

ret = (
node_api_1,
Expand Down
16 changes: 11 additions & 5 deletions tests/setup_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,9 @@ def stop():


async def setup_vdf_clients(bt: BlockTools, self_hostname: str, port):
vdf_task_1 = asyncio.create_task(spawn_process(self_hostname, port, 1, False))
vdf_task_2 = asyncio.create_task(spawn_process(self_hostname, port, 2, False))
vdf_task_3 = asyncio.create_task(spawn_process(self_hostname, port, 3, False))
vdf_task_1 = asyncio.create_task(spawn_process(self_hostname, port, 1, bt.config.get("prefer_ipv6")))
vdf_task_2 = asyncio.create_task(spawn_process(self_hostname, port, 2, bt.config.get("prefer_ipv6")))
vdf_task_3 = asyncio.create_task(spawn_process(self_hostname, port, 3, bt.config.get("prefer_ipv6")))

def stop():
asyncio.create_task(kill_processes())
Expand All @@ -335,13 +335,19 @@ def stop():


async def setup_timelord(
full_node_port, rpc_port, vdf_port, sanitizer, consensus_constants: ConsensusConstants, b_tools: BlockTools
port,
full_node_port,
rpc_port,
vdf_port,
sanitizer,
consensus_constants: ConsensusConstants,
b_tools: BlockTools,
):
config = b_tools.config["timelord"]
config["port"] = port
config["full_node_peer"]["port"] = full_node_port
config["bluebox_mode"] = sanitizer
config["fast_algorithm"] = False
config["vdf_server"]["host"] = "0.0.0.0"
config["vdf_server"]["port"] = vdf_port
config["start_rpc_server"] = True
config["rpc_port"] = rpc_port
Expand Down

0 comments on commit 81a37ee

Please sign in to comment.