Skip to content

Commit

Permalink
modified the README in roles/pool dir (#802)
Browse files Browse the repository at this point in the history
  • Loading branch information
ikeogu authored Apr 5, 2024
1 parent 0ed397c commit 96c593e
Showing 1 changed file with 25 additions and 35 deletions.
60 changes: 25 additions & 35 deletions roles/pool/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@

# SRI Pool

SRI Pool is designed to communicate with Downstream role (most typically a Translator Proxy or a Mining Proxy) running SV2 protocol to exploit features introduced by its sub-protocols.

The most typical high level configuration is:
Expand All @@ -18,47 +20,35 @@ The most typical high level configuration is:
```

## Setup

### Configuration File
The `pool-config-example.toml` is a configuration example which can be copy/paste into `/conf` directory by the party that is running the SV2 Pool (most
typically the pool service provider) to address the most preferred customization.

`pool-config-hosted-tp-example.toml` and `pool-config-local-tp-example.toml` are examples of configuration files.

The configuration file contains the following information:

1. The SRI Pool information which includes the SRI Pool authority public key
(`authority_pubkey`), the SRI Pool authority secret key (`authority_secret_key`), along with its certificate validity (`cert_validity_sec`). In addition to this, it contains the address which it will use to listen to new connection from downstream roles (`listen_address`) and the list of uncompressed pubkeys for coinbase payout (`coinbase_outputs`).
2. The SRI Pool Job Negatiator information which includes the Template Provider address (`tp_address`) and the address it uses to listen new request from the downstream JDs (`jd_address`).
3. Optionally, you may want to verify that your TP connection is authentic. You may get `tp_authority_public_key` from the logs of your TP, for example:
1. The SRI Pool information which includes the SRI Pool authority public key
(`authority_public_key`), the SRI Pool authority secret key (`authority_secret_key`).
2. The address which it will use to listen to new connection from downstream roles (`listen_address`)
3. The list of uncompressed pubkeys for coinbase payout (`coinbase_outputs`)
4. A string that serves as signature on the coinbase tx (`pool_signature`).
5. The Template Provider address (`tp_address`).
6. Optionally, you may want to verify that your TP connection is authentic. You may get `tp_authority_public_key` from the logs of your TP, for example:

```
# 2024-02-13T14:59:24Z Template Provider authority key: EguTM8URcZDQVeEBsM4B5vg9weqEUnufA8pm85fG4bZd
```

### Run
1. Copy the `pool-config-example.toml` into `conf/` directory.
2. Edit it with custom desired configuration and rename it `pool-config.toml`
> <ins>**Warning**</ins><br>
> If you want to mine spendable bitcoin on regtest, you can do it with bitcoin-cli:
> 1. Get a legacy Bitcoin address:
> ```
> bitcoin-cli -regtest -rpcwallet="<PUT YOUR WALLET NAME HERE>" getnewaddress "test" "legacy"
> ```
> 2. Retrieve its corresponding public key:
> ```
> bitcoin-cli -regtest getaddressinfo <PUT THE ADDRESS GENERATED HERE>
> ```
> 3. Copy the pubkey showed in the output
> 4. Paste it in the `coinbase_outputs` of `pool-config.toml`, after deleting the one which is already present
> 5. Mine a block
> 6. Generate 100 blocks
> ```
> bitcoin-cli -regtest generatetoaddress 100 bcrt1qc5xss0cma0zldxfzzdpjxsayut7yy86e2lr6km
> ```
> Now the mined bitcoin are spendable!
3. Run the Pool:
```
cd roles/v2/pool
```
```
cargo run -p pool_sv2 -- -c conf/pool-config.toml
```

There are two files found in `roles/pool/config-examples`

1. `pool-config-hosted-tp-example.toml` runs on our community hosted server.
2. `pool-config-example-tp-example.toml` runs with your local config.

Run the Pool:

```bash
cd roles/pool/config-examples
cargo run -- -c pool-config-hosted-tp-example.toml
```

0 comments on commit 96c593e

Please sign in to comment.