File tree Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Original file line number Diff line number Diff line change 77import shutil
88from copy import deepcopy
99from pathlib import Path
10- from docker .api import service
1110from docker .models .containers import Container
12- from services .fluentd import FLUENT_IP
1311from templates import TEMPLATES
1412from warnet .utils import (
1513 exponential_backoff ,
1614 generate_ipv4_addr ,
1715 sanitize_tc_netem_command ,
1816 dump_bitcoin_conf ,
1917 SUPPORTED_TAGS ,
18+ get_architecture ,
2019)
2120
2221CONTAINER_PREFIX_BITCOIND = "tank"
@@ -223,7 +222,7 @@ def add_services(self, services):
223222 "context" : str (TEMPLATES ),
224223 "dockerfile" : str (TEMPLATES / f"Dockerfile" ),
225224 "args" : {
226- "ARCH" : "x86_64" ,
225+ "ARCH" : get_architecture () ,
227226 "BITCOIN_URL" : "https://bitcoincore.org/bin" ,
228227 "BITCOIN_VERSION" : f"{ self .version } " ,
229228 },
Original file line number Diff line number Diff line change 55import os
66import random
77import re
8+ import subprocess
89import sys
910import time
1011from io import BytesIO
@@ -63,6 +64,20 @@ def wrapper(*args, **kwargs):
6364 return decorator
6465
6566
67+ def get_architecture ():
68+ """
69+ Get the architecture of the machine.
70+ :return: The architecture of the machine or None if an error occurred
71+ """
72+ result = subprocess .run (["uname" , "-m" ], stdout = subprocess .PIPE )
73+ arch = result .stdout .decode ("utf-8" ).strip ()
74+ if arch == "arm64" :
75+ arch = "aarch64"
76+ if arch is None :
77+ raise Exception ("Failed to detect architecture." )
78+ return arch
79+
80+
6681def generate_ipv4_addr (subnet ):
6782 """
6883 Generate a valid random IPv4 address within the given subnet.
You can’t perform that action at this time.
0 commit comments