-
-
Save jeffro256/543932a8b9de3a42ce474e7aa9184c86 to your computer and use it in GitHub Desktop.
| #!/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() |
In case anyone wants to manually compile, here are step-by-step instructions:
Compiling daemon, CLI wallet, & RPC wallet
-
Install normal Monero dependencies (source)
-
Install the Rust toolchain from https://rustup.rs/
-
Add
seraphis-migrationas 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
- Checkout the
fcmp++-alpha-stressnetbranch:git checkout fcmp++-alpha-stressnet
Make sure to check for updates!
-
Update git submodules:
git submodule update --init -
Choose a build type:
debugorrelease.debugbuilds are many, many times slower thanrelease, particularly when constructing transactions, but provide better debugging information when exceptions are thrown. If unsure, it can be a good idea to selectreleaseuntil you run into an issue, then switch todebug. Set an environmental variable for this decision:
BUILD_TYPE=release or BUILD_TYPE=debug
-
Compile:
make -j${nproc} $BUILD_TYPE -
If on Linux, the binaries can be found in the directory
./build/Linux/fcmp++-stage/$BUILD_TYPE/bin
Compiling GUI wallet
-
Install Monero GUI dependencies, mainly just the normal Monero dependencies plus Qt (source)
-
Clone the
monero-guirepo:
git clone --recursive https://github.com/monero-project/monero-gui
cd monero-gui
-
Switch to the internal
monerosubmodule:cd monero -
Repeat steps 3-6 of "Compiling daemon, CLI wallet, & RPC wallet"
-
Switch to
monero-guiroot dir:cd .. -
Compile with an
fcmp++-alpha-stressnetsubmodule:make -j${nproc} MANUAL_SUBMODULES=1 DEV_MODE=1 $BUILD_TYPE -
Binaries can be found in the
builddirectory
Shouldn't BUILD_TYPE=release be export BUILD_TYPE=release?
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++-stressnetby default. The binaries can be found in itsbinsubdirectory. The script builds the daemon, CLI wallet, RPC wallet, and GUI wallet by default. To disable building the GUI wallet, pass--no-guito 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--helpto see more options.Once the binaries are compiled, make sure to use pass the
--testnetargument 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-stressnetbranch. Make sure to frequently check for new updates while the stressnet is active!