Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
boufni95 committed Apr 24, 2024
1 parent bc9fb61 commit d2e2744
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions src/tests/networkSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,24 @@ export const setupNetwork = async () => {
const core = new Core(settings)
await core.Init()
const { alice, bob, carol, dave } = await initLndInstances(settings)
/*const aliceAddr = await alice.NewAddress(AddressType.WITNESS_PUBKEY_HASH, true)

const aliceInfo = await alice.GetInfo()
const [alicePub, aliceHost] = aliceInfo.uris[0].split('@')
await carol.ConnectPeer(alicePub, aliceHost)
await dave.ConnectPeer(alicePub, aliceHost)
const carolInfo = await carol.GetInfo()
const [carolPub, carolHost] = carolInfo.uris[0].split('@')
await bob.ConnectPeer(carolPub, carolHost)
console.log("done connecting peer, sending coins")
const aliceAddr = await alice.NewAddress(AddressType.WITNESS_PUBKEY_HASH, true)
const bobAddr = await bob.NewAddress(AddressType.WITNESS_PUBKEY_HASH)
const carolAddr = await carol.NewAddress(AddressType.WITNESS_PUBKEY_HASH)
const daveAddr = await dave.NewAddress(AddressType.WITNESS_PUBKEY_HASH)
await core.SendToAddress(aliceAddr.address, 10)
await core.SendToAddress(bobAddr.address, 10)
await core.SendToAddress(carolAddr.address, 10)
await core.SendToAddress(daveAddr.address, 10)
await core.Mine(6)*/
const alicePub = await alice.GetInfo()
const [pubkey, host] = alicePub.uris[0].split('@')
await carol.ConnectPeer(pubkey, host)
console.log(await alice.GetInfo())
console.log(await carol.GetInfo())
console.log(await alice.GetInfo())
const aliceAddr = await alice.NewAddress(AddressType.WITNESS_PUBKEY_HASH, true)
console.log({ aliceAddr })
await core.Mine(6)
}

const initLndInstances = async (settings: TestSettings) => {
Expand Down

0 comments on commit d2e2744

Please sign in to comment.