Skip to content

Commit

Permalink
Updated documentation for both bot and ringtools-web
Browse files Browse the repository at this point in the history
  • Loading branch information
dsbaars committed Jan 20, 2022
1 parent 41fa270 commit 2163965
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 57 deletions.
Binary file added docs/screenshots/admin-permissions-small.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/screenshots/admin-permissions.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 24 additions & 4 deletions docs/tg/admins.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,19 @@

## Ring Wizard

The ring wizard automates the channel setup, just use `/start_ring_wizard` and follow the steps.
The ring wizard automates the channel setup, just use `/start_ring_wizard` and follow the steps. Make sure you set all necessary permissions correctly.

<center>
![Required admin permissions](/screenshots/admin-permissions-small.png)
</center>

## Manually set up Telegram channel

1. Create channel group, set name and invite [@ringtools_bot](https://t.me/ringtools_bot).
2. Set name and size:
- `/set_name [RingName]` (e.g.) `/set_name #SRROF_1Msats_21stRING`
- `/set_size [RingSize]` (e.g.) `/set_size 1000000`
3. Get channel logo: `/ring_group_logo_update` (It should automatically detect size and number from the Ring Name).
3. Get channel logo: `/update_logo` (It should automatically detect size and number from the Ring Name).
4. Create ringleader poll: `/poll_ringleader`
5. Set autoclean (optional):
- `/set_autoclean cmd true` (Removes bot commands by others after 1 minute)
Expand All @@ -23,8 +27,24 @@ The ring wizard automates the channel setup, just use `/start_ring_wizard` and f

## Opening channels

1. (Optional) reorder participats with `/set_order [PubKeysContents]` (after reordering, download pubkeys.txt from [ringtools-web](https://rof.tools))
1. (Optional) reorder participants with `/set_order [PubKeysContents]` (after reordering, download pubkeys.txt from [ringtools-web](https://rof.tools))
2. Post channel opening instructions message `/post_message opening_channels`
2. Share ring visual from the watch page of [ringtools-web](https://rof.tools)
3. Let know who has to open with who `/ring_channels long`
4. Set the channel message to auto update with `/set_ring_mode opening_channels`
5. Get ring visual `/ring_visual`
5. Get ring visual `/ring_visual`

## Choose ringleader and post balancing instructions

1. Reorder participants so the ringleader will be at the bottom with `/set_order [PubKeysContents]` (after reordering, download pubkeys.txt from [ringtools-web](https://rof.tools))
2. Make sure the ringleader has set a username and said `/start` in a DM to [@ringtools_bot](https://t.me/ringtools_bot), and that [@ringtools_bot](https://t.me/ringtools_bot) has the permission to promote other users.
3. Make someone ringleader `/set_ringleader @ringleader`
4. Post the igniter instructions message `/post_message igniter`
5. (Optional) generate the `igniter.conf` file `/get_file igniterconf`

## After balancing

1. Post the fee information message `/post_message fee_info`
2. Set the ring to balanced `/set_ring_mode balanced`
3. Update the ring logo `/update_logo`
4. Post the balanced message `/post_message balanced`
12 changes: 8 additions & 4 deletions docs/tg/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ The RingTools Telegram-bot is currently main supporting the Satoshi Radio / Conn
/fullnodeaddress [PubKey] - Get full address of lightning node
/nodeinfo [PubKey] - Get Lightning node info
/chaninfo [ChannelID] - Get Lightning channel info
/set_country [CountryCode] - Set your country to #connect_the_world (e.g. NL or US)
/add_node - Register node (see convience features)
/country_visible - Make country visible in ring participation polls.
````

## Ring-group commands
Expand All @@ -30,7 +33,7 @@ The RingTools Telegram-bot is currently main supporting the Satoshi Radio / Conn
/set_country [CountryCode] - Set your country to #connect_the_world (e.g. NL or US)
/unparticipate - Leave this ring
/get_tz - Get overview of timezones of all participants
/get_file [ignitersh] - Get igniter.sh file (only when all channels are opened)
/get_file [igniterconf] - Get igniter.conf file (only when all channels are opened)
````

### For masters of ceremony
Expand All @@ -51,12 +54,13 @@ The RingTools Telegram-bot is currently main supporting the Satoshi Radio / Conn
/ring_greet [true/false] [cleanDelay] - Enable/disable new user greeting
/update_name - Update ring name
/ring_visual - Get ring visual (same as on rof.tools)
/ring_group_logo_update - Update ring group logo
/update_logo - Update ring group logo
````

### Poll commands
````text
/poll_ring [RingName] [MaxPpl] - Create poll to join a ring (admins only)
````diff
- /poll_ring [RingName] [MaxPpl] - Create poll to join a ring, old format (admins only)
/poll_ring_v2 [RingName] [MaxPpl] - Create poll to join a ring (admins only)
/poll_ringleader - Create poll to become ringleader (admins only)
/admin_close_poll - Force close poll
````
98 changes: 49 additions & 49 deletions docs/web/local-install.md
Original file line number Diff line number Diff line change
@@ -1,60 +1,60 @@
# Local Instance

To use RingTools-web on your own machine, you also need a backend.

## Instructions

1. Install dependencies with `yarn install`
2. Configure settings by modifying `.env`
2. Make sure custom [custom LND PubSub server](https://github.com/dsbaars/srrof-lnd-pubsub-python) is running
3. Start development server with `yarn start`
4. Navigate to `http://localhost:4200/`

# Umbrel

## Required modification of `lnd.conf` when using Umbrel

When using Umbrel, LND is configured to only accept connections of other dockerized applications. This is very secure, but makes it impossible to connect to outside of the Umbrel docker network.

To use this web-application using [dsbaars/srrof-lnd-pubsub-python](https://github.com/dsbaars/srrof-lnd-pubsub-python) you need to reconfigure your LND instance so it will accept connections from your LAN. Alternatively you could add the [LND PubSub Server](https://github.com/dsbaars/srrof-lnd-pubsub-python) to the existing Umbrel network but that is likely to break when you are updating Umbrel.

**Warning**: Although in my opinion this is a safe modification, do not trust me blindly. Please understand the basics of what the effects of this modification are. Proceed at your own risk.

The [LND gRPC API Reference](https://api.lightning.community/#lnd-grpc-api-reference) and the [Imports and Client section of the Python information](https://github.com/lightningnetwork/lnd/blob/master/docs/grpc/python.md#imports-and-client) should help you understand.

> At the time of writing this documentation, two things are needed in order to make a gRPC request to an lnd instance: a TLS/SSL connection and a macaroon used for RPC authentication.
> Note that when an IP address is used to connect to the node (e.g. 192.168.1.21 instead of localhost) you need to add `--tlsextraip=192.168.1.21` to your `lnd` configuration and re-generate the certificate (delete tls.cert and tls.key and restart lnd).
What you are doing will regenerate your TLS certificates so it will include the IP-address and the hostname of your umbrel node.

**Important**: Although both the certificate and the private key are regenerated, you only need the certificate itself. If you are going to run the PubSub server externally, you only need to copy `tls.cert` and the `readonly.macaroon`.

### Instructions
To use RingTools-web on your own node, you can use the pre-made docker image, build the docker-image yourself or run the components from source.

## Umbrel using docker image

You can run ringtools-web on your umbrel node with the pre-made image:

1) Put the following in a `docker-compose.yml` file on your node:
````YAML
version: "3.7"

services:
ringtoolsweb:
image: ghcr.io/ringtools/ringtools-web:latest
ports:
- "7464:7464"
networks:
- umbrel
environment:
- PORT=7464
- LND_REST_API_WS=wss://10.21.21.9:8080
- LND_REST_API=https://10.21.21.9:8080
- MACAROON_FILE=/lnd/readonly.macaroon
- TLS_CERT_FILE=/lnd/tls.cert
volumes:
- /home/umbrel/umbrel/lnd/tls.cert:/lnd/tls.cert:ro
- /home/umbrel/umbrel/lnd/data/chain/bitcoin/mainnet/readonly.macaroon:/lnd/readonly.macaroon:ro
networks:
umbrel:
external: true
name: umbrel_main_network
````

**Note**: You will have to restart LND to apply the changes.
2. Run it with `docker-compose up -d`
3. Your local ringtools-web instance should be available at http://umbrel.local:7464
4. To stop it, run `docker-compose stop`

1. Make a backup of your `lnd.conf`
- `cd ~/umbrel/lnd`
- `cp lnd.conf lnd.conf.bak`
If you prefer to build your own docker image, the source is available on [Github](https://github.com/ringtools/ringtools-web-docker)

2. Open the text editor (e.g. `nano ~/umbrel/lnd/lnd.conf` of your choice and add `tlsextraip=<your ip>` below the existing `tlsextraip=` line.
## Run from source

3. Just below the new entry, add another `tlsextradomain=` entry so it contains two entries in total:
````
tlsextradomain=umbrel.local
tlsextradomain=umbrel
````

4. Save and close the text editor
### Server (backend)

5. Restart lnd
- `cd ~/umbrel`
- `docker-compose restart lnd`
1. Clone the server repository: `git clone https://github.com/ringtools/ringtools-server-ts`
2. Set up the `.env` tailored to your environment (see `.env.sample` for all options)
3. Install dependencies `yarn install`
4. Run the server `yarn start`
5. The backend should be available at `http://localhost:7464` (Unless you set a different value for the `PORT` environment variable)

6. Wait until your node comes up again and that Umbrel still works, if not copy back the backpu config file and try again.
### Frontend

You can verify that multiple `tlsextraip` and `tlsextradomain` are allowed at [Line 44 of the sample config](https://github.com/lightningnetwork/lnd/blob/master/sample-lnd.conf#L44).
1. Clone the server repository: `git clone https://github.com/ringtools/ringtools-web-v2.git`
2. If necessary, set up the `.env` tailored to your environment (see `.env.defaults` for all options) The default value works if you compile the frontend and serve it using the `server`.
3. Install dependencies `yarn install`
4. Run the server `yarn start`
5. The backend should be available at `http://localhost:4200`

Also you can read that `tlsautorefresh=1` automatically regenerates the necessary files, so although stated in their own guide, no deletion is required.
You might need to restart other Umbrel services since the TLS certificate is probably used by other Umbrel apps as well.
**Note**: You might need to modify the CORS settings on the server to make it work on localhost.

0 comments on commit 2163965

Please sign in to comment.