You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 26, 2022. It is now read-only.
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+7
Original file line number
Diff line number
Diff line change
@@ -104,3 +104,10 @@ We use [pytest](https://docs.pytest.org/en/latest/) to build and run tests. Test
104
104
105
105
We require that all commits to be merge into master are signed. You can enable commit signing on GitHub by following [Signing commits](https://help.github.com/en/github/authenticating-to-github/signing-commits).
106
106
107
+
## Installing the development client
108
+
109
+
You can install the development client for easier testing by setting the development flag (DEV=1) when installing `teos`.
Copy file name to clipboardExpand all lines: DEPENDENCIES.md
+8-15
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@
6
6
7
7
`teos` has the following system-wide dependencies:
8
8
9
-
-`python3` version 3.6+
9
+
-`python3` version 3.7+
10
10
-`pip3`
11
11
-`openssl` version 1.1+
12
12
-`bitcoind`
@@ -58,7 +58,7 @@ And, if it happens to be installed, change the alias to `pip3`, or use `pip3` in
58
58
59
59
You can get Bitcoin Core from [bitcoin.org](https://bitcoin.org/en/download).
60
60
61
-
Bitcoin needs to be running with the following options enables:
61
+
Bitcoin needs to be running with the following options enabled:
62
62
63
63
-`zmq` for rawblockhash notifications
64
64
-`txindex` to be able to look for non-wallet transactions
@@ -90,7 +90,7 @@ maxtxfee=1
90
90
91
91
### Installing the Dependencies
92
92
93
-
`python3`ca be downloaded from the [Python official website](https://www.python.org/downloads/) or installed using a package manager, depending on your distribution. Examples for both UNIX-like and OSX systems are provided.
93
+
`python3`can be downloaded from the [Python official website](https://www.python.org/downloads/) or installed using a package manager, depending on your distribution. Examples for both UNIX-like and OSX systems are provided.
94
94
95
95
#### Ubuntu
96
96
@@ -112,17 +112,10 @@ and for `pip3`:
112
112
113
113
`pip3` will be installed alongside `python3` in this case.
114
114
115
-
## Python Dependencies
115
+
## Python Dependencies
116
116
117
-
`teos` has the following dependencies (which can be satisfied by using `pip install -r requirements.txt`):
118
-
119
-
-`wheel`
120
-
-`zmq`
121
-
-`flask`
122
-
-`cryptography`
123
-
-`coincurve`
124
-
-`pyzbase32`
125
-
-`requests`
126
-
-`plyvel`
127
-
-`readerwriterlock`
117
+
`teos` has several python dependencies that are automatically alongside the it. Should you need to install them manually, you can do so by running:
Copy file name to clipboardExpand all lines: INSTALL.md
+14-20
Original file line number
Diff line number
Diff line change
@@ -2,32 +2,26 @@
2
2
3
3
`teos` has some dependencies that can be satisfied by following [DEPENDENCIES.md](DEPENDENCIES.md). If your system already satisfies the dependencies, you can skip that part.
4
4
5
-
There are two ways of running`teos`: running it as a module or adding the library to the `PYTHONPATH` env variable.
5
+
There are two ways of installing`teos`, from source or getting it from PyPi (the Python Package Index).
6
6
7
-
## Running `teos` as a Module
8
-
The **easiest** way to run `teos` is as a module. To do so you need to use `python -m`. From the teos parent directory run:
7
+
No matter the way you chose, once installed the executables for `teosd` and `teos-cli` will be available in the shell.
9
8
10
-
python -m teos.teosd -h
11
-
12
-
Notice that if you run `teos` as a module, you'll need to replace all the calls from `python teosd.py` to `python -m teos.teosd`
9
+
## Installing from source
13
10
14
-
## Modifying `PYTHONPATH`
15
-
**Alternatively**, you can add `teos` to your `PYTHONPATH` by running:
Copy file name to clipboardExpand all lines: README.md
+28-19
Original file line number
Diff line number
Diff line change
@@ -6,16 +6,19 @@ Currently working on updating the software to match [BOLT13 rev1](https://github
6
6
7
7
The Eye of Satoshi is a Lightning watchtower compliant with [BOLT13](https://github.com/sr-gi/bolt13), written in Python 3.
8
8
9
-
`teos` consists in four main modules:
9
+
`python-teos` consists in four main modules:
10
10
11
-
-`teos`: including the tower's main functionality (server-side)
12
-
-`cli`: including a reference command line interface (client-side)
13
-
-`common`: including shared functionality between `teos` and `cli`.
11
+
-`teos`: including the tower's main functionality (server-side).
12
+
-`cli`: including a reference command line interface.
13
+
-`common`: including shared functionality between server and client side (useful to build a client).
14
14
-`watchtower-plugin`: including a watchtower client plugin for c-lightning.
15
15
16
-
Additionally, tests for every module can be found at `tests`.
16
+
Additionally `contrib` contains tools that are external to the tower (currently `teos_client`, an example Python client for the tower).
17
+
18
+
Tests for every module can be found at `tests`.
17
19
18
20
## Dependencies
21
+
19
22
Refer to [DEPENDENCIES.md](DEPENDENCIES.md)
20
23
21
24
## Installation
@@ -27,14 +30,12 @@ Refer to [INSTALL.md](INSTALL.md)
27
30
Make sure bitcoind is running before running TEOS (it will fail at startup if it cannot connect to bitcoind). You can find
28
31
[here](DEPENDENCIES.md#installing-bitcoind) a sample config file.
29
32
30
-
Before you can run TEOS, you need to follow a few more configuration steps.
31
-
32
33
### Starting the TEOS daemon 👁
33
34
34
-
You can run `teos` by running `teosd.py` under `teos`:
35
+
Once installed, you can start the tower by running:
35
36
36
37
```
37
-
python -m teos.teosd
38
+
teosd
38
39
```
39
40
40
41
### Configuration file and command line parameters
@@ -49,14 +50,14 @@ To change the configuration defaults you can:
49
50
50
51
and / or
51
52
52
-
- Add some global options when running the daemon (run `teosd.py -h` for more info).
53
+
- Add some global options when running the daemon (run `teosd -h` for more info).
53
54
54
55
### Passing command line options to `teosd`
55
56
56
57
Some configuration options can also be passed as options when running `teosd`. We can, for instance, pick the network as follows:
57
58
58
59
```
59
-
python -m teos.teosd --btcnetwork=regtest
60
+
teosd --btcnetwork=regtest
60
61
```
61
62
62
63
### Running TEOS in another network
@@ -84,7 +85,7 @@ btc_network = regtest
84
85
```
85
86
86
87
## Running `teos` in a docker container
87
-
A `teos` image can be built from the Dockerfile located in `/docker`. You can create the image by running:
88
+
A `teos` image can be built from the Dockerfile located in `docker`. You can create the image by running:
88
89
89
90
cd python-teos
90
91
docker build -f docker/Dockerfile -t teos .
@@ -98,6 +99,8 @@ Notice that ENV variables are optional, if unset the corresponding default setti
98
99
```
99
100
- API_BIND=<teos_api_hostname>
100
101
- API_PORT=<teos_api_port>
102
+
- RPC_BIND=<teos_rpc_hostname>
103
+
- RPC_PORT=<teos_rpc_port>
101
104
- BTC_NETWORK=<btc_network>
102
105
- BTC_RPC_CONNECT=<btc_node_hostname>
103
106
- BTC_RPC_PORT=<btc_node_port>
@@ -161,17 +164,23 @@ Otherwise it will bind to `localost` and we won't be able to send requests to th
161
164
162
165
## Interacting with a TEOS Instance
163
166
164
-
You can interact with a `teos` instance (either run by yourself or someone else) by using `teos_cli` under `cli`.
167
+
You can interact with a `teos` instance (either run by yourself or someone else) by using `teos-cli` under `teos/cli`. This is an admin tool that has privileged access to the watchtower, and it should therefore only be used within a trusted environment (for example, the same machine).
168
+
169
+
While `teos-cli` works independently of `teos`, it shares the same configuration file by default, of which it only uses a subset of its settings. The folder can be changed using the `--datadir` command line argument, if desired.
170
+
171
+
For help on the available arguments and commands, you can run:
172
+
173
+
```
174
+
teos-cli -h
175
+
```
165
176
166
-
Since `teos_cli` works independently of `teos`, it uses a different configuration. The defaults can be found at [cli/\_\_init\_\_.py](cli/__init__.py). The same approach as with `teosd` is followed:
177
+
## Interacting with TEOS as a client
167
178
168
-
- A config file (`~/.teos_cli/teos_cli.conf`) can be set to change the defaults.
169
-
- Some options ca also be changed via command line.
170
-
- The configuration file template can be found at [cli/template.conf](cli/template.conf))
179
+
The [contrib/client](contrib/client) folder contains an example Python client that can interact with the watchtower in order to register, add appointments and later retrieve them.
171
180
172
-
`teos_cli` needs an independent set of keys that are also automatically generated in the same way as `teos`.
181
+
See [here](contrib/client) for more information on how to use the client.
173
182
174
-
Notice that `teos_cli`is a simple way to interact with `teos`, but ideally that should be part of your wallet functionality (therefore why they are independent entities). `teos_cli` can be used as an example for how to send data to a [BOLT13](https://github.com/sr-gi/bolt13) compliant watchtower.
183
+
Note that while the client is a simple way to interact with `teos`, ideally its functionality should be part of your wallet or lightning node. `teos_client` can be used as an example for how to send data to a [BOLT13](https://github.com/sr-gi/bolt13) compliant watchtower.
Copy file name to clipboardExpand all lines: contrib/client/DEPENDENCIES.md
+10-10
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,12 @@
1
1
# Dependencies
2
2
3
-
`teos_client` has both system-wide and Python dependencies. This document walks you through how to satisfy them.
3
+
`teos-client` has both system-wide and Python dependencies. This document walks you through how to satisfy them.
4
4
5
5
## System-wide dependencies
6
6
7
-
`teos_client` has the following system-wide dependencies:
7
+
`teos-client` has the following system-wide dependencies:
8
8
9
-
-`python3` version 3.6+
9
+
-`python3` version 3.7+
10
10
-`pip3`
11
11
-`openssl` version 1.1+
12
12
@@ -28,7 +28,7 @@ It is also likely that, if `python3` is installed in our system, the `python` al
28
28
29
29
python3 --version
30
30
31
-
If `python3` is installed but the `python` alias is not set to it, we should either set it, or use `python3` to run `teos_client`.
31
+
If `python3` is installed but the `python` alias is not set to it, we should either set it, or use `python3` to run `teos-client`.
32
32
33
33
Regarding `pip`, we can check what version is installed in our system (if any) by running:
34
34
@@ -51,7 +51,7 @@ And, if it happens to be installed, change the alias to `pip3`, or use `pip3` in
51
51
52
52
### Installing the dependencies
53
53
54
-
`python3`ca be downloaded from the [Python official website](https://www.python.org/downloads/) or installed using a package manager, depending on your distribution. Examples for both UNIX-like and OSX systems are provided.
54
+
`python3`can be downloaded from the [Python official website](https://www.python.org/downloads/) or installed using a package manager, depending on your distribution. Examples for both UNIX-like and OSX systems are provided.
55
55
56
56
#### Ubuntu
57
57
@@ -73,10 +73,10 @@ and for `pip3`:
73
73
74
74
`pip3` will be installed alongside `python3` in this case.
75
75
76
-
## Python dependencies
76
+
## Python Dependencies
77
77
78
-
`teos_client` has the following dependencies (which can be satisfied by using `pip install -r requirements.txt`):
78
+
`teos-client` has several python dependencies that are automatically alongside the it. Should you need to install them manually, you can do so by running:
`teos_client` has some dependencies that can be satisfied by following [DEPENDENCIES.md](DEPENDENCIES.md). If your system already satisfies the dependencies, you can skip that part.
3
+
`teos-client` gets installed alongside `teos` as long as you set the development flag when installing `teos`:
4
4
5
-
There are two ways of running `teos_client`: running it as a module or adding the library to the PYTHONPATH env variable.
5
+
```
6
+
DEV=1 python setup.py install
7
+
```
6
8
7
-
## Running `teos_client` as a module
8
-
The **easiest** way to run `teos_client` is as a module. To do so you need to use `python -m`. From the root directory of `python-teos`, run:
9
+
You can also get a standalone client from pip:
9
10
10
-
python -m contrib.client.teos_client -h
11
-
12
-
Notice that if you run `teos_client` as a module, you'll need to replace all the calls from `python teos_client.py <argument>` to `python -m contrib.client.teos_client <argument>`
13
-
14
-
## Modifying `PYTHONPATH`
15
-
**Alternatively**, you can add `teos_client` to your `PYTHONPATH` by running:
Once the `PYTHONPATH` is set, you should be able to run `teos_client` straightaway. Try it by running:
28
-
29
-
cd <absolute_path_to_python-teos_root>/contrib/client
30
-
python teos_client.py -h
31
-
32
-
33
-
## Modify configuration parameters
34
-
If you'd like to modify some of the configuration defaults (such as the user directory, where the logs and appointment receipts will be stored) you can do so in the config file located at:
35
-
36
-
<data_dir>/.teos_client/teos_client.conf
37
-
38
-
`<data_dir>` defaults to your home directory (`~`).
0 commit comments