From 0d5e673c413ef30707d20ea7b46fd039801cfb8a Mon Sep 17 00:00:00 2001 From: Andrew Nikitin Date: Mon, 4 Jul 2022 16:53:14 +0300 Subject: [PATCH 1/3] Add node_configs to gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 629bb9351..50b75bbec 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ # Tests **/network-config +**/node_configs # Python .pytest_cache From cc9d03d63fa18b76a770aaf06fee8098d6b5ee92 Mon Sep 17 00:00:00 2001 From: Andrew Nikitin Date: Tue, 5 Jul 2022 17:20:06 +0300 Subject: [PATCH 2/3] Some fixes during upgrade process Signed-off-by: Andrew Nikitin --- installer/installer.py | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/installer/installer.py b/installer/installer.py index 460091ae4..ce072f608 100644 --- a/installer/installer.py +++ b/installer/installer.py @@ -42,10 +42,10 @@ ############################################################### ### Systemd Config ### ############################################################### -STANDALONE_SERVICE_FILE = "https://raw.githubusercontent.com/cheqd/cheqd-node/de487a0cfc095d92bd579b142c7708f64b6f1536/build-tools/node-standalone.service" -COSMOVISOR_SERVICE_FILE = "https://raw.githubusercontent.com/cheqd/cheqd-node/de487a0cfc095d92bd579b142c7708f64b6f1536/build-tools/node-cosmovisor.service" -LOGROTATE_TEMPLATE = "https://raw.githubusercontent.com/cheqd/cheqd-node/de487a0cfc095d92bd579b142c7708f64b6f1536/build-tools/logrotate.conf" -RSYSLOG_TEMPLATE = "https://raw.githubusercontent.com/cheqd/cheqd-node/de487a0cfc095d92bd579b142c7708f64b6f1536/build-tools/rsyslog.conf" +STANDALONE_SERVICE_FILE = "https://raw.githubusercontent.com/cheqd/cheqd-node/main/build-tools/node-standalone.service" +COSMOVISOR_SERVICE_FILE = "https://raw.githubusercontent.com/cheqd/cheqd-node/main/build-tools/node-cosmovisor.service" +LOGROTATE_TEMPLATE = "https://raw.githubusercontent.com/cheqd/cheqd-node/main/build-tools/logrotate.conf" +RSYSLOG_TEMPLATE = "https://raw.githubusercontent.com/cheqd/cheqd-node/main/build-tools/rsyslog.conf" DEFAULT_STANDALONE_SERVICE_NAME = 'cheqd-noded' DEFAULT_COSMOVISOR_SERVICE_NAME = 'cheqd-cosmovisor' DEFAULT_STANDALONE_SERVICE_FILE_PATH = f"/lib/systemd/system/{DEFAULT_STANDALONE_SERVICE_NAME}.service" @@ -247,8 +247,7 @@ def get_binary(self): if fname.find(".tar.gz") != -1: self.exec(f"tar -xzf {fname}") self.remove_safe(fname) - else: - self.exec(f"mv {fname} {DEFAULT_BINARY_NAME}") + self.exec(f"chmod +x {DEFAULT_BINARY_NAME}") except: failure_exit("Failed to download binary") @@ -489,6 +488,15 @@ def setup_cosmovisor(self): self.log(f"Creating symlink to {self.cosmovisor_cheqd_bin_path}") os.symlink(self.cosmovisor_cheqd_bin_path, os.path.join(DEFAULT_INSTALL_PATH, DEFAULT_BINARY_NAME)) + + if self.interviewer.is_upgrade and \ + os.path.exists(os.path.join(self.cheqd_data_dir, "upgrade-info.json")): + + self.log(f"Copying upgrade-info.json file to cosmovisor/current/") + shutil.copy(os.path.join(self.cheqd_data_dir, "upgrade-info.json"), + os.path.join(self.cosmovisor_root_dir, "current")) + self.log(f"Changing owner to {DEFAULT_CHEQD_USER} user") + self.exec(f"chown -R {DEFAULT_CHEQD_USER}:{DEFAULT_CHEQD_USER} {self.cosmovisor_root_dir}") self.log(f"Changing directory ownership for Cosmovisor to {DEFAULT_CHEQD_USER} user") self.exec(f"chown -R {DEFAULT_CHEQD_USER}:{DEFAULT_CHEQD_USER} {self.cosmovisor_root_dir}") @@ -803,8 +811,8 @@ def ask_for_version(self): all_releases.insert(0, default) for i, release in enumerate(all_releases[0: LAST_N_RELEASES]): print(f"{i + 1}) {release.version}") - release_num = self.ask("Choose list option number above to select version of cheqd-node to install", - default=1) + release_num = int(self.ask("Choose list option number above to select version of cheqd-node to install", + default=1)) if release_num >= 1 and release_num <= len(all_releases): self.release = all_releases[release_num - 1] else: From 15ae3fd27fd9c05bf2cc2d7f1b740f20d4c8cf54 Mon Sep 17 00:00:00 2001 From: toktar Date: Wed, 6 Jul 2022 12:35:29 +0300 Subject: [PATCH 3/3] fix: Consensus issue with Resource.Created --- x/resource/keeper/msg_server_create_resource.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/resource/keeper/msg_server_create_resource.go b/x/resource/keeper/msg_server_create_resource.go index aea4be33c..3fdefe82e 100644 --- a/x/resource/keeper/msg_server_create_resource.go +++ b/x/resource/keeper/msg_server_create_resource.go @@ -48,7 +48,7 @@ func (k msgServer) CreateResource(goCtx context.Context, msg *types.MsgCreateRes resource := msg.Payload.ToResource() resource.Header.Checksum = sha256.New().Sum(resource.Data) - resource.Header.Created = time.Now().UTC().Format(time.RFC3339) + resource.Header.Created = ctx.BlockTime().Format(time.RFC3339) resource.Header.MediaType = utils.DetectMediaType(resource.Data) // Find previous version and upgrade backward and forward version links