Giter VIP home page Giter VIP logo

ci-monk / docker-crypto-miner Goto Github PK

View Code? Open in Web Editor NEW
35.0 3.0 13.0 1.2 MB

👾 A user-friendly image that can be used for mining cryptocurrencies with your CPU

License: Do What The F*ck You Want To Public License

Dockerfile 12.28% Shell 55.11% Smarty 12.66% HCL 19.95%
mining xmrig docker container crypto randomx cpuminer cryptocurrency alpine cryptonight docker-compose kubernetes helm cpu-mining multi-arch-images

docker-crypto-miner's Introduction

gif-header

Docker Crypto Miner

Semantic Release Commitizen friendly GitHub repo size


gif-about

A containerized solution for mining crypto using XMRig miner

Description   |    Getting Started   |    Concepts   |    Links   |    Donations   |    Versioning   |    Troubleshooting


➤ Important Note

This repository is intended for educational and ethical purposes only. The creators are not responsible for incorrect use by any individual. Use it knowing that you will be doing so at your own risk.

If you plan to mine in a cloud, check your provider's terms and conditions before you start. The same applies if you are using private equipment or an on-site data center.

(back to top)

➤ Description

This repository contains a containerized setup of the xmrig tool, which allows you to go from zero to mining in about 5 minutes on any architecture running containers.

CPU mining can be profitable using algorithms such as: RandomX, Cryptonight or Equihash. Learn more about profitability here.

(back to top)

➤ Getting Started

Setup

To configure your system for the development of this project, follow the steps below:

  • Install asdf to manage runtime dependencies.
  • Install runtime dependencies.
cut -d' ' -f1 .tool-versions | xargs -I{} sh -c 'asdf plugin add "$1"' -- {}
asdf install
  • Run task from the root of the repository to see available commands. We use task in place of make for this project. See Taskfile.yml for more information.

Variables

The preferred way to configure XMRig is using a configuration file in JSON format, because it is more flexible and easier to use. The CLI doesn't cover all the features available and can be a limiting factor, depending on the scenario.

Name Description
MINING_POOL URL of mining server
MINING_COIN Coin to mining
REFERRAL_CODE Param to educe mining rater
WALLET_ADDRESS Wallet address
WORKER_NAME Worker name
XMRIG_CONFIG_FILE XMRig config file reference

Running

Docker

Container

Just a simple example that you can use to run this container:

docker container run \
  --restart unless-stopped --name crypto-miner -d \
  -e MINING_POOL="rx.unmineable.com:3333" \
  -e MINING_COIN="SHIB" \
  -e REFERRAL_CODE="7lkr-kmhq" \
  -e WALLET_ADDRESS="<your-wallet-address>" \
  -e WORKER_NAME="docker-mining" \
  ghcr.io/lpsm-dev/docker-crypto-miner:main

Click here to see available image tags.

Logs

Shows information logged of the running container:

docker logs -f crypto-miner

or

docker logs --tail 1000 crypto-miner

Kubernetes

Pods

gif-about

For more information here.

(back to top)

➤ Concepts

This section aims to describe at a high level which tools we use and how we use them, without reproducing documentation that is better written (and more up-to-date) in the repositories and websites of the tools themselves. It is recommended that you familiarize yourself with these tools as soon as possible.

XMRig

Basically, XMRig is a free, open-source mining program. It can be installed on Windows, Linux and macOS, and allows you to mine using the RandomX algorithm. Here's a brief example of the run command:

xmrig.exe -o rx.unmineable.com:3333 -a rx -k -u COIN:YOUR_ADDRESS.WORKER_NAME#REFERRAL_CODE -p x pause
  • COIN: it's the coin that you're extracting, for example: ADA, TRX, WIN or more. Also, keep the : symbol between the currency and your address.
  • YOUR_ADDRESS: must be a valid address for the currency you choose, otherwise the pool will return an error, also be sure to check the supported network for some currencies like TRC20 for USDT mining (TRON address).
  • WORKER_NAME: it's any name that you would like to define for your worker.
  • REFERRAL_CODE: it's the parameter used to reduce the mining rate.

Unmineable

Unmineable is a mining pool that allows anyone to become a miner using a personal computer.

ASIC

The acronym ASIC describes a series of computer devices designed from start to finish to provide maximum performance in cryptocurrency mining tasks.

RandomX

RandomX is a proof-of-work (PoW) algorithm that is optimized for general-purpose CPUs. RandomX uses random code execution (hence the name) along with various hard memory techniques to minimize the efficiency advantage of specialized hardware.

Mining Rig

A mining rig is a mining platform. The rig can be a dedicated miner, where it has been bought, built and operated specifically for mining, or it can be a computer that fulfills other needs, such as a gaming system, and is used to mine only part-time.

CPU Limit

Cpulimit is a tool that allows us to limit CPU usage by process. It gives us a few ways to identify the desired process, either by process name, PID or executable path. It's useful for controlling batch tasks when you don't want them to consume too many CPU cycles. The aim is to prevent a process from running for more than a certain amount of time. It is also able to adapt to the overall system load dynamically and quickly.

Security

gif-about

Pay attention to the images you use for these purposes and protect yourself against cryptojacking. Containers have become frequent targets for threat actors carrying out malicious cryptocurrency mining and other attacks. Last year, Trend Micro came across activities by cryptocurrency miners that were implemented as rogue containers using a community-distributed image published on Docker Hub. In May, researchers found an open directory that contained a malicious cryptocurrency miner and a distributed denial of service (DDoS) bot that targeted open Docker daemon ports. In the attack, an Alpine Linux container was created to host the cryptocurrency miner and the DDoS bot.

(back to top)

➤ Links

(back to top)

➤ Donations

If my work has had a positive impact on your life and you want to buy me a coffee (or a hundred), you'll be very grateful!

BTC Address

(back to top)

➤ Versioning

To check the change history, please access the CHANGELOG.md file.

(back to top)

➤ Troubleshooting

If you have any problems, open an issue in this project.

(back to top)

➤ Show your support

Give me a ⭐️ if this project helped you!

gif-footer

Made with 💜 by me 👋 inspired on readme-md-generator

(back to top)

docker-crypto-miner's People

Contributors

dependabot[bot] avatar lpsm-dev avatar renovate-bot avatar renovate[bot] avatar semantic-release-bot avatar snyk-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

docker-crypto-miner's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.