Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
boufni95 committed Apr 25, 2024
1 parent afe7f07 commit dfcdb1b
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/tests/networkSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,18 @@ export const setupNetwork = async () => {
const core = new BitcoinCoreWrapper(settings)
await core.InitAddress()
await core.Mine(1)
const lnd = new LND(settings.lndSettings, () => { }, () => { }, () => { }, () => { })
const alice = new LND(settings.lndSettings, () => { }, () => { }, () => { }, () => { })
const bob = new LND({ ...settings.lndSettings, mainNode: settings.lndSettings.otherNode }, () => { }, () => { }, () => { }, () => { })
await tryUntil<void>(async i => {
await lnd.ConnectPeer({ pubkey: '03cc09d839293195eb10af7df99e5ba5bbac12c2526ec67d174dcbc84d9c97bae4', host: "bob:9735" })
await lnd.ConnectPeer({ pubkey: '0232842d81b2423df97aa8a264f8c0811610a736af65afe2e145279f285625c1e4', host: "carol:9735" })
await lnd.ConnectPeer({ pubkey: '027c50fde118af534ff27e59da722422d2f3e06505c31e94c1b40c112c48a83b1c', host: "dave:9735" })
await alice.ConnectPeer({ pubkey: '0232842d81b2423df97aa8a264f8c0811610a736af65afe2e145279f285625c1e4', host: "carol:9735" })
await alice.ConnectPeer({ pubkey: '027c50fde118af534ff27e59da722422d2f3e06505c31e94c1b40c112c48a83b1c', host: "dave:9735" })
}, 15, 2000)
await tryUntil<void>(async i => {
await bob.ConnectPeer({ pubkey: '0232842d81b2423df97aa8a264f8c0811610a736af65afe2e145279f285625c1e4', host: "carol:9735" })
}, 15, 2000)

await tryUntil<void>(async i => {
const info = await lnd.GetInfo()
const info = await alice.GetInfo()
if (!info.syncedToChain) {
throw new Error("not synced to chain")
}
Expand Down

0 comments on commit dfcdb1b

Please sign in to comment.