mirror of
https://github.com/0glabs/0g-storage-node.git
synced 2025-04-04 15:35:18 +00:00
fix float issue
This commit is contained in:
parent
071185120d
commit
b532b205b4
@ -11,6 +11,7 @@ class PortMin:
|
|||||||
|
|
||||||
|
|
||||||
MAX_NODES = 100
|
MAX_NODES = 100
|
||||||
|
MAX_BLOCKCHAIN_NODES = 50
|
||||||
|
|
||||||
|
|
||||||
def p2p_port(n):
|
def p2p_port(n):
|
||||||
@ -23,25 +24,25 @@ def rpc_port(n):
|
|||||||
|
|
||||||
|
|
||||||
def blockchain_p2p_port(n):
|
def blockchain_p2p_port(n):
|
||||||
assert MAX_NODES % 2 == 0 and n <= MAX_NODES / 2
|
assert n <= MAX_BLOCKCHAIN_NODES
|
||||||
return PortMin.n + 3 * MAX_NODES / 2 + n
|
return PortMin.n + MAX_NODES + MAX_BLOCKCHAIN_NODES + n
|
||||||
|
|
||||||
|
|
||||||
def blockchain_rpc_port(n):
|
def blockchain_rpc_port(n):
|
||||||
return PortMin.n + 4 * MAX_NODES / 2 + n
|
return PortMin.n + MAX_NODES + 2 * MAX_BLOCKCHAIN_NODES + n
|
||||||
|
|
||||||
|
|
||||||
def blockchain_rpc_port_core(n):
|
def blockchain_rpc_port_core(n):
|
||||||
return PortMin.n + 5 * MAX_NODES / 2 + n
|
return PortMin.n + MAX_NODES + 3 * MAX_BLOCKCHAIN_NODES + n
|
||||||
|
|
||||||
def blockchain_ws_port(n):
|
def blockchain_ws_port(n):
|
||||||
return PortMin.n + 6 * MAX_NODES / 2 + n
|
return PortMin.n + MAX_NODES + 4 * MAX_BLOCKCHAIN_NODES + n
|
||||||
|
|
||||||
def blockchain_rpc_port_tendermint(n):
|
def blockchain_rpc_port_tendermint(n):
|
||||||
return PortMin.n + 7 * MAX_NODES / 2 + n
|
return PortMin.n + MAX_NODES + 5 * MAX_BLOCKCHAIN_NODES + n
|
||||||
|
|
||||||
def pprof_port(n):
|
def pprof_port(n):
|
||||||
return PortMin.n + 8 * MAX_NODES / 2 + n
|
return PortMin.n + MAX_NODES + 6 * MAX_BLOCKCHAIN_NODES + n
|
||||||
|
|
||||||
def wait_until(predicate, *, attempts=float("inf"), timeout=float("inf"), lock=None):
|
def wait_until(predicate, *, attempts=float("inf"), timeout=float("inf"), lock=None):
|
||||||
if attempts == float("inf") and timeout == float("inf"):
|
if attempts == float("inf") and timeout == float("inf"):
|
||||||
|
Loading…
Reference in New Issue
Block a user