Skip to content

Instantly share code, notes, and snippets.

@jeffro256
Last active September 29, 2025 06:08
Show Gist options
  • Save jeffro256/543932a8b9de3a42ce474e7aa9184c86 to your computer and use it in GitHub Desktop.
Save jeffro256/543932a8b9de3a42ce474e7aa9184c86 to your computer and use it in GitHub Desktop.
FCMP++ Alpha Stressnet Builder Script
#!/usr/bin/env python3
import argparse
import contextlib
import os
import requests
import subprocess
MONERO_REMOTE = 'seraphis-migration'
MONERO_REPO = 'https://github.com/{}/monero.git'.format(MONERO_REMOTE)
MONERO_BRANCH = 'fcmp++-alpha-stressnet'
MONERO_GUI_REMOTE = 'origin'
MONERO_GUI_REPO = 'https://github.com/monero-project/monero-gui.git'
MONERO_GUI_BRANCH = 'master'
DEFAULT_OUTPUT_DIR = 'fcmp++-stressnet'
MONERO_GUI_SUBDIR = 'monero-gui-repo'
@contextlib.contextmanager
def pushd(new_dir, make = False):
previous_dir = os.getcwd()
if make:
os.makedirs(new_dir, exist_ok=True)
os.chdir(new_dir)
try:
yield
finally:
os.chdir(previous_dir)
def cmd(*args, check=True, **kwargs):
return subprocess.run(*args, check=check, **kwargs)
def parse_args():
parser = argparse.ArgumentParser(
prog='Monero CARROT/FCMP++ Alpha Stressnet Builder',
description='Builds binaries for the Monero CARROT/FCMP++ Alpha Stressnet')
parser.add_argument('-o', '--output-dir', default=DEFAULT_OUTPUT_DIR, help='Directory for build and binary files')
parser.add_argument('-d', '--debug-build', action='store_true', help='Build in debug mode, instead release mode')
parser.add_argument('--no-gui', action='store_true', help='Skip building GUI')
parser.add_argument('-j', '--parallel', type=int, default=1, help='Number of build threads')
return parser.parse_args()
def install_monero_dependencies(gui):
print("Have you installed the following Monero dependencies?:")
print(" * Git")
print(" * GCC")
print(" * CMake")
print(" * pkg-config")
print(" * Boost")
print(" * OpenSSL")
print(" * ZMQ")
print(" * Unbound")
print(" * Sodium")
if gui:
print(" Qt, v5.9.7 or greater")
y = input("Installed (y/n)? ")
if y.lower() != 'y':
print("See the following links to install Monero dependencies on your machine:")
print(" * https://github.com/monero-project/monero?tab=readme-ov-file#dependencies")
print(" * https://github.com/monero-project/monero-gui/?tab=readme-ov-file#compiling-the-monero-gui-from-source")
print("Dependencies not installed, stopping...")
exit(1)
def install_rust():
has_rust = True
try:
cmd(['cargo', '--version'])
except:
has_rust = False
if has_rust:
return
y = input("Rust toolchain is missing. Would you like to install it now (y/n)?")
if y.lower() != 'y':
print("Dependencies not installed, stopping...")
exit(1)
rust_script = requests.get("https://sh.rustup.rs").text
cmd(['sh'], input=rust_script.encode())
def main():
args = parse_args()
assert args.parallel is None or args.parallel > 0
install_monero_dependencies(not args.no_gui)
install_rust()
build_type = 'Debug' if args.debug_build else 'Release'
with pushd(args.output_dir, make = True):
# Clone, pull, & checkout relevant source code
monero_gui_dir = os.path.join(os.getcwd(), MONERO_GUI_SUBDIR)
if not os.path.exists(monero_gui_dir):
cmd(['git', 'clone', '--recursive', MONERO_GUI_REPO, monero_gui_dir])
with pushd(monero_gui_dir):
cmd(['git', 'checkout', MONERO_GUI_BRANCH])
cmd(['git', 'pull'])
with pushd('monero'):
try:
cmd(['git', 'remote', 'add', MONERO_REMOTE, MONERO_REPO])
except:
pass
cmd(['git', 'fetch', '--all'])
cmd(['git', 'checkout', MONERO_BRANCH])
cmd(['git', 'pull'])
cmd(['git', 'submodule', 'update', '--init', '--force'])
print("Source code pulled!")
# Configure
cmake_config_cmd = ['cmake', '-D', 'CMAKE_BUILD_TYPE='+build_type]
if args.no_gui:
cmake_config_cmd.append(os.path.join(monero_gui_dir, 'monero'))
else: # yes GUI
cmake_config_cmd.extend(['-D', 'DEV_MODE=ON', '-D', 'MANUAL_SUBMODULES=ON'])
cmake_config_cmd.append(os.path.join(monero_gui_dir))
cmd(cmake_config_cmd)
print("Configuration completed!")
# Build
cmd(['cmake', '--build', '.' ] + (['--parallel', str(args.parallel)] if args.parallel is not None else []))
with pushd('bin'):
assert os.path.exists('monerod')
assert os.path.exists('monero-wallet-cli')
assert os.path.exists('monero-wallet-rpc')
if not args.no_gui:
assert os.path.exists('monero-wallet-gui')
monero_bin_path = os.getcwd()
print("Compilation completed!")
# Goodbye
print("$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$")
print("Binaries are in directory:", monero_bin_path)
print("Happy stressing!")
if __name__ == '__main__':
main()
@jeffro256
Copy link
Author

jeffro256 commented Sep 26, 2025

This is a convenience script to pull code and compile binaries for the October 2025 FCMP++ Alpha Stressnet.

Simply run this Python3 script and follow the prompts. The output directory is fcmp++-stressnet by default. The binaries can be found in its bin subdirectory. The script builds the daemon, CLI wallet, RPC wallet, and GUI wallet by default. To disable building the GUI wallet, pass --no-gui to the script. Some build environments (e.g. Ubuntu Server) don't support Qt and thus cannot build the GUI wallet without a lot of workarounds. You can pass --help to see more options.

Once the binaries are compiled, make sure to use pass the --testnet argument to the daemon, CLI wallet, and RPC wallet! For the GUI wallet, select the "testnet" network type from the drop-down menu in "advanced settings". The daemon port should be 28081.

Running this script a second time will automatically pull in and compile any new commits pushed to the fcmp++-alpha-stressnet branch. Make sure to frequently check for new updates while the stressnet is active!

@j-berman
Copy link

In case anyone wants to manually compile, here are step-by-step instructions:

Compiling daemon, CLI wallet, & RPC wallet

  1. Install normal Monero dependencies (source)

  2. Install the Rust toolchain from https://rustup.rs/

  3. Add seraphis-migration as a remote

If you already have a local monero repository:

git remote add seraphis-migration https://github.com/seraphis-migration/monero

Otherwise:

git clone https://github.com/seraphis-migration/monero
cd monero
  1. Checkout the fcmp++-alpha-stressnet branch: git checkout fcmp++-alpha-stressnet

Make sure to check for updates!

  1. Update git submodules: git submodule update --init

  2. Choose a build type: debug or release. debug builds are many, many times slower than release, particularly when constructing transactions, but provide better debugging information when exceptions are thrown. If unsure, it can be a good idea to select release until you run into an issue, then switch to debug. Set an environmental variable for this decision:

BUILD_TYPE=release or BUILD_TYPE=debug

  1. Compile: make -j${nproc} $BUILD_TYPE

  2. If on Linux, the binaries can be found in the directory ./build/Linux/fcmp++-stage/$BUILD_TYPE/bin

Compiling GUI wallet

  1. Install Monero GUI dependencies, mainly just the normal Monero dependencies plus Qt (source)

  2. Clone the monero-gui repo:

git clone --recursive https://github.com/monero-project/monero-gui
cd monero-gui
  1. Switch to the internal monero submodule: cd monero

  2. Repeat steps 3-6 of "Compiling daemon, CLI wallet, & RPC wallet"

  3. Switch to monero-gui root dir: cd ..

  4. Compile with an fcmp++-alpha-stressnet submodule: make -j${nproc} MANUAL_SUBMODULES=1 DEV_MODE=1 $BUILD_TYPE

  5. Binaries can be found in the build directory

@moneroexamples
Copy link

Shouldn't BUILD_TYPE=release be export BUILD_TYPE=release?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment