Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,18 @@ const amulet = await sdk.amulet(AMULET_NAMESPACE_CONFIG)

const aliceKeys = sdk.keys.generate()

// Discover the synchronizer where Amulet contracts live by building a tap command
// (this only fetches contracts from the registry/scan, no ledger submission)
const [, probeDisclosed] = await amulet.tap(
'probe::0000000000000000000000000000000000000000000000000000000000000000',
'1'
)
const synchronizerId = probeDisclosed[0]?.synchronizerId

const alice = await sdk.party.external
.create(aliceKeys.publicKey, {
partyHint: 'v1-06-alice',
synchronizerId,
})
.sign(aliceKeys.privateKey)
.execute()
Expand All @@ -36,11 +45,15 @@ const tapPromises = tapIndices.map(async () => {
'2000000'
)

const synchronizerId =
amuletTapDisclosedContracts[0]?.synchronizerId ?? undefined

return sdk.ledger
.prepare({
partyId: alice.partyId,
commands: amuletTapCommand,
disclosedContracts: amuletTapDisclosedContracts,
synchronizerId,
})
.sign(aliceKeys.privateKey)
.execute({ partyId: alice.partyId })
Expand All @@ -59,11 +72,15 @@ const [mergeUtxoCommands, mergedDisclosedContracts] = await token.utxos.merge({
})

const mergePromises = mergeUtxoCommands.map((mergeCommand) => {
const synchronizerId =
mergedDisclosedContracts[0]?.synchronizerId ?? undefined
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is nonsense code


return sdk.ledger
.prepare({
partyId: alice.partyId,
commands: mergeCommand,
disclosedContracts: mergedDisclosedContracts,
synchronizerId,
})
.sign(aliceKeys.privateKey)
.execute({ partyId: alice.partyId })
Expand Down
4 changes: 2 additions & 2 deletions scripts/src/start-localnet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ const composeBase = [
'app-provider',
'--profile',
'app-user',
// '--profile',
// 'multi-sync',
'--profile',
'multi-sync',
]

const network = getNetworkArg()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,9 @@ export class SignedPartyCreation {
} = options
const ledgerProvider = defaultLedgerProvider ?? this.ctx.ledgerProvider
try {
const synchronizerId = this.ctx.defaultSynchronizerId
const synchronizerId =
this.createPartyOptions?.synchronizerId ??
this.ctx.defaultSynchronizerId

await this.allocate(
ledgerProvider,
Expand Down