Merge branch 'datalayer-sim' into atari-merge_datalayer_sim_779e5fd690cb6bcd3936b348708ea72a6fa236b4

This commit is contained in:
Kyle Altendorf 2022-05-02 16:51:54 -04:00
commit c56ef66aaa
No known key found for this signature in database
GPG Key ID: 5715D880FF005192
5 changed files with 10 additions and 1 deletions

View File

@ -163,6 +163,7 @@ def configure(
config["ui"]["selected_network"] = net
config["introducer"]["selected_network"] = net
config["wallet"]["selected_network"] = net
config["data_layer"]["selected_network"] = net
if "seeder" in config:
config["seeder"]["port"] = int(mainnet_port)

View File

@ -311,13 +311,16 @@ async def start_rpc_server(
root_path: Path,
net_config,
connect_to_daemon=True,
max_request_body_size=None,
):
"""
Starts an HTTP server with the following RPC methods, to be used by local clients to
query the node.
"""
try:
app = web.Application()
if max_request_body_size is None:
max_request_body_size = 1024 ** 2
app = web.Application(client_max_size=max_request_body_size)
rpc_server = RpcServer(rpc_api, rpc_api.service_name, stop_cb, root_path, net_config)
rpc_server.rpc_api.service._set_state_changed_callback(rpc_server.state_changed)
app.add_routes([web.post(route, wrap_http_handler(func)) for (route, func) in rpc_server.get_routes().items()])

View File

@ -42,6 +42,7 @@ def service_kwargs_for_data_layer(
advertised_port=dl_config["port"],
service_name=SERVICE_NAME,
network_id=network_id,
max_request_body_size=dl_config.get("rpc_server_max_request_body_size", 26214400),
)
port = dl_config.get("port")

View File

@ -54,6 +54,7 @@ class Service:
connect_to_daemon=True,
running_new_process=True,
service_name_prefix="",
max_request_body_size=None,
) -> None:
self.root_path = root_path
self.config = load_config(root_path, "config.yaml")
@ -67,6 +68,7 @@ class Service:
self._rpc_task: Optional[asyncio.Task] = None
self._rpc_close_task: Optional[asyncio.Task] = None
self._network_id: str = network_id
self.max_request_body_size = max_request_body_size
self._running_new_process = running_new_process
# when we start this service as a component of an existing process,
@ -179,6 +181,7 @@ class Service:
self.root_path,
self.config,
self._connect_to_daemon,
max_request_body_size=self.max_request_body_size,
)
)

View File

@ -566,6 +566,7 @@ data_layer:
start_rpc_server: True
# TODO: what considerations are there in choosing this?
rpc_port: 8562
rpc_server_max_request_body_size: 26214400
fee: 1000000000
logging: *logging