Skip to content
Open
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
1 change: 1 addition & 0 deletions native/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ fill the environment file (in case of testnet it's `testnet.env`).

> [!NOTE]
> You can use your custom connect installation script (example for that is `install_skip.sh`). This one is customized to set a connect version to be installed (default installation script always installs binary with `latest` tag on it).
- `MEZOD_USER` - the user the node processes will run as (the v-kit.sh script should still be run with root or sudo for installation as indicated in Prerequisites)

### 2. Prepare installation script to run

Expand Down
1 change: 1 addition & 0 deletions native/testnet.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
export MEZOD_CHAIN_ID="mezo_31611-1"
export MEZOD_HOME="/var/mezod"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's worth noting that MEZOD_USER can have insufficient permissions for MEZOD_HOME. This can easily crash the installation, in order to avoid that I suggest adding a line or two about it in the docs.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some way of checking this in the script would also be a requirement. We have to ensure the script runs with proper parameters before even starting the installation.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the input. The script is still run as root and I added a function set_file_permissions() that runs before the processes are started with systemd.

Did you encounter an issue?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi! Sorry for the late reply. I would kindly ask you to sync the branch with the current validator-kit to avoid any conflicts. As soon as the branch is up to date, I will review and test the PR as soon as possible.

Since my full-time responsibilities have shifted away from the Mezo project, I wasn't able to complete the request quickly. Sorry for the inconvenience, and I hope we can resolve your contribution efficiently!

export MEZOD_MONIKER="<your_mezo_validator_name>"
export MEZOD_USER="root"

### Keyring ###
export MEZOD_KEYRING_MNEMONIC="<your_keyring_mnemonic>"
Expand Down
13 changes: 9 additions & 4 deletions native/v-kit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ install_mezo() {
download_binary ${MEZOD_DOWNLOAD_LINK} "verbose"
unpack_binary ${MEZOD_DESTINATION}

chown root:root ${MEZO_EXEC}
chown "${MEZOD_USER}":"${MEZOD_USER}" ${MEZO_EXEC}
chmod +x ${MEZO_EXEC}

echo "Mezo binary installed with path: ${MEZO_EXEC}"
Expand Down Expand Up @@ -229,7 +229,7 @@ ExecStartPre=/bin/echo "Starting connect-sidecar systemd initialization..."
ExecStart=${CONNECT_EXEC} --log-disable-file-rotation --port=${CONNECT_SIDECAR_PORT} --market-map-endpoint=\"127.0.0.1:9090\"
StandardOutput=journal
StandardError=journal
User=root
User=${MEZOD_USER}

[Install]
WantedBy=multi-user.target" | tee /etc/systemd/system/connect-sidecar.service
Expand All @@ -248,7 +248,7 @@ ExecStartPre=/bin/echo "Starting ethereum-sidecar systemd initialization..."
ExecStart=${MEZO_EXEC} ethereum-sidecar --log_format=${MEZOD_LOG_FORMAT} --ethereum-sidecar.server.ethereum-node-address=${MEZOD_ETHEREUM_SIDECAR_SERVER_ETHEREUM_NODE_ADDRESS}
StandardOutput=journal
StandardError=journal
User=root
User=${MEZOD_USER}

[Install]
WantedBy=multi-user.target" | tee /etc/systemd/system/ethereum-sidecar.service
Expand All @@ -267,13 +267,17 @@ ExecStartPre=/bin/echo "Starting mezod systemd initialization..."
ExecStart=${MEZO_EXEC} start --home=${MEZOD_HOME} --metrics
StandardOutput=journal
StandardError=journal
User=root
User=${MEZOD_USER}

[Install]
WantedBy=multi-user.target" | tee /etc/systemd/system/mezo.service

}

set_file_permissions(){
chown -R "${MEZOD_USER}":"${MEZOD_USER}" "${MEZOD_HOME}"
}

systemd_restart() {
echo "Reloading systemd daemon"
systemctl daemon-reload
Expand Down Expand Up @@ -432,6 +436,7 @@ main() {
setup_systemd_skip
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting up skip sidecar requires root permissions: https://docs.skip.build/connect/validators/quickstart#using-curl. This might be an issue too.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The install should still be done with root/sudo, and the curl | bash is performed at that time.

setup_systemd_sidecar
setup_systemd_mezo
set_file_permissions
systemd_restart
show_validator_info
}
Expand Down