<p>I don't know if that possibility ever existed as an api call 8n lnd. but you can certainly call the <code>describegraph</code> api call to get all nodes and channels that are publically known. This json blob can easily be imported with a few lines of code as a graph in any graph library such as <code>neo4j</code>  or <code>networkx</code> once the network is there you can run any pathfinding algorithm from any source to any destination. Note that due to routing fees the shortest paths should be searched from destination to sender as the feerate is dynamic and depends on the fees that will have to be paid by future nodes and not only on the payment amount</p>

CC BY-SA 4.0
2019-10-02T20:41:24.617Z
Thank you for the answer! The reason I seeked for the api call is because the path finding algorithms the clients use (lnd, eclair, c-lightning) are much more complicated than the default algorithms of packages like networkx use. If you are aware of any python implementation that calculates the shortest paths the way lnd does, please let me know 
George
CC BY-SA 4.0
2019-10-02T20:25:25.070Z
2019-10-02T20:25:25.070Z
Rene Pickhardt
<p>I'm interested in finding paths from senders whose node you don't run to potential receivers. According to <a href="https://api.lightning.community/?python#queryroutes" rel="nofollow noreferrer">https://api.lightning.community/?python#queryroutes</a> , you can do that by specifying the parameter <code>source_pub_key</code> to be any public key you wish and not just yours. In reality, this does not work as the <code>querryroutes</code> command does not support any other parameters than:</p>

<p>OPTIONS:</p>

<p><strong>dest value:</strong> the 33-byte hex-encoded public key for the payment destination</p>

<p><strong>amt value</strong>: the amount to send expressed in satoshis </p>

<p><strong>fee_limit value:</strong> maximum fee allowed in satoshis when sending the payment </p>

<p><strong>fee_limit_percent value:</strong> percentage of the payment’s amount used as the maximum fee allowed when sending the payment </p>

<p><strong>final_cltv_delta value:</strong> number of blocks the last hop has to reveal the preimage </p>

<p><strong>use_mc:</strong> use mission control probabilities</p>

<p>Does anyone know if there used to be a possibility of adding <code>source_pub_key</code> and it was removed or it never existed in the first place? More importantly, is there a way to construct paths from a source to a destination, when you don't actually run the node of the source and you don't care about actually forwarding payments and packets but rather just constructing paths according to the shortest paths algorithm of <code>lnd</code>.</p>

<lightning-network><lightning-network-daemon><lightning-routing>
Finding paths NOT originating from you with lnd
George
# Finding paths NOT originating from you with lnd

(Asked by: username_0 on 2019-10-02)

I'm interested in finding paths from senders whose node you don't run to potential receivers. According to <https://api.lightning.community/?python#queryroutes> , you can do that by specifying the parameter `source_pub_key` to be any public key you wish and not just yours. In reality, this does not work as the `querryroutes` command does not support any other parameters than:

OPTIONS:

**dest value:** the 33-byte hex-encoded public key for the payment destination

**amt value**: the amount to send expressed in satoshis

**fee\_limit value:** maximum fee allowed in satoshis when sending the payment

**fee\_limit\_percent value:** percentage of the payment’s amount used as the maximum fee allowed when sending the payment

**final\_cltv\_delta value:** number of blocks the last hop has to reveal the preimage

**use\_mc:** use mission control probabilities

Does anyone know if there used to be a possibility of adding `source_pub_key` and it was removed or it never existed in the first place? More importantly, is there a way to construct paths from a source to a destination, when you don't actually run the node of the source and you don't care about actually forwarding payments and packets but rather just constructing paths according to the shortest paths algorithm of `lnd`.

**Tags:** lightning-network, lightning-network-daemon, lightning-routing


---

## 1 answers

### Answer by username_1 on 2019-10-02. Score: 0

I don't know if that possibility ever existed as an api call 8n lnd. but you can certainly call the `describegraph` api call to get all nodes and channels that are publically known. This json blob can easily be imported with a few lines of code as a graph in any graph library such as `neo4j` or `networkx` once the network is there you can run any pathfinding algorithm from any source to any destination. Note that due to routing fees the shortest paths should be searched from destination to sender as the feerate is dynamic and depends on the fees that will have to be paid by future nodes and not only on the payment amount

> **Comments:**
> **username_0**: Thank you for the answer! The reason I seeked for the api call is because the path finding algorithms the clients use (lnd, eclair, c-lightning) are much more complicated than the default algorithms of packages like networkx use. If you are aware of any python implementation that calculates the shortest paths the way lnd does, please let me know   

---

