Skip to content

Commit

Permalink
Fix typos in documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
nassersaazi authored and sebulino committed Jun 21, 2022
1 parent 33c083c commit 62296de
Show file tree
Hide file tree
Showing 8 changed files with 179 additions and 190 deletions.
20 changes: 10 additions & 10 deletions examples/PickhardtPaymentsExample.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"\n",
"Example code demonstrating how to use the `pickhardtpayments` package in python. You need to install the library via `pip install pickhardtpayments` or you can download the full source code at https://ln.rene-pickhardt.de or a copy from github at: https://www.github.com/renepickhardt/pickhardtpayments\n",
"\n",
"Of course you can use the classes int the library to create your own async payment loop or you could exchange the Oracle to talk to the actual Lightning network by wrapping against your favourite node implementation and exposing the the `send_onion` call. \n",
"Of course you can use the classes in the library to create your own async payment loop or you could exchange the Oracle to talk to the actual Lightning network by wrapping against your favourite node implementation and exposing the the `send_onion` call. \n",
"\n",
"This example assumes a randomly generated Oracle to conduct payments in a simulated way. For this you will need an actual channelgraph which you can get for example with `lightning-cli listchannels > listchannels20220412.json`\n",
"\n",
Expand Down Expand Up @@ -39,14 +39,14 @@
"#Carsten Otto's public node key\n",
"C_OTTO = \"027ce055380348d7812d2ae7745701c9f93e70c1adeb2657f053f91df4f2843c71\"\n",
"\n",
"#we first need to import the chanenl graph from c-lightning jsondump\n",
"#we first need to import the chanenl graph from core lightning jsondump\n",
"#you can get your own data set via:\n",
"# $: lightning-cli listchannels > listchannels20220412.json\n",
"# alternatively you can go to https://ln.rene-pickhardt.de to find a data dump\n",
"channel_graph = ChannelGraph(\"listchannels20220412.json\")\n",
"\n",
"#we now create ourself an Oracle. This is Simulated Network that assumes unformly distribution \n",
"#of the liquidity for the channels on the `channel_graph`. Of course one could create ones own \n",
"#we now create an Oracle. This is a Simulated Network that assumes uniform distribution \n",
"#of the liquidity for the channels on the `channel_graph`. Of course one could create one's own \n",
"#oracle (for example a wrapper to an existing lightning network node / implementation)\n",
"oracle_lightning_network = OracleLightningNetwork(channel_graph)"
]
Expand All @@ -66,7 +66,7 @@
],
"source": [
"# Since we randomly generated our Oracle but also since we control it we can compute\n",
"# The maximum possible amout that can be payed between two nodes\n",
"# The maximum possible amount that can be payed between two nodes\n",
"maximum_payable_amount =oracle_lightning_network.theoretical_maximum_payable_amount(RENE,C_OTTO,1000)\n",
"print(maximum_payable_amount, \"sats would be possible on this oracle to deliver if including 1 sat basefee channels\")\n"
]
Expand All @@ -86,7 +86,7 @@
],
"source": [
"#Of course we want to restrict ourselves to the zeroBaseFee part of the network.\n",
"#Therefor we compute the theoretical maximum payable amount for that subgraph\n",
"#Therefore we compute the theoretical maximum payable amount for that subgraph\n",
"maximum_payable_amount =oracle_lightning_network.theoretical_maximum_payable_amount(RENE,C_OTTO,0)\n",
"print(maximum_payable_amount, \"sats possible on this oracle on the zeroBaseFeeGraph\")"
]
Expand Down Expand Up @@ -307,16 +307,16 @@
}
],
"source": [
"# We chose an amount that is 50% of half the theoretic maximum to demonstrate the the\n",
"# We choose an amount that is half the theoretical maximum to demonstrate the\n",
"# minimum cost flow solver with Bayesian updates on the Uncertainty Network finds the\n",
"# liquidity rather quickly\n",
"tested_amount = int(maximum_payable_amount/2)\n",
"\n",
"# From the channel graph we can derrive our initial Uncertainty Network which is the main data structure\n",
"# From the channel graph we can derive our initial Uncertainty Network which is the main data structure\n",
"# that we maintain in order to deliver sats from one node to another\n",
"uncertainty_network = UncertaintyNetwork(channel_graph)\n",
"\n",
"#we create ourselves a payment session which in this case operates by sending out the onions\n",
"#we create a payment session which in this case operates by sending out the onions\n",
"#sequentially \n",
"payment_session = SyncSimulatedPaymentSession(oracle_lightning_network, \n",
" uncertainty_network,\n",
Expand All @@ -335,7 +335,7 @@
"source": [
"## Optimizing for Fees\n",
"\n",
"controlling mu we can decide how much we wish to focuse on lower fees. However we will see that it will be much harder to deliver the same amount in the sense that we need to send out more onions and also have more failed attampts. Consiquantly we expect to need more time."
"controlling mu we can decide how much we wish to focus on lower fees. However ,we will see that it will be much harder to deliver the same amount in the sense that we need to send out more onions and also have more failed attampts. Consequently we expect to need more time."
]
},
{
Expand Down
4 changes: 2 additions & 2 deletions examples/basicexample.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
from pickhardtpayments.SyncSimulatedPaymentSession import SyncSimulatedPaymentSession


#we first need to import the chanenl graph from c-lightning jsondump
#we first need to import the channel graph from core lightning jsondump
#you can get your own data set via:
# $: lightning-cli listchannels > listchannels20220412.json
# alternatively you can go to https://ln.rene-pickhardt.de to find a data dump
channel_graph = ChannelGraph("listchannels20220412.json")

uncertainty_network = UncertaintyNetwork(channel_graph)
oracle_lightning_network = OracleLightningNetwork(channel_graph)
#we create ourselves a payment session which in this case operates by sending out the onions
#we create a payment session which in this case operates by sending out the onions
#sequentially
payment_session = SyncSimulatedPaymentSession(oracle_lightning_network,
uncertainty_network,
Expand Down
8 changes: 4 additions & 4 deletions pickhardtpayments/Channel.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class ChannelFields:
class ChannelFields():
"""
These are the values describing public data about channels that is either available
via gossip or via the Bitcoin Blockchain. Their format is taken from the c-lighting
via gossip or via the Bitcoin Blockchain. Their format is taken from the core lighting
API. If you use a different implementation I suggest to write a wrapper around the
`ChannelFields` and `Channel` class
"""
Expand All @@ -21,12 +21,12 @@ class ChannelFields:
SHORT_CHANNEL_ID = 'short_channel_id'


class Channel:
class Channel():
"""
Stores the public available information of a channel.
The `Channel` Class is intended to be read only and internally stores
the data from c-lightning's `lightning-cli listchannels` command as a json.
the data from core lightning's `lightning-cli listchannels` command as a json.
If you retrieve data from a different implementation I suggest to overload
the constructor and transform the information into the given json format
"""
Expand Down
2 changes: 1 addition & 1 deletion pickhardtpayments/ChannelGraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def _get_channel_json(self, filename: str):

def __init__(self, lightning_cli_listchannels_json_file: str):
"""
Importing the channel_graph from c-lightning listchannels command the file can be received by
Importing the channel_graph from core lightning listchannels command the file can be received by
#$ lightning-cli listchannels > listchannels.json
"""
Expand Down
6 changes: 3 additions & 3 deletions pickhardtpayments/OracleChannel.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

class OracleChannel(Channel):
"""
An OracleChannel us used in experiments and Simulations to form the (Oracle)LightningNetwork.
An OracleChannel is used in experiments and Simulations to form the (Oracle)LightningNetwork.
It contains a ground truth about the Liquidity of a channel
"""
Expand All @@ -24,8 +24,8 @@ def actual_liquidity(self):
"""
Tells us the actual liquidity according to the oracle.
This is usful for experiments but must of course not be used in routing and is also
not a vailable if mainnet remote channels are being used.
This is useful for experiments but must of course not be used in routing and is also
not available if mainnet remote channels are being used.
"""
return self._actual_liquidity

Expand Down
Loading

0 comments on commit 62296de

Please sign in to comment.