Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions mytoninstaller/mytoninstaller.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ def Init(local, console):
# create variables
local.buffer.user = get_current_user()
local.buffer.vuser = "validator"
local.buffer.cport = random.randint(2000, 65000)
local.buffer.lport = random.randint(2000, 65000)
local.buffer.cport = int(os.getenv('VALIDATOR_CONSOLE_PORT', random.randint(2000, 65000)))
local.buffer.lport = int(os.getenv('LITESERVER_PORT', random.randint(2000, 65000)))
local.buffer.vport = int(os.getenv('VALIDATOR_PORT', random.randint(2000, 65000)))

# this funciton injects MyPyClass instance
def inject_globals(func):
Expand Down
8 changes: 5 additions & 3 deletions mytoninstaller/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ def FirstNodeSettings(local):
validatorAppPath = local.buffer.validator_app_path
globalConfigPath = local.buffer.global_config_path
vconfig_path = local.buffer.vconfig_path
vport = local.buffer.vport

if os.getenv('ARCHIVE_TTL'):
archive_ttl = int(os.getenv('ARCHIVE_TTL'))
Expand Down Expand Up @@ -100,9 +101,10 @@ def FirstNodeSettings(local):

add2systemd(name="validator", user=vuser, start=cmd, pre='/bin/sleep 2') # post="/usr/bin/python3 /usr/src/mytonctrl/mytoncore.py -e \"validator down\""

# Получить внешний ip адрес
ip = get_own_ip()
vport = random.randint(2000, 65000)
if os.getenv('PUBLIC_IP'):
ip = os.getenv('PUBLIC_IP')
else:
ip = get_own_ip()
addr = "{ip}:{vport}".format(ip=ip, vport=vport)
local.add_log("Use addr: " + addr, "debug")

Expand Down