4 Commits

Author SHA1 Message Date
60df317f78 feat: Add install script to readme
Some checks failed
Build Docker / Build Images (map[dockerfile:Dockerfile tag_suffix: target:default]) (push) Has started running
Build Docker / Build Images (map[dockerfile:Dockerfile.hsd tag_suffix:-hsd target:hsd]) (push) Has been cancelled
Tests and Linting / Tests-Linting (3.11) (push) Has been cancelled
Tests and Linting / Tests-Linting (3.10) (push) Has been cancelled
Tests and Linting / Tests-Linting (3.13) (push) Has been cancelled
2025-09-04 21:33:28 +10:00
4c1ea9fb12 feat: Add installation and start scripts 2025-09-04 21:29:47 +10:00
58ed636ce3 fix: Use git --version instead of short -v to allow for backwards compatability
The default git installed in ubuntu doesn't allow -v
2025-09-04 21:29:05 +10:00
e537c323c2 fix: Update paths to be consistent
All checks were successful
Tests and Linting / Tests-Linting (3.11) (push) Successful in 32s
Tests and Linting / Tests-Linting (3.10) (push) Successful in 43s
Tests and Linting / Tests-Linting (3.13) (push) Successful in 45s
Build Docker / Build Images (map[dockerfile:Dockerfile.hsd tag_suffix:-hsd target:hsd]) (push) Successful in 51s
Build Docker / Build Images (map[dockerfile:Dockerfile tag_suffix: target:default]) (push) Successful in 59s
2025-09-02 18:15:56 +10:00
7 changed files with 100 additions and 8 deletions

2
.gitignore vendored
View File

@@ -17,6 +17,6 @@ cache/
build/
dist/
hsd/
hsd-data/
hsd_data/
hsd.lock
hsdconfig.json

View File

@@ -50,7 +50,7 @@ LABEL org.opencontainers.image.title="FireWallet (HSD)" \
VOLUME ["/app/hsd-data", "/app/user_data"]
VOLUME ["/app/hsd_data", "/app/user_data"]
ENTRYPOINT ["python3"]

View File

@@ -13,6 +13,11 @@ cp example.env .env
Edit .env to have your HSD api key.
If you have HSD runnning on a separate computer also add the IP here
For a quick and easy installation on ubuntu/debian you can run the install.sh script
```bash
curl https://git.woodburn.au/nathanwoodburn/firewalletbrowser/src/branch/main/install.sh | bash
```
## Usage
Make sure HSD is running then run the following commands:

View File

@@ -1804,7 +1804,7 @@ def checkPreRequisites() -> dict[str, bool]:
try:
# Check if git is installed
gitSubprocess = subprocess.run(["git", "-v"], capture_output=True, text=True,timeout=2)
gitSubprocess = subprocess.run(["git", "--version"], capture_output=True, text=True,timeout=2)
if gitSubprocess.returncode == 0:
prerequisites["git"] = True
except Exception:
@@ -1900,7 +1900,7 @@ def hsdStart():
chain_migrate = HSD_CONFIG.get("chainMigrate", False)
wallet_migrate = HSD_CONFIG.get("walletMigrate", False)
spv = HSD_CONFIG.get("spv", False)
prefix = HSD_CONFIG.get("prefix", os.path.join(os.getcwd(), "hsd-data"))
prefix = HSD_CONFIG.get("prefix", os.path.join(os.getcwd(), "hsd_data"))
# Base command
@@ -1976,7 +1976,6 @@ def hsdRestart():
time.sleep(2)
hsdStart()
hsdInit()
hsdStart()
# endregion

View File

@@ -4,10 +4,8 @@ services:
ports:
- "5000:5000"
volumes:
- hsd_data:/app/hsd-data
- hsd_data:/app/hsd_data
- user_data:/app/user_data
environment:
- INTERNAL_HSD=true
volumes:
hsd_data:

81
install.sh Executable file
View File

@@ -0,0 +1,81 @@
#!/usr/bin/env bash
install_command=""
# Check if currently in the FireWalletBrowser directory
if [ -f "server.py" ]; then
echo "Please run this script from outside the FireWalletBrowser directory."
exit 1
fi
echo "Starting installation of FireWalletBrowser..."
# Check if OS is using apt package manager (Debian/Ubuntu)
if command -v apt-get &> /dev/null; then
install_command="sudo apt-get install -y"
dependencies=(git curl wget python3 python3-pip python3-venv)
echo "Detected apt package manager."
# Check if OS is using pacman package manager (Arch Linux)
elif command -v pacman &> /dev/null; then
install_command="sudo pacman -S"
dependencies=(git curl wget python3 python-pip)
echo "Detected pacman package manager."
else
echo "Unsupported package manager. Please install dependencies manually."
exit 1
fi
# List of dependencies to install
# Install dependencies
for package in "${dependencies[@]}"; do
# Check if the package is already installed
if command -v $package &> /dev/null || dpkg -s $package &> /dev/null || pacman -Qi $package &> /dev/null; then
echo "$package is already installed."
continue
fi
echo "Installing $package..."
$install_command $package
# Check if the installation was successful
if [ $? -ne 0 ]; then
echo "Failed to install $package. Please check your package manager settings."
exit 1
fi
done
if ! command -v node &> /dev/null || ! command -v npm &> /dev/null; then
echo "Installing Node.js and npm..."
# Download and install nvm:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
# in lieu of restarting the shell
\. "$HOME/.nvm/nvm.sh"
nvm install 20
if [ $? -ne 0 ]; then
echo "Failed to install Node.js and npm. Please install them manually."
exit 1
fi
else
echo "Node.js and npm are already installed."
fi
# Clone repo
git clone https://git.woodburn.au/nathanwoodburn/firewalletbrowser.git
# Setup venv
cd firewalletbrowser || exit 1
python3 -m venv .venv
source .venv/bin/activate
# Install python dependencies
python3 -m pip install -r requirements.txt
# Write .env file
if [ ! -f ".env" ]; then
echo "Creating .env file..."
echo "INTERNAL_HSD=true" > .env
echo "Created .env file with INTERNAL Node enabled."
fi
echo "Installation complete. You can start the application by running ./start.sh"

9
start.sh Executable file
View File

@@ -0,0 +1,9 @@
#!/usr/bin/env bash
# Find if .venv exists
if [ -d ".venv" ]; then
echo "Virtual environment found. Activating..."
source .venv/bin/activate
fi
python3 server.py