Easy way to set-up nym-node (python script)

Easy way to set-up nym-node (python script) https://forum.nym.com/uploads/default/optimized/2X/4/4a764a0c8801dcd400989c983a1d46df06f57dea_2_1024x859.png
none 0.0 0

Initially, I wanted to write in bash, but I’m not very familiar with this language, so I chose a python. It is available out of the box on all ubuntu similar systems. The source code is open source and you can check it yourself. It was possible to make it even easier (generate a wallet from a seed-phrase and automatically sign the signature), but I did not want to use downloadable libraries and create an environment. So far, only the installation of the mix-node, but if the community considers it necessary, I can create a choice to install the mixnode/gateway/gatewayWG as well as automatically update the node version. For testing, I used a free cloud, the instance worked only for an hour, so I can’t be 100% sure. Node appears in the exploit with the onset of a new epoch

I will be glad to return feedback.

This “Nym Node Installer” script automates the full installation and configuration of a Nym node .
Here’s a concise, point-by-point breakdown:
Node Deployment : It downloads the Nym binary, initializes the node’s configuration, and sets up a systemd service for its continuous operation.
Network Configuration : It configures the firewall (ufw) by opening necessary ports (8080, 1789, 1790, 9000).
Wallet Interaction : It retrieves and displays the wallet’s mnemonic phrase . It helps check the wallet balance and sign a contract message for node bonding.
Utility Functions : It includes enhanced logging utilities , command execution with sudo , and progress indicators.
Requirements : It runs only on Linux and requires Python 3.6+.

example of script operation



5 Likes

UPDATE

  • Code has been refactored
  • Added mode selection: Mixnode, Gateway, Gateway + WireGuard

Successfully launched two nodes in Gateway + WireGuard mode.

Small clarification: The moniker is automatically generated based on the entered nodeID. If you want to set/change the moniker after installation, edit the file: .nym/nym-nodes//data/description.toml

.nym/nym-nodes/<nodeID>/data/description.toml

The file nym_updater.py has been added to the repository

nym-node Updater

Simple Python script to check and update nym-node binary from GitHub releases.

Features

  • Checks current nym-node version
  • Fetches latest release from GitHub
  • Downloads and compares versions
  • Interactive or automatic update
  • Optional service restart
  • Comprehensive logging

Requirements (if required)

pip install requests

Usage

Interactive mode

./nym_updater.py

Script will ask for confirmation before updating and restarting service.

Automatic mode

./nym_updater.py -y

Automatically answers “yes” to all prompts (update + service restart).

What it does

  1. Finds your current nym-node installation
  2. Gets current Build Version
  3. Checks GitHub for latest release
  4. Downloads new binary to /tmp/nym-update/
  5. Compares versions
  6. If update available:
  • Creates backup of current binary
  • Replaces binary using sudo
  • Optionally restarts nym-node.service

Example output

📦 Current Build Version: 2025-01-15T10:30:00Z
🌐 Latest Release: nym-binaries-v2025.20-leerdammer
📥 Downloaded Build Version: 2025-01-20T14:45:00Z

✅ Update available! (2025-01-20T14:45:00Z > 2025-01-15T10:30:00Z)

Do you want to update? [y/N]: y
✅ Update successful!

Restart nym-node.service? [y/N]: y
✅ Service restarted successfully
1 Like