Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set working directory for node processes in supervisor #78

Merged
merged 3 commits into from
Nov 28, 2022
Merged
Changes from 1 commit
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
17 changes: 9 additions & 8 deletions pystarport/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,8 @@ def custom_edit_tm(doc):
ini[section].update(
dict(
COMMON_PROG_OPTIONS,
command=f"{self.cmd} start --home %(here)s/node{i}",
directory=f"%(here)s/node{i}",
command=f"{self.cmd} start --home .",
yihuang marked this conversation as resolved.
Show resolved Hide resolved
autostart="false",
stdout_logfile=f"%(here)s/node{i}.log",
)
Expand Down Expand Up @@ -994,10 +995,8 @@ def init_cluster(
# restore the relayer account in relayer
for chain in chains:
relayer = chain.get("key_name", "relayer")
mnemonic = find_account(
data_dir, chain["chain_id"], relayer
)["mnemonic"]
mnemonic_path = (Path(data_dir) / "relayer.env")
mnemonic = find_account(data_dir, chain["chain_id"], relayer)["mnemonic"]
mnemonic_path = Path(data_dir) / "relayer.env"
mnemonic_path.write_text(mnemonic)
subprocess.run(
[
Expand Down Expand Up @@ -1028,7 +1027,8 @@ def supervisord_ini(cmd, validators, chain_id, start_flags=""):
for i, node in enumerate(validators):
ini[f"program:{chain_id}-node{i}"] = dict(
COMMON_PROG_OPTIONS,
command=f"{cmd} start --home %(here)s/node{i} {start_flags}",
directory=f"%(here)s/node{i}",
command=f"{cmd} start --home . {start_flags}",
yihuang marked this conversation as resolved.
Show resolved Hide resolved
stdout_logfile=f"%(here)s/node{i}.log",
)
return ini
Expand Down Expand Up @@ -1057,8 +1057,9 @@ def supervisord_ini_group(chain_ids):
}
cfg["program:relayer-demo"] = dict(
COMMON_PROG_OPTIONS,
command=("hermes --config %(here)s/relayer.toml start"),
stdout_logfile="%(here)s/relayer-demo.log",
directory="%(here)s",
command=("hermes --config relayer.toml start"),
yihuang marked this conversation as resolved.
Show resolved Hide resolved
stdout_logfile="relayer-demo.log",
yihuang marked this conversation as resolved.
Show resolved Hide resolved
autostart="false",
)
return cfg
Expand Down