Skip to content

Commit

Permalink
make price configurable with env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
riccardobl committed Jun 1, 2024
1 parent bb53298 commit 1a697de
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions openagents/OpenAgentsNode.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,16 @@ def __init__(self, config: NodeConfig):
self.logger = None
self.loopInterval = 100


self.NWC = os.getenv('NWC', None)
if self.NWC and "prices" not in self.meta:
self.meta["prices"] = [
{
"amount": int(os.getenv('PRICE_SATS', os.getenv('PRICE_MSATS', "3000"))),
"currency": os.getenv('CURRENCY', "bitcoin"),
"protocol": os.getenv('PROTOCOL', "lightning"),
}
]

self.nodeName = self.meta["name"]
self.nodeIcon = self.meta["picture"]
self.nodeVersion = self.meta["version"]
Expand Down Expand Up @@ -131,7 +140,7 @@ def _getClient(self):

interceptors=None
nodeToken = os.getenv('NODE_TOKEN', None)
nwc = os.getenv('NWC', None)
nwc = self.NWC
if nodeToken or nwc:
metadata=[]
if nwc:
Expand Down

0 comments on commit 1a697de

Please sign in to comment.