From 6b621c34b7825fc0733894a8055fa4b8bf6c4ea1 Mon Sep 17 00:00:00 2001 From: 223880 Date: Mon, 19 Aug 2024 06:51:49 -0300 Subject: [PATCH] Fix docs and add channels --- docs/run.md | 10 +++------- src/core/channel.py | 14 +++++++++++++- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/docs/run.md b/docs/run.md index 5ddfa17..32272a6 100644 --- a/docs/run.md +++ b/docs/run.md @@ -2,7 +2,7 @@ # Bolt Machine ## Overview -This Python program demonstrates an algorithm for managing channels in a Lightning Network. It uses various modules to perform actions such as opening, closing, replacing channels, and finding better inbound liquidity. The program incorporates APIs from Ollama and Aperture for enhanced functionality. +This Python program demonstrates an algorithm for managing channels in a Lightning Network. It uses various modules to perform actions such as opening, closing, replacing channels, and finding better inbound liquidity. The program incorporates APIs from Ollama for enhanced functionality. ## Prerequisites @@ -24,7 +24,7 @@ To run this program, you need to have the following prerequisites installed: 3. Install the necessary Python packages: ```bash - pip install ollama aperture + pip install ollama pip install lnd-grpc ``` @@ -33,11 +33,7 @@ To run this program, you need to have the following prerequisites installed: - Obtain an Ollama API key from the Ollama website. - Replace `"YOUR_OLLAMA_API_KEY"` in the code with your actual API key. -2. Set up Aperture API: - - Obtain an Aperture API token from the Aperture website. - - Replace `"YOUR_APERTURE_API_TOKEN"` in the code with your actual API token. - -3. Set up LND: +2. Set up LND: - Ensure LND is properly installed and running. - Configure the LND connection details (host, port, TLS certificate) in the code. diff --git a/src/core/channel.py b/src/core/channel.py index 750cfa5..f5e5663 100644 --- a/src/core/channel.py +++ b/src/core/channel.py @@ -1 +1,13 @@ -From +from lndgrpc import Channel +from lndgrpc import RpcError + +def main(): + channel = Channel("localhost:10009") + try: + channel.getinfo() + except RpcError as e: + print(e.code()) + print(e.message()) + print(e.details()) + print(e.metadata()) + \ No newline at end of file