git.gammaspectra.live/P2Pool/consensus@v0.0.0-20240403173234-a039820b20c9/README.md (about)

     1  # P2Pool Observer
     2  
     3  This repository contains several libraries and utilities to produce statistics and historical archives of [Monero P2Pool](https://github.com/SChernykh/p2pool) decentralized pool, including consensus-compatible reimplementation of a P2Pool server instance.
     4  
     5  Other general tools to work with Monero cryptography are also included.
     6  
     7  ## Reporting issues
     8  
     9  You can give feedback or report / discuss issues on:
    10  * [The issue tracker on git.gammaspectra.live/P2Pool/consensus](https://git.gammaspectra.live/P2Pool/consensus/issues?state=open)
    11  * Via IRC on [#p2pool-observer@libera.chat](ircs://irc.libera.chat/#p2pool-observer), or via [Matrix](https://matrix.to/#/#p2pool-observer:monero.social)
    12  * Any of the relevant rooms for the specific observer instances listed below.
    13  
    14  ## Maintainer-run Observer Instances
    15  
    16  | Host                                                          | Onion Address                                                                                                                            | IRC Channel                                                                                                                                                         | Notes                                                                        |
    17  |---------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------|
    18  | [P2Pool.Observer](https://p2pool.observer/)                   | [p2pool2giz2r5cpqicajwoazjcxkfujxswtk3jolfk2ubilhrkqam2id.onion](http://p2pool2giz2r5cpqicajwoazjcxkfujxswtk3jolfk2ubilhrkqam2id.onion/) | [#p2pool-log](ircs://irc.libera.chat/#p2pool-log) or [Matrix](https://matrix.to/#/#p2pool-log:monero.social)                                                        | Tracking up-to-date [Main P2Pool](https://p2pool.io/) on Mainnet             | 
    19  | [MINI.P2Pool.Observer](https://mini.p2pool.observer/)         | [p2pmin25k4ei5bp3l6bpyoap6ogevrc35c3hcfue7zfetjpbhhshxdqd.onion](http://p2pmin25k4ei5bp3l6bpyoap6ogevrc35c3hcfue7zfetjpbhhshxdqd.onion/) | [#p2pool-mini](ircs://irc.libera.chat/#p2pool-mini) or [Matrix](https://matrix.to/#/#p2pool-mini:libera.chat) [[2]](https://matrix.to/#/#p2pool-mini:monero.social) | Tracking up-to-date [Mini P2Pool](https://p2pool.io/mini/) on Mainnet        |
    20  | [OLD.P2Pool.Observer](https://old.p2pool.observer/)           | [temp2p7m2ddclcsqx2mrbqrmo7ccixpiu5s2cz2c6erxi2lppptdvxqd.onion](http://temp2p7m2ddclcsqx2mrbqrmo7ccixpiu5s2cz2c6erxi2lppptdvxqd.onion/) | [#p2pool-log](ircs://irc.libera.chat/#p2pool-log) or [Matrix](https://matrix.to/#/#p2pool-log:monero.social)                                                        | Tracking old fork pre-v3.0 [Main P2Pool](https://p2pool.io/) on Mainnet      |
    21  | [OLD-MINI.P2Pool.Observer](https://old-mini.p2pool.observer/) | [temp2pbud6av2jx3lh3yovrj4mjjy2k4p5rxydviosp356ndzs4nd6yd.onion](http://temp2pbud6av2jx3lh3yovrj4mjjy2k4p5rxydviosp356ndzs4nd6yd.onion/) | [#p2pool-mini](ircs://irc.libera.chat/#p2pool-mini) or [Matrix](https://matrix.to/#/#p2pool-mini:libera.chat) [[2]](https://matrix.to/#/#p2pool-mini:monero.social) | Tracking old fork pre-v3.0 [Mini P2Pool](https://p2pool.io/mini/) on Mainnet |
    22  
    23  ## Donations
    24  This project is provided for everyone to use, for free, as a hobby project. Any support is appreciated.
    25  
    26  Donate to support this project, its development, and running the Observer Instances on [4AeEwC2Uik2Zv4uooAUWjQb2ZvcLDBmLXN4rzSn3wjBoY8EKfNkSUqeg5PxcnWTwB1b2V39PDwU9gaNE5SnxSQPYQyoQtr7](monero:4AeEwC2Uik2Zv4uooAUWjQb2ZvcLDBmLXN4rzSn3wjBoY8EKfNkSUqeg5PxcnWTwB1b2V39PDwU9gaNE5SnxSQPYQyoQtr7?tx_description=P2Pool.Observer)
    27  
    28  You can also use the OpenAlias `p2pool.observer` directly on the GUI.
    29  
    30  ## Operational instructions
    31  
    32  A docker-compose setup is provided and documented.
    33  
    34  If desired each tool can be run individually, but that is left to the user to configure, refer to Docker setup as reference.  
    35  
    36  ### Requirements
    37  * `docker-compose` or similar
    38  * `git` installed
    39  * Disk space for new incoming historic data. Assume a few tens of MiB per day
    40  * A monerod non-pruned node running in unrestricted mode preferably, but can work with restricted mode. 
    41  * Enough RAM to fit state and incoming queries. It can run with lower with adjustment of settings, but 8 GiB per instance should be fine.
    42  
    43  ### Initial setup
    44  ```bash
    45  $ git clone https://git.gammaspectra.live/P2Pool/consensus.git test-instance
    46  $ cd test-instance
    47  $ cp .env.example .env
    48  ```
    49  Edit `.env` via your preferred editor, specifically around the monerod host options and generate keys for the Tor hidden service.
    50  
    51  If you want to make changes to additional docker-compose settings, do not edit `docker-compose.yml`. Instead create `docker-compose.override.yml` and place new settings there. See [Multiple Compose files documentation](https://docs.docker.com/compose/extends/#multiple-compose-files).
    52  
    53  ### Update / Apply new settings
    54  Within the instance folder, run this command
    55  ```bash
    56  $ git checkout -- '*/default.pgo'; \
    57  git pull && \
    58  docker-compose build --pull && \
    59  docker-compose up -d && \
    60  docker-compose restart tor site pgo-p2pool pgo-daemon pgo-web pgo-api
    61  ```
    62  `docker-compose restart tor` is necessary due to the tor server not refreshing DNS of the containers.
    63  
    64  It is recommended to run `docker system prune` regularly or after update to cleanup no longer used images.
    65  
    66  ### Backfill likely sweep transactions
    67  When a new instance starts with previously imported archives you might want to backfill sweep transactions. For new instances this is not necessary, and you can also skip this step and just rely on future data.
    68  ```bash
    69  $ docker-compose exec --workdir /usr/src/p2pool daemon \
    70  go run -v git.gammaspectra.live/P2Pool/consensus/cmd/scansweeps \
    71  -host MONEROD_HOST -rpc-port MONEROD_RPC_PORT \
    72  -api-host "http://p2pool:3131" \
    73  -db="host=db port=5432 dbname=p2pool user=p2pool password=p2pool sslmode=disable"
    74  ```
    75  
    76  Can also specify `-e TRANSACTION_LOOKUP_OTHER=https://OTHER_INSTANCE` just before `daemon` to query other instances additionally with alternate or longer history.
    77  
    78  
    79  ### Development notes
    80  
    81  Requires using CGO when running the main modes where RandomX hashes are used, but can be used with `CGO_ENABLED=0` specifically as a library.
    82  
    83  You can install the RandomX dependency via this command:
    84  ```bash
    85  $ git clone --depth 1 --branch master https://github.com/tevador/RandomX.git /tmp/RandomX && cd /tmp/RandomX && \
    86      mkdir build && cd build && \
    87      cmake .. -DCMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX:PATH=/usr && \
    88      make -j$(nproc) && \
    89      sudo make install && \
    90      cd ../ && \
    91      rm -rf /tmp/RandomX
    92  ```
    93  
    94  
    95  To generate web templates, run this command:
    96  ```bash
    97  $ go run github.com/valyala/quicktemplate/qtc@v1.7.0
    98  ```
    99  
   100  To update module dependencies, use these commands:
   101  ```bash
   102  $ for f in $(find . -name go.mod); do (cd $(dirname $f); GOPROXY=direct go get -u ./...); done
   103  $ for f in $(find . -name go.mod); do (cd $(dirname $f); GOPROXY=direct go mod tidy); done
   104  $ go work sync
   105  ```