Skip to content

Commit 70dc8ad

Browse files
committed
Update requirements.txt and README.md for use with mutinynet
1 parent b8ca105 commit 70dc8ad

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

sauron/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ Here is a fully reptilian example running against [blockstream.info](https://blo
2424
lightningd --mainnet --disable-plugin bcli --plugin $PWD/sauron.py --sauron-api-endpoint https://blockstream.info/api/
2525
```
2626

27+
28+
Here is an example running against [mutinynet.com](https://mutinynet.com/):
29+
30+
```
31+
lightningd --signet --disable-plugin bcli --plugin $PWD/sauron.py --sauron-api-endpoint https://mutinynet.com/api/
32+
```
33+
34+
2735
You can use also proxy your requests through [Tor](https://www.torproject.org/) by
2836
specifying a SOCKS proxy to use with the `--sauron-tor-proxy` startup option, in
2937
the form `address:port`.

sauron/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
pyln-client>=23.2
1+
pyln-client==24.5
22
requests[socks]>=2.23.0

sauron/sauron.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class SauronError(Exception):
1717
pass
1818

1919
def fetch(url):
20-
"""Fetch this {url}, maybe through a pre-defined proxy."""
20+
"""Fetch the given {url}, maybe through a pre-defined proxy."""
2121
# FIXME: Maybe try to be smart and renew circuit to broadcast different
2222
# transactions ? Hint: lightningd will agressively send us the same
2323
# transaction a certain amount of times.
@@ -79,6 +79,7 @@ def init(plugin, options, **kwargs):
7979
def getchaininfo(plugin, **kwargs):
8080
blockhash_url = "{}/block-height/0".format(plugin.api_endpoint)
8181
blockcount_url = "{}/blocks/tip/height".format(plugin.api_endpoint)
82+
8283
chains = {
8384
"000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f": "main",
8485
"000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943": "test",
@@ -117,7 +118,9 @@ def getchaininfo(plugin, **kwargs):
117118

118119
@plugin.method("getrawblockbyheight")
119120
def getrawblock(plugin, height, **kwargs):
121+
# Step 1: Get the block hash by height
120122
blockhash_url = "{}/block-height/{}".format(plugin.api_endpoint, height)
123+
121124
blockhash_req = fetch(blockhash_url)
122125
if blockhash_req.status_code != 200:
123126
return {
@@ -278,6 +281,7 @@ def estimatefees(plugin, **kwargs):
278281
{"blocks": 144, "feerate": slow}
279282
]
280283

284+
# Return the estimated fees
281285
return {
282286
"opening": normal,
283287
"mutual_close": normal,
@@ -295,6 +299,7 @@ def estimatefees(plugin, **kwargs):
295299
"sauron-api-endpoint",
296300
"",
297301
"The URL of the esplora instance to hit (including '/api').",
302+
"The URL of the mutinynet instance to hit (including '/api').",
298303
)
299304

300305
plugin.add_option(

0 commit comments

Comments
 (0)