mirror of
https://github.com/aljazceru/python-teos.git
synced 2025-12-17 06:04:21 +01:00
Update missing readmes and circleci
- Some apps intances were not removed - requeriment paths were wrong in circleci and some apps path needed to be removed
This commit is contained in:
@@ -21,7 +21,7 @@ jobs:
|
|||||||
# Download and cache dependencies
|
# Download and cache dependencies
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
keys:
|
keys:
|
||||||
- v1-dependencies-{{ checksum "teos/requirements.txt" }}-{{ checksum "teos/requirements-dev.txt" }}-{{ checksum "apps/cli/requirements-dev.txt" }}-{{ checksum "test/teos/e2e/bitcoind_snap.sh" }}
|
- v1-dependencies-{{ checksum "requirements.txt" }}-{{ checksum "requirements-dev.txt" }}-{{ checksum "cli/requirements.txt" }}-{{ checksum "test/teos/e2e/bitcoind_snap.sh" }}
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Install dependencies
|
name: Install dependencies
|
||||||
@@ -31,15 +31,15 @@ jobs:
|
|||||||
python3 -m venv venv
|
python3 -m venv venv
|
||||||
. venv/bin/activate
|
. venv/bin/activate
|
||||||
sudo pip install --upgrade pip
|
sudo pip install --upgrade pip
|
||||||
pip install -r teos/requirements.txt
|
pip install -r requirements.txt
|
||||||
pip install -r teos/requirements-dev.txt
|
pip install -r requirements-dev.txt
|
||||||
pip install -r apps/cli/requirements-dev.txt
|
pip install -r cli/requirements.txt
|
||||||
|
|
||||||
- save_cache:
|
- save_cache:
|
||||||
paths:
|
paths:
|
||||||
- ./venv
|
- ./venv
|
||||||
- /snap
|
- /snap
|
||||||
key: v1-dependencies-{{ checksum "teos/requirements.txt" }}-{{ checksum "teos/requirements-dev.txt" }}-{{ checksum "apps/cli/requirements-dev.txt" }}-{{ checksum "test/teos/e2e/bitcoind_snap.sh" }}
|
key: v1-dependencies-{{ checksum "requirements.txt" }}-{{ checksum "requirements-dev.txt" }}-{{ checksum "cli/requirements.txt" }}-{{ checksum "test/teos/e2e/bitcoind_snap.sh" }}
|
||||||
|
|
||||||
# Run bitcoind for E2E testing (running it early so it has time to bootstrap)
|
# Run bitcoind for E2E testing (running it early so it has time to bootstrap)
|
||||||
- run:
|
- run:
|
||||||
@@ -54,7 +54,7 @@ jobs:
|
|||||||
name: Creates config files
|
name: Creates config files
|
||||||
command: |
|
command: |
|
||||||
cp teos/sample_conf.py teos/conf.py
|
cp teos/sample_conf.py teos/conf.py
|
||||||
cp apps/cli/sample_conf.py apps/cli/conf.py
|
cp cli/sample_conf.py cli/conf.py
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Run teos unit tests
|
name: Run teos unit tests
|
||||||
@@ -72,7 +72,7 @@ jobs:
|
|||||||
name: Run cli unit tests
|
name: Run cli unit tests
|
||||||
command: |
|
command: |
|
||||||
. venv/bin/activate
|
. venv/bin/activate
|
||||||
pytest test/apps/cli/unit
|
pytest test/cli/unit
|
||||||
|
|
||||||
# Setup teos for E2E testing
|
# Setup teos for E2E testing
|
||||||
- run:
|
- run:
|
||||||
@@ -80,8 +80,8 @@ jobs:
|
|||||||
command: |
|
command: |
|
||||||
. venv/bin/activate
|
. venv/bin/activate
|
||||||
cp test/teos/e2e/teos-conf.py teos/conf.py
|
cp test/teos/e2e/teos-conf.py teos/conf.py
|
||||||
python3 -m apps.generate_key -d ~/.teos/
|
python3 -m generate_keys -d ~/.teos/
|
||||||
python3 -m apps.generate_key -n cli -d ~/.teos_cli/
|
python3 -m generate_keys -n cli -d ~/.teos_cli/
|
||||||
cp ~/.teos/teos_pk.der ~/.teos_cli/
|
cp ~/.teos/teos_pk.der ~/.teos_cli/
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
- `python3`
|
- `python3`
|
||||||
- `pip3`
|
- `pip3`
|
||||||
|
- `bitcoind`
|
||||||
|
|
||||||
### Checking if the dependencies are already satisfied
|
### Checking if the dependencies are already satisfied
|
||||||
|
|
||||||
@@ -47,6 +48,11 @@ A similar thing to the `python` alias applies to the `pip` alias. We can check i
|
|||||||
|
|
||||||
And, if it happens to be installed, change the alias to `pip3`, or use `pip3` instead of `pip`.
|
And, if it happens to be installed, change the alias to `pip3`, or use `pip3` instead of `pip`.
|
||||||
|
|
||||||
|
### Installing bitcoind
|
||||||
|
|
||||||
|
`teos` runs on top of a Bitcoin Core node. Other underlaying Bitcoin nodes are not supported at the moment.
|
||||||
|
|
||||||
|
You can get Bitcoin Core from [bitcoin.org](https://bitcoin.org/en/download).
|
||||||
|
|
||||||
### Installing the dependencies
|
### Installing the dependencies
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
|
## State of the code
|
||||||
|
|
||||||
|
Currently working on updating the software to match [BOLT13 rev1](https://github.com/sr-gi/bolt13).
|
||||||
|
|
||||||
# The Eye of Satoshi (TEOS)
|
# The Eye of Satoshi (TEOS)
|
||||||
|
|
||||||
The Eye of Satoshi is a Lightning watchtower compliant with [BOLT13](https://github.com/sr-gi/bolt13), written in Python 3.
|
The Eye of Satoshi is a Lightning watchtower compliant with [BOLT13](https://github.com/sr-gi/bolt13), written in Python 3.
|
||||||
@@ -10,7 +14,6 @@ TEOS consists in three main modules:
|
|||||||
|
|
||||||
Additionally, tests for every module can be found at `tests`.
|
Additionally, tests for every module can be found at `tests`.
|
||||||
|
|
||||||
|
|
||||||
### Running TEOS
|
### Running TEOS
|
||||||
In order to run `teos` you will need to create a configuration file (follow [INSTALL.md](INSTALL.md)) and run `teosd.py`. Currently you will also need a set of keys (to sign appointments) stored in your data directory.
|
In order to run `teos` you will need to create a configuration file (follow [INSTALL.md](INSTALL.md)) and run `teosd.py`. Currently you will also need a set of keys (to sign appointments) stored in your data directory.
|
||||||
|
|
||||||
@@ -19,7 +22,9 @@ You can use `generate_keys.py` to generate those keys.
|
|||||||
### Interacting with a TEOS instance
|
### Interacting with a TEOS instance
|
||||||
You can interact with a `teos` instance (either run by yourself or someone else) by using `teos_cli` under `cli`.
|
You can interact with a `teos` instance (either run by yourself or someone else) by using `teos_cli` under `cli`.
|
||||||
|
|
||||||
Since `teos_cli` works independently of `teos`, you will need a separate configuration file for this (follow [cli/INSTALL.md](cli/INSTALL.md)) and a different set of keys. You can use `generate_keys.py` to generate those keys.
|
Since `teos_cli` works independently of `teos`, you will need a separate configuration file for this (follow [cli/INSTALL.md](cli/INSTALL.md)).
|
||||||
|
|
||||||
|
`teos_cli` will also need an independent set of keys (that can be generated using `generate_keys.py`) as well as the public key of the tower instance (`teos_pk.der`). The same data directory can be used for both if you are running things locally.
|
||||||
|
|
||||||
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.
|
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.
|
||||||
|
|
||||||
|
|||||||
@@ -5,31 +5,31 @@
|
|||||||
There are two ways of running `teos_cli`: adding the library to the `PYTHONPATH` env variable, or running it as a module.
|
There are two ways of running `teos_cli`: adding the library to the `PYTHONPATH` env variable, or running it as a module.
|
||||||
|
|
||||||
## Modifying `PYTHONPATH`
|
## Modifying `PYTHONPATH`
|
||||||
In order to run `teos_cli`, you should set your `PYTHONPATH` env variable to include the folder that contains the `apps` folder. You can do so by running:
|
In order to run `teos_cli`, you should set your `PYTHONPATH` env variable to include the folder that contains the `cli` folder. You can do so by running:
|
||||||
|
|
||||||
export PYTHONPATH=$PYTHONPATH:<absolute_path_to_apps>
|
export PYTHONPATH=$PYTHONPATH:<absolute_path_to_cli_parent>
|
||||||
|
|
||||||
For example, for user alice running a UNIX system and having `apps` in her home folder, she would run:
|
For example, for user alice running a UNIX system and having `cli` in her home folder, she would run:
|
||||||
|
|
||||||
export PYTHONPATH=$PYTHONPATH:/home/alice/
|
export PYTHONPATH=$PYTHONPATH:/home/alice/
|
||||||
|
|
||||||
You should also include the command in your `.bashrc` to avoid having to run it every time you open a new terminal. You can do it by running:
|
You should also include the command in your `.bashrc` to avoid having to run it every time you open a new terminal. You can do it by running:
|
||||||
|
|
||||||
echo 'export PYTHONPATH=$PYTHONPATH:<absolute_path_to_apps>' >> ~/.bashrc
|
echo 'export PYTHONPATH=$PYTHONPATH:<absolute_path_to_cli_parent>' >> ~/.bashrc
|
||||||
|
|
||||||
Once the `PYTHONPATH` is set, you should be able to run `teos_cli` straightaway. Try it by running:
|
Once the `PYTHONPATH` is set, you should be able to run `teos_cli` straightaway. Try it by running:
|
||||||
|
|
||||||
cd <absolute_path_to_apps>/apps/cli
|
cd <absolute_path_to_cli_parent>/cli
|
||||||
python teos_cli.py -h
|
python teos_cli.py -h
|
||||||
|
|
||||||
## Running `teos_cli` as a module
|
## Running `teos_cli` as a module
|
||||||
Python code can be also run as a module, to do so you need to use `python -m`. From `apps` **parent** directory run:
|
Python code can be also run as a module, to do so you need to use `python -m`. From `cli` **parent** directory run:
|
||||||
|
|
||||||
python -m apps.cli.teos_cli -h
|
python -m cli.teos_cli -h
|
||||||
|
|
||||||
Notice that if you run `teos_cli` as a module, you'll need to replace all the calls from `python teos_cli.py <argument>` to `python -m apps.cli.teos_cli <argument>`
|
Notice that if you run `teos_cli` as a module, you'll need to replace all the calls from `python teos_cli.py <argument>` to `python -m cli.teos_cli <argument>`
|
||||||
|
|
||||||
## Modify configuration parameters
|
## Modify configuration parameters
|
||||||
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:
|
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:
|
||||||
|
|
||||||
<absolute_path_to_apps>/apps/cli/conf.py
|
<absolute_path_to_cli_parent>/cli/conf.py
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ from cryptography.hazmat.primitives.asymmetric import ec
|
|||||||
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Simple too to generate an ECDSA key pair using the secp256k1 curve and store it on disk.
|
Simple way too to generate an ECDSA key pair using the secp256k1 curve and store it on disk.
|
||||||
|
|
||||||
Default output dir = .
|
Default output dir = .
|
||||||
Default key naming = teos_sk.der and teos_pk.der
|
Default key naming = teos_sk.der and teos_pk.der
|
||||||
@@ -38,7 +38,7 @@ def save_pk(pk, filename):
|
|||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
name = "teos"
|
name = "teos"
|
||||||
output_dir = "apps"
|
output_dir = "."
|
||||||
|
|
||||||
opts, _ = getopt(argv[1:], "n:d:", ["name", "dir"])
|
opts, _ = getopt(argv[1:], "n:d:", ["name", "dir"])
|
||||||
for opt, arg in opts:
|
for opt, arg in opts:
|
||||||
|
|||||||
Reference in New Issue
Block a user