Upgrade to v3.7.0 consensus, improve README

This commit is contained in:
DataHoarder 2024-04-14 10:28:16 +02:00
parent 603241d884
commit 930d1b7420
Signed by: DataHoarder
SSH key fingerprint: SHA256:OLTRf6Fl87G52SiR7sWLGNzlJt4WOX+tfI2yxo0z7xk
4 changed files with 107 additions and 22 deletions

100
README.md
View file

@ -11,13 +11,105 @@ Donate to support this project, its development, and running the Observer Instan
You can also use the OpenAlias `p2pool.observer` directly on the GUI.
### Development notes
## Running
Requires using CGO.
You can run or build go-p2pool via Golang to create native binaries for your system.
See the Dependencies section below if you want to use the [tevador/RandomX](https://github.com/tevador/RandomX) library. If you do so, remove all `CGO_ENABLED=0` from your commands.
You can install the RandomX dependency via this command:
```bash
$ git clone --depth 1 --branch master https://github.com/tevador/RandomX.git /tmp/RandomX && cd /tmp/RandomX && \
# Directly run go-p2pool
CGO_ENABLED=0 go run git.gammaspectra.live/P2Pool/go-p2pool/v3@v3.7.0 -help
# Install go-p2pool
CGO_ENABLED=0 go install git.gammaspectra.live/P2Pool/go-p2pool/v3@v3.7.0
go-p2pool -help
# Compile from this repository
git clone --depth 1 --branch v3.7.0 https://git.gammaspectra.live/P2Pool/go-p2pool.git
cd go-p2pool
CGO_ENABLED=0 go install .
go-p2pool -help
# Alternatively you can use go build to specify an output path
go build -trimpath -v -pgo=auto -o /usr/bin/go-p2pool .
go-p2pool -help
```
## Usage
Arguments are similar to [SChernykh/p2pool](https://github.com/SChernykh/p2pool), with some differences and additions.
You can use either `-[arg] or --[arg]`
```
-add-self-peer
Adds itself to the peer list regularly, based on found local interfaces for IPv4/IPv6
-addpeers string
Comma-separated list of IP:port of other p2pool nodes to connect to
-api-bind string
Bind to this address to serve blocks, and other utility methods. If -archive is specified, serve archived blocks.
-archive string
If specified, create an archive store of sidechain blocks on this path.
-block-cache string
Block cache for faster startups. Set to empty to disable (default "p2pool.cache")
-consensus-config string
Name of the p2pool consensus config file
-debug
Log more details. Default false
-debug-listen string
Provide a bind address and port to expose a pprof HTTP API on it.
-host string
IP address of your Monero node (default "127.0.0.1")
-in-peers uint
Maximum number of incoming connections for p2p server (any value between 10 and 450) (default 10)
-ipv6-only
Use only IPv6. Default false
-light-mode
Don't allocate RandomX dataset, saves 2GB of RAM
-memory-limit uint
Memory limit for go managed sections in GiB, set 0 to disable
-mini
Connect to p2pool-mini sidechain. Note that it will also change default p2p port.
-no-dns
Disable DNS queries, use only IP addresses to connect to peers (seed node DNS will be unavailable too)
-out-peers uint
Maximum number of outgoing connections for p2p server (any value between 10 and 450) (default 10)
-p2p string
IP:port for p2p server to listen on. (default "0.0.0.0:37889")
-p2p-external-port uint
Port number that your router uses for mapping to your local p2p port. Use it if you are behind a NAT and still want to accept incoming connections
-peer-list string
Either a path or an URL to obtain peer lists from. If it is a path, new peers will be saved to this path. Set to empty to disable (default "p2pool_peers.txt")
-rpc-port uint
monerod RPC API port number (default 18081)
-stratum string
IP:port for stratum server to listen on. Empty to disable.
-zmq-port uint
monerod ZMQ pub port number (default 18083)
```
## Dependency notes
### RandomX without external dependencies
Set `CGO_ENABLED=0` to disable CGO and build everything via Golang, or alternatively via `disable_randomx_library` build tag.
Uses Golang [git.gammaspectra.live/P2Pool/go-randomx](https://git.gammaspectra.live/P2Pool/go-randomx) RandomX backend for consensus PoW checking.
Only supports light mode, with almost no JIT support.
### RandomX with external dependency and CGO
Requires a native RandomX implementation and `CGO_ENABLED=1` environment variable while building.
Uses C/C++ [tevador/RandomX](https://github.com/tevador/RandomX) library.
Supports full and light mode, with JIT support implemented across many platforms.
You can install the dependency via this command:
```bash
$ git clone --depth 1 --branch v1.2.1 https://github.com/tevador/RandomX.git /tmp/RandomX && cd /tmp/RandomX && \
mkdir build && cd build && \
cmake .. -DCMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX:PATH=/usr && \
make -j$(nproc) && \

11
go.mod
View file

@ -3,31 +3,26 @@ module git.gammaspectra.live/P2Pool/go-p2pool/v3
go 1.22
require (
git.gammaspectra.live/P2Pool/consensus/v3 v3.6.4
git.gammaspectra.live/P2Pool/consensus/v3 v3.7.0
git.gammaspectra.live/P2Pool/observer-cache-archive v0.0.0-20240413050335-08f79500c0c1
github.com/gorilla/mux v1.8.1
)
require (
git.gammaspectra.live/P2Pool/edwards25519 v0.0.0-20240405085108-e2f706cb5c00 // indirect
git.gammaspectra.live/P2Pool/go-json v0.99.0 // indirect
git.gammaspectra.live/P2Pool/go-randomx/v2 v2.1.0 // indirect
git.gammaspectra.live/P2Pool/monero-base58 v1.0.0 // indirect
git.gammaspectra.live/P2Pool/randomx-go-bindings v1.0.0 // indirect
git.gammaspectra.live/P2Pool/sha3 v0.17.0 // indirect
git.gammaspectra.live/P2Pool/zmq4 v0.99.0 // indirect
github.com/dolthub/maphash v0.1.0 // indirect
github.com/dolthub/swiss v0.2.2-0.20240312182618-f4b2babd2bc1 // indirect
github.com/go-zeromq/zmq4 v0.16.1-0.20240124085909-e75c615ba1b3 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc // indirect
go.etcd.io/bbolt v1.3.9 // indirect
golang.org/x/crypto v0.22.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.19.0 // indirect
golang.org/x/text v0.14.0 // indirect
lukechampine.com/uint128 v1.3.0 // indirect
)
replace github.com/goccy/go-json => github.com/WeebDataHoarder/go-json v0.0.0-20230730135821-d8f6463bb887
replace github.com/go-zeromq/zmq4 => git.gammaspectra.live/P2Pool/zmq4 v0.16.1-0.20240407153747-7f7d531f586e

14
go.sum
View file

@ -1,7 +1,9 @@
git.gammaspectra.live/P2Pool/consensus/v3 v3.6.4 h1:z/+WQrPQK5RDdWwm2od9Ltpk9TFAyNhR7j1cTAFfe8Y=
git.gammaspectra.live/P2Pool/consensus/v3 v3.6.4/go.mod h1:3mjTaEx2Hm9VUs0rZIjCAFV6fToNxnVDj616NEc9Y0I=
git.gammaspectra.live/P2Pool/consensus/v3 v3.7.0 h1:pkcOYXYq261gIpPxsaj61oKKadKh1BF51WYffy8HeBU=
git.gammaspectra.live/P2Pool/consensus/v3 v3.7.0/go.mod h1:6Gmugv6Wyha2Sl+1gfsmiQzDaiSg/bZsfIDRFIQYE+o=
git.gammaspectra.live/P2Pool/edwards25519 v0.0.0-20240405085108-e2f706cb5c00 h1:mDQY337iKB+kle5RYWL5CoAz+3DmnkAh/B2XD8B+PFk=
git.gammaspectra.live/P2Pool/edwards25519 v0.0.0-20240405085108-e2f706cb5c00/go.mod h1:FZsrMWGucMP3SZamzrd7m562geIs5zp1O/9MGoiAKH0=
git.gammaspectra.live/P2Pool/go-json v0.99.0 h1:TbFOEWbbDLFzm1fM/2+WPUhhzSwJ501+otfrQ8jCP84=
git.gammaspectra.live/P2Pool/go-json v0.99.0/go.mod h1:X9PvT0fmWrU1I+BiDUjMypUWdsWFm24QCW1sWxbzT8w=
git.gammaspectra.live/P2Pool/go-randomx/v2 v2.1.0 h1:L1fV2XBYFmpFU+JKP/7fsgDm2Lfh9yFlS+800v+3OsM=
git.gammaspectra.live/P2Pool/go-randomx/v2 v2.1.0/go.mod h1:vNmHlEIRAcU/bA85mxbUKEiBYtrtS4MVwozf29KmoHM=
git.gammaspectra.live/P2Pool/monero-base58 v1.0.0 h1:s8LZxVNc93YEs2NCCNWZ7CKr8RbEb031y6Wkvhn+TS4=
@ -12,10 +14,8 @@ git.gammaspectra.live/P2Pool/randomx-go-bindings v1.0.0 h1:tajr4QFSPrb8NtHmU14Ja
git.gammaspectra.live/P2Pool/randomx-go-bindings v1.0.0/go.mod h1:S17NNidG5hxqaVLsSykKqDBg/hTPSzP0KcSwXfH8WIA=
git.gammaspectra.live/P2Pool/sha3 v0.17.0 h1:CZpB466LPbNVQrUNjQTtQScGDc30xSMkZ6Bmw0W9VuM=
git.gammaspectra.live/P2Pool/sha3 v0.17.0/go.mod h1:HmrrYa97BZTKklUk2n/wAY+wrY0gHhoSGRd2+lIqXq8=
git.gammaspectra.live/P2Pool/zmq4 v0.16.1-0.20240407153747-7f7d531f586e h1:U6zpCbwIW1Pr4wyLjbbRNa3aJcCXwnWOPsJmiHGFKsY=
git.gammaspectra.live/P2Pool/zmq4 v0.16.1-0.20240407153747-7f7d531f586e/go.mod h1:AOWpIfDC+phUiEeiZRXf5oth8YLsfLtflF+6BJNagi4=
github.com/WeebDataHoarder/go-json v0.0.0-20230730135821-d8f6463bb887 h1:P01nqSM+0b6zlPasOFYsqnQSP2dTRVZkanAnY9q/Bcc=
github.com/WeebDataHoarder/go-json v0.0.0-20230730135821-d8f6463bb887/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
git.gammaspectra.live/P2Pool/zmq4 v0.99.0 h1:DYjOTqZKurPLn+/OvC8wFE0+cMnw9bp6CQnzwqAbrXA=
git.gammaspectra.live/P2Pool/zmq4 v0.99.0/go.mod h1:VZEQMCQTRVzrvGZl1E225PPKHl9UQ47CEBvrYkqWKZs=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dolthub/maphash v0.1.0 h1:bsQ7JsF4FkkWyrP3oCnFJgrCUAFbFf3kOl4L/QxPDyQ=
@ -40,8 +40,6 @@ golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
lukechampine.com/uint128 v1.3.0 h1:cDdUVfRwDUDovz610ABgFD17nXD4/uDgVHl2sC3+sbo=

View file

@ -75,9 +75,9 @@ func main() {
}
if buildInfo, _ := debug.ReadBuildInfo(); buildInfo != nil {
utils.Logf("P2Pool", "Consensus Software %s %s (go version %s)", types.CurrentSoftwareId, types.CurrentSoftwareVersion, buildInfo.GoVersion)
utils.Logf("P2Pool", "Consensus Software %s %s %s (%s)", types.CurrentSoftwareId, types.CurrentSoftwareVersion, buildInfo.Main.Version, buildInfo.GoVersion)
} else {
utils.Logf("P2Pool", "Consensus Software %s %s (go version %s)", types.CurrentSoftwareId, types.CurrentSoftwareVersion, runtime.Version())
utils.Logf("P2Pool", "Consensus Software %s %s (%s)", types.CurrentSoftwareId, types.CurrentSoftwareVersion, runtime.Version())
}
client.SetDefaultClientSettings(fmt.Sprintf("http://%s:%d", *moneroHost, *moneroRpcPort))