You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
final byte[] genesisBlockHash = genesisBlock.block_hash();
1022
+
1023
+
final byte[] serializedNetworkGraph = // Read network graph bytes from file
1024
+
final NetworkGraph networkGraph = NetworkGraph.read(serializedNetworkGraph, logger);
1025
+
final P2PGossipSync p2pGossip = P2PGossipSync.of(networkGraph, Option_AccessZ.none(), logger)
1026
+
```
1027
+
1028
+
</template>
1029
+
1030
+
<template v-slot:kotlin>
1031
+
1032
+
```kotlin
1033
+
val genesisBlock : BestBlock = BestBlock.from_genesis(Network.LDKNetwork_Testnet)
1034
+
val genesisBlockHash : String = byteArrayToHex(genesisBlock.block_hash())
1035
+
1036
+
val serializedNetworkGraph = // Read network graph bytes from file
1037
+
val networkGraph : NetworkGraph = NetworkGraph.read(serializedNetworkGraph, logger)
1038
+
val p2pGossip : P2PGossipSync = P2PGossipSync.of(networkGraph, Option_AccessZ.none(), logger)
1039
+
```
1040
+
1041
+
</template>
1042
+
1043
+
1044
+
</CodeSwitcher>
1045
+
1046
+
1047
+
**Implementation notes:** this struct is not required if you are providing your own routes. It will be used internally in `ChannelManager` to build a `NetworkGraph`. Other networking options are: `LDKNetwork_Bitcoin`, `LDKNetwork_Regtest` and `LDKNetwork_Testnet`
1048
+
1049
+
**Dependencies:** `Logger`
1050
+
1051
+
**Optional dependency:** `Access`, a source of chain information. Recommended to be able to verify channels before adding them to the internal network graph.
0 commit comments