• Stars
    star
    122
  • Rank 292,031 (Top 6 %)
  • Language
    Go
  • License
    GNU General Publi...
  • Created over 8 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Mining Agent

BTCAgent

Chinese Version/中文版本

BTCAgent is a kind of stratum proxy which use customize protocol to communicate with the pool. It's very efficient and designed for huge mining farm. And you still can find each miner at the pool.

  • With 10,000 miners:
    • Bandwith: less than 150kbps
    • Memory: less than 64MBytes
    • CPU: 1 Core

Supported platforms:

  • Windows
  • Linux
  • Other platforms supported by the programming language golang

Note:

  • This is still a testbed and work in progress, all things could be changed.
  • Now it could only work with btcpool.

Architecture

Architecture

Download

You can download the binary of BTCAgent here:

https://github.com/btccom/btcagent/releases

Download agent_conf.default.json (configuration file template) and btcagent-xxx-xxx binary suitable for your platform, give btcagent-xxx-xxx execution permission (Linux/macOS), and rename it to btcagent.

Example of granting execution permissions and renaming:

chmod +x btcagent-linux-x64
mv btcagent-linux-x64 btcagent

Which binary should I download?

  • 32-bit Windows system: btcagent-windows-x86.exe
  • 64-bit Windows system: btcagent-windows-x64.exe
  • 32-bit Linux system: btcagent-linux-x86
  • 64-bit Linux system: btcagent-linux-x64
  • Raspberry Pi running a 32-bit system: btcagent-linux-arm
  • Raspberry Pi running a 64-bit system: btcagent-linux-arm64
  • Mac with Intel CPU: btcagent-macos-x64
  • Mac with M1 chip: btcagent-macos-arm64

Run

Run following commands in the folder with btcagent and agent_conf.default.json.

If you use GUI, you can right-click on a blank space in the file manager and select "Open terminal here".

# Create a config file from the template
cp agent_conf.default.json agent_conf.json

# Then modify `agent_conf.json` according to your needs

# Create a log directory
mkdir log

# Launch BTCAgent
./btcagent -c agent_conf.json -l log -alsologtostderr

Press Ctrl + C to stop btcagent.

Configuration file details

See ConfigFileDetails.md for more details about agent_conf.json.

Run as a systemd service (Auto-start in Linux)

Only for Linux with systemd.

Run in the folder with btcagent, agent_conf.json and the folder log.

If you use GUI, you can right-click on a blank space in the file manager and select "Open terminal here".

# Create a systemd service file.
cat << EOF | sudo tee /etc/systemd/system/btcagent.service >/dev/null
[Unit]
Description=BTCAgent
After=network.target
StartLimitIntervalSec=0

[Service]
Type=simple
Restart=always
RestartSec=1
User=root
ExecStart="$PWD/btcagent" -c "$PWD/agent_conf.json" -l "$PWD/log"

[Install]
WantedBy=multi-user.target
EOF

# Launch service
sudo systemctl start btcagent

# Make the service start automatically after booting
sudo systemctl enable btcagent

# Check service status
sudo systemctl status btcagent

# View service startup records
sudo journalctl -u btcagent

# View log
less log/*INFO

# Monitor log (continuously print log changes)
tail -F log/*INFO

Note: After registering as a systemd service, you cannot move the location of above files, otherwise you need to delete the service and register again.

If you no longer use btcagent service, you can delete it like this:

# Stop service
sudo systemctl stop btcagent

# Disable automatic startup
sudo systemctl disable btcagent

# Remove service
sudo rm /etc/systemd/system/btcagent.service

Build

For developers.

If you can download a binary suitable for your system, you don't need to build it.

  1. Install golang from https://go.dev/

  2. Install git from https://git-scm.com/

  3. Run the following commands:

    git clone https://github.com/btccom/btcagent.git
    cd btcagent
    go build
  4. You will get the executable file btcagent (or btcagent.exe on Windows).

Build on Windows

It is recommended to compile via ./build-all.sh in WSL.

If you really want to compile natively in Windows, you need mingw-w64 gcc from MSYS2.

If you have C:\msys64\mingw64\bin\gcc.exe on your system, add C:\msys64\mingw64\bin to the environment variable PATH.

Note that you need a 64-bit gcc to compile the 64-bit BTCAgent.

More Repositories

1

btcpool-ABANDONED

backend of pool.btc.com
C++
638
star
2

btcpool-go-modules-ABANDONED

BTCPool modules that implemented with golang / BTCPool中用go语言实现的组件
Go
43
star
3

secp256k1-go

Bindings to lib-secp256k1 for golang
Go
27
star
4

Blockchain-Known-Pools-BCH

25
star
5

bccpool

BTCPool for BitcoinCash (legacy branch)
C++
22
star
6

libbtctools

A core library of BTCTools
C++
19
star
7

BTCPoolAPIDocs

API docs for BTC Pool
15
star
8

chrome_extension

btc.com browser extension for chrome
JavaScript
10
star
9

bitwasp-bitcoin-bch-addon

BCH bridge for bitwasp/bitcoin
PHP
10
star
10

copernicus

Golang bitcoin library
Go
10
star
11

Hire

BTC.com 北京招聘
8
star
12

cashaddress-php

PHP library for base32, and the related cashaddr format
PHP
8
star
13

BtcTunnel

C++
7
star
14

wallet-recovery-data-bridge

JavaScript
6
star
15

fibre_docker

docker for bitcoin Fibre
Shell
5
star
16

btcsigner

Small golang package (using btcd) for signing transactions
Go
5
star
17

btc_pool_docs

BTC.com 矿池 API 文档 🙃
Shell
5
star
18

wallet_onchain_ios

Onchain wallet for iOS
Objective-C
4
star
19

justencrypt-php

PHP
4
star
20

rpctransport-go

Small golang library to provide RPC requests over various transports
Go
4
star
21

fe-exercise-backend

JavaScript
3
star
22

BitcoinCashReplayProtection

3
star
23

ui

前端框架
JavaScript
3
star
24

justencrypt-js

JavaScript
3
star
25

cashaddress-js

Bitcoin cash addresses in javascript
JavaScript
3
star
26

Laravel5-fis

使用 Laravel 5 + Fis 进行前端模块化开发。
PHP
3
star
27

btcpool_build

Build environment for btcpool project
Dockerfile
2
star
28

bitcoin-faucet

faucet for bitcoin testnet5
JavaScript
2
star
29

ezbitcoind-php

PHP
2
star
30

blackboard

personnel recruitment
2
star
31

poolEventLogs

TypeScript
2
star
32

btcpool-export

BTCPool算力导出工具
JavaScript
2
star
33

bitcoind_patches

patches for bitcoind
2
star
34

pushtx-sdk

pushtx-sdk
Python
2
star
35

eth-explorer-mobile

eth-explorer-mobile
JavaScript
2
star
36

open-falcon-plugins

open-falcon plugins for agents
Python
1
star
37

antd-umi-block-sample-table

JavaScript
1
star
38

powtcha-php

PHP
1
star
39

ExplorerAPIDoc4LTC

1
star
40

opsgenie

Simple implementation of OpsGenie Heartbeat api
Go
1
star
41

red-packet-api

JavaScript
1
star
42

Blockchain-Known-Pools-LTC

1
star
43

bitcoin-abc

C++
1
star
44

UnitedBitcoin

C++
1
star
45

wallet-extension

TypeScript
1
star
46

dcrd

Go
1
star
47

bch-fork-op

bch-fork-op
JavaScript
1
star
48

iOS-Client-BM-Wallet

1
star
49

explorer-geth

增加 trace_x 方法
Go
1
star
50

Blockchain-Known-Pools-BSV

1
star
51

powtcha-js

JavaScript
1
star
52

NodeBooster

C++
1
star
53

goconsumer

Small go package for consuming various queues
Go
1
star
54

ExplorerAPIDoc

Documentation for block explorer.
JavaScript
1
star
55

red-packet

JavaScript
1
star
56

fis3-parser-babel

init
JavaScript
1
star
57

fis3-babel

JavaScript
1
star
58

btcd-tx

btcd addon with tools for signing transactions
1
star
59

drawlottery-for-3rd-anniversary

lottery program for BTC.com Pool 3rd anniversary celebration
JavaScript
1
star
60

local_bitcoind_docker_build_util

Build bitcoind docker image using built local machine binaries, instead downloading and recompile. This to help debugging
Python
1
star
61

eth-fork-constantin

eth constantinople fork landing
JavaScript
1
star
62

react-mobx-antd-intl-btc-boilerplate

Front end project boilerplate with react and mobx.
JavaScript
1
star
63

sqlxbatch

Go
1
star
64

justencrypt-go

Golang library for wrapping AES-GCM with configurable PBKDF2 parameters
Go
1
star
65

zmq-broker-worker

Use zmq to distribute tasks to multiple workers
C++
1
star
66

ExplorerAPIDoc4BCH

1
star
67

Blockchain-Known-Pools-Testnet3

bitcoin testnet3 pool's identify pattern
1
star