Skip to content

Commit

Permalink
expand README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
1ma committed May 2, 2024
1 parent 933df7d commit a36dc65
Showing 1 changed file with 73 additions and 22 deletions.
95 changes: 73 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,29 @@ Bitcoin GroupHug is a Bitcoin transactions batching server that does not need co
The transactions are batched in different groups depending on the Bitcoin mining fees they are willing to pay.
The server does not earn any sat for doing the job.

## Usage
## Backend

### Start the GroupHug server
### Building

Currently, the backend for Bitcoin GroupHug has to be built from source, and requires the [Rust toolchain](https://rustup.rs/) to do so.

```shell
$ cd server/grouphug-server
$ cargo build --release
```

The compiled binary can be found at `server/grouphug-server/target/release/grouphug-server`.
To install it, move it to a directory in your `$PATH` such as `$HOME/bin` or `/usr/local/bin` (system-wide).

### Usage

#### Start the GroupHug server

Run the GroupHug server:

$ ./grouphug-server

The server will be runing once you see something similar to:
The server will be running once you see something similar to:

Server running on 127.0.0.1:8787

Expand All @@ -32,7 +46,7 @@ The GroupHug server will respond with the network configured on the Config.toml
TESTNET


### Send transactions
#### Send transactions

A transaction can be sent to the server with the message `add_tx` followed by a raw transaction in hexadecimal.

Expand All @@ -41,36 +55,73 @@ A transaction can be sent to the server with the message `add_tx` followed by a
The server will respond with a `Ok` if the transaction was correctly added to a server. If it was not it will return an error explaining why the transaction could not be added.


### Grouphug front end

TODO



## Configuration
### Configuration

The GroupHug provides a number of configurable parameters to modify its behavior. These settings can be modified in the `Config.toml` file.

### Electrum
`endpoint` -> Specifies the electrum server endpoint you want to use.
#### Electrum
`endpoint` -> Specifies the Electrum server endpoint you want to use.

`certificate_validation` -> set to false if using self-signed certificates, may be necessary if using own electrum server.
`certificate_validation` -> Set to false if using self-signed certificates, will be necessary if your Electrum endpoint has SSL enabled with a self-signed certificate.

### Group
`time` -> Time in seconds that a group can be runing before get closed (not implemented yet).
#### Group
`time` -> Time in seconds that a group can be running before it's closed (not implemented yet).

`max_size` -> Minimum group size for the group to be closed. If when adding a new transaction the number of inputs and outputs is greater than or equal to this parameter the group will be closed.


### Dust & Fee
`limit` -> Minimum value of the outputs not to be considered dust.
#### Dust & Fee
`limit` -> Minimum value of the outputs to not be considered dust.

`range` -> Range of group commissions. e.g., if 3 is specified as the value, the groups will range from 1-3sat/vb, from 3.1 to 5sat/vb, etc.
`range` -> Range of group fees. e.g., if 3 is specified as the value, the groups will range from 1-3 s/vB, from 3.1 to 5 s/vB, etc.

### Server
#### Server
`ip` -> Binding IP.

`port` -> Binding port.

### Network
`network` -> Mainnet, Testnet, Signet. This value is used to comunicate to the clients wich network is the server running.
#### Network
`network` -> Mainnet, Testnet or Signet. This value is echoed back to each client when it connects so it can know on which network is the server running.


## Frontend

GroupHug includes an optional web frontend for submitting transactions to the backend in a more user-friendly way than the command line.

### Requirements

* PHP 8.1 or newer
* Web server (nginx or Caddy)
* [Composer](https://getcomposer.org/) package manager
* A GroupHug server

### Setup

Edit `settings.ini` as necessary to reach GroupHug.
If GroupHug is already running locally with the default TCP port, then the default values of `settings.ini.dist` should work out of the box.

You can bring up the frontend locally using `composer serve`, without the need of a webserver.
It runs on port 8080.

```shell
$ cd frontend
$ cp settings.ini.dist settings.ini
$ composer install

$ composer serve
[Thu May 2 10:04:08 2024] PHP 8.3.6 Development Server (http://127.0.0.1:8080) started
```

### Production webserver

Sample Caddyfile.

```
grouphug.example.com {
root * /var/www/grouphug-manual/web
encode zstd gzip
php_fastcgi unix//run/php/php-fpm.sock {
resolve_root_symlink
}
}
```

0 comments on commit a36dc65

Please sign in to comment.