├── .env.example ├── .gitattributes ├── .gitignore ├── Dockerfile ├── README.md ├── docker-compose.yml └── run_nimble_miner.sh /.env.example: -------------------------------------------------------------------------------- 1 | NIMBLE_WALLET_ADDRESS=YOURNIMBLEWALLETADDRESS 2 | GPU=all 3 | 4 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.sh text eol=lf -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .env 2 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | ############# Build stage 2 | FROM nvidia/cuda:12.1.0-base-ubuntu22.04 AS build 3 | 4 | # Install dependencies 5 | RUN apt-get update && \ 6 | apt-get install -y --no-install-recommends \ 7 | python3-pip \ 8 | python3.10-venv \ 9 | git \ 10 | make \ 11 | tmux \ 12 | && rm -rf /var/lib/apt/lists/* 13 | 14 | # Set the working directory 15 | WORKDIR /usr/src/app 16 | 17 | # Clone the Nimble Miner repository ( ovierride with docker build --build-arg REPO=... or in docker-compose.yml ) 18 | ARG REPO=https://github.com/nimble-technology/nimble-miner-public.git 19 | RUN git clone $REPO nimble-miner 20 | 21 | WORKDIR /usr/src/app/nimble-miner 22 | 23 | # Install Nimble Miner 24 | RUN make install 25 | 26 | # Clean pip cache to reduce image size 27 | RUN rm -rf /root/.cache/pip 28 | 29 | # Copy the Nimble Miner script 30 | COPY run_nimble_miner.sh . 31 | 32 | # Make the script executable 33 | RUN chmod +x run_nimble_miner.sh 34 | 35 | ############# Runtime stage 36 | FROM nvidia/cuda:12.1.0-base-ubuntu22.04 37 | 38 | # Install dependencies 39 | RUN apt-get update && \ 40 | apt-get install -y --no-install-recommends \ 41 | python3-pip \ 42 | python3.10-venv \ 43 | git \ 44 | make \ 45 | tmux \ 46 | && rm -rf /var/lib/apt/lists/* 47 | 48 | # Copy the Nimble Miner script 49 | COPY run_nimble_miner.sh /usr/src/app/run_nimble_miner.sh 50 | 51 | # Copy the required files from the build stage 52 | COPY --from=build /usr/src/app/nimble-miner /usr/src/app/nimble-miner 53 | 54 | # Set the working directory 55 | WORKDIR /usr/src/app/nimble-miner 56 | 57 | # Start the Nimble Miner script 58 | ENTRYPOINT ["/usr/src/app/run_nimble_miner.sh"] -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Nimble Miner 2 | 3 | This project is to run Nimble AI Miner in Docker and uses the official repo. 4 | https://github.com/nimble-technology/nimble-miner-public 5 | 6 | This project also includes Tmux. Use "tmux attach-session -r -t nimble" through a terminal session to view mining progress. 7 | 8 | ## index 9 | - [Run using Docker](#run-using-docker) 10 | - [Run using RunPod GPU Cloud](#run-using-runpod-gpu-cloud) 11 | - [Run using Docker Compose](#run-using-docker-compose) 12 | - [Building the Pre-built Docker Image](#building-the-pre-built-docker-image) 13 | - [Contributors](#contributors) 14 | 15 | 16 | ## Run using Docker 17 | 18 | Execute this command to download and run Nimble Miner using your supplied wallet address. Replace "YOURWALLETADDRESS" with yours. 19 | 20 | ```sh 21 | docker run --gpus all -e NVIDIA_VISIBLE_DEVICES=all -e NIMBLE_WALLET_ADDRESS=YOURWALLETADDRESS 0lav/nimble-miner-public:latest 22 | ``` 23 | ### Optional Flags 24 | - Run without Tmux, for displaying mining activity in docker logs only. 25 | ```sh 26 | -e TMUX=false 27 | ``` 28 | - Use a custom miner repository for custom miner configurations. 29 | ```sh 30 | -e REPO=https://github.com/your-username/custom-miner-repo 31 | - Specify GPU, for running on specific GPUs 32 | ```sh 33 | --gpus=0 -e CUDA_VISIBLE_DEVICES=0 34 | ``` 35 | ## Run using RunPod GPU Cloud 36 | **RunPod referral link [https://runpod.io?ref=qvfcm6u5](https://runpod.io?ref=qvfcm6u5 )** 37 | - Login to your account and create a new GPU Pod 38 | - Select the GPU you want to use (RTX 4090 recommended) and click Deploy 39 | - Click `Customize Deployment` 40 | - Replace Container Image with this 41 | ```sh 42 | 0lav/nimble-miner-public:latest 43 | ``` 44 | 45 | - Expand `Enviornment Variables` and enter your wallet address in a key and value format. 46 | ```dotenv 47 | # Required 48 | Key: NIMBLE_WALLET_ADDRESS 49 | Value: YOUR_WALLET_ADDRESS 50 | 51 | # Optional 52 | Key: TMUX 53 | Value: false # Set to false to run without Tmux 54 | 55 | # Optional, provide a custom miner repository 56 | Key: REPO 57 | Value: https://github.com/your-username/custom-miner-repo 58 | ``` 59 | 60 | **RunPod referral link [https://runpod.io?ref=qvfcm6u5](https://runpod.io?ref=qvfcm6u5 )** 61 | 62 | ## Run using Docker Compose 63 | 64 | 1. Clone the repository using Git: 65 | 66 | ```sh 67 | git clone https://github.com/0lav/nimble-miner-docker.git 68 | cd nimble-miner-docker 69 | 70 | ### Setting Environment Variables and Running Miner 71 | 72 | 1. **Option 1: Use `.env` File** 73 | - Make a copy of the `.env.example` file in the root of the project. 74 | - Rename the copied file to `.env`. 75 | - Open the `.env` file in a text editor and enter your Nimble wallet address. 76 | - Run the following command to start the miner using Docker Compose: 77 | ```sh 78 | docker-compose up -d 79 | 80 | 2. **Option 2: Use System Variables** 81 | - Set the necessary environment variables directly in your system or hosting provider. 82 | - Run the following command to start the miner using Docker Compose: 83 | ```sh 84 | docker-compose up -d 85 | 86 | #### Environment Variables 87 | ## Linux 88 | ```sh 89 | export NIMBLE_WALLET_ADDRESS=your_wallet_address 90 | ``` 91 | ## Windows (PowerShell) 92 | ```powershell 93 | $env:NIMBLE_WALLET_ADDRESS="your_wallet_address" 94 | ``` 95 | ## Windows (Command Prompt) 96 | ```batch 97 | set NIMBLE_WALLET_ADDRESS=your_wallet_address 98 | ``` 99 | ## macOS 100 | ```sh 101 | export NIMBLE_WALLET_ADDRESS=your_wallet_address 102 | ``` 103 | ## Updating Nimble Miner 104 | If Nimble releases a new version of their miner you can update it by restarting your docker container. It will check for a new version. 105 | 106 | 107 | ## Building the Pre-built Docker Image 108 | To create a pre-built Docker image with all the dependencies installed and the Nimble Miner repository cloned and set up, you can use a multi-stage build approach. 109 | 110 | * Open the `Dockerfile` and update the `ARG` instruction with the desired repository URL: 111 | ```sh 112 | ARG REPO=https://github.com/your-username/custom-miner-repo 113 | ``` 114 | Replace https://github.com/your-username/custom-miner-repo with the URL of the repository you want to use. 115 | * Build the pre-built Docker image: 116 | ```sh 117 | docker build -t nimble-miner-prebuilt . 118 | ``` 119 | * Push the pre-built Docker image to a container registry (e.g., Docker Hub) for distribution: 120 | ```sh 121 | docker tag nimble-miner-prebuilt your-dockerhub-username/nimble-miner-prebuilt 122 | docker push your-dockerhub-username/nimble-miner-prebuilt 123 | ``` 124 | Replace your-dockerhub-username with your actual Docker Hub username. 125 | 126 | 127 | 128 | ## Contributors 129 | ``` 130 | - Olav (Discord @saintolav) 131 | - Hani (Discord @xH) 132 | ``` 133 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.9' 2 | 3 | services: 4 | nimble-miner: 5 | stdin_open: true 6 | tty: true 7 | build: 8 | context: . 9 | # args: # Uncomment and set REPO to use custom miner repository 10 | # REPO: "" 11 | environment: 12 | NVIDIA_VISIBLE_DEVICES: ${GPU:-all} 13 | PYTHONUNBUFFERED: "1" 14 | # TMUX: "false" # Uncomment to disable tmux 15 | # NIMBLE_WALLET_ADDRESS: "" # Uncomment and set wallet address 16 | deploy: 17 | resources: 18 | reservations: 19 | devices: 20 | - driver: nvidia 21 | count: all 22 | capabilities: [gpu] 23 | restart: unless-stopped -------------------------------------------------------------------------------- /run_nimble_miner.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | WORKDIR=/usr/src/app 6 | NIMBLE_MINER_DIR="$WORKDIR/nimble-miner" 7 | 8 | cd "$NIMBLE_MINER_DIR" 9 | git pull # Update the miner code if needed 10 | source ./nimenv_localminers/bin/activate 11 | make install # Install the miner dependencies if needed 12 | 13 | # Start the miner session 14 | if [ -z "$TMUX" ] || [ "$TMUX" != "false" ]; then 15 | tmux new-session -d -s "nimble" "make run addr=${NIMBLE_WALLET_ADDRESS}" 16 | echo "Started Nimble Miner session. Use 'tmux attach-session -r -t nimble' to view the output." 17 | else 18 | make run addr="${NIMBLE_WALLET_ADDRESS}" 19 | fi 20 | 21 | tail -f /dev/null --------------------------------------------------------------------------------