Skip to content
Merged
Changes from all commits
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
24 changes: 24 additions & 0 deletions yarn-project/cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,30 @@ export function getProgram(log: LogFn, debugLogger: DebugLogger): Command {
log(`Partial address: ${partialAddress.toString()}`);
});

program
.command('register-account')
.description(
'Registers an aztec account that can be used for sending transactions. Registers the account on the PXE. Uses a Schnorr single-key account which uses the same key for encryption and authentication (not secure for production usage).',
)
.summary('Registers an aztec account that can be used for sending transactions.')
.addOption(createPrivateKeyOption('Private key for note encryption and transaction signing.', true))
.requiredOption(
'-pa, --partial-address <partialAddress>',
'The partially computed address of the account contract.',
parsePartialAddress,
)
.addOption(pxeOption)
.action(async ({ rpcUrl, privateKey, partialAddress }) => {
const client = await createCompatibleClient(rpcUrl, debugLogger);

const { address, publicKey } = await client.registerAccount(privateKey, partialAddress);

log(`\nRegistered account:\n`);
log(`Address: ${address.toString()}`);
log(`Public key: ${publicKey.toString()}`);
log(`Partial address: ${partialAddress.toString()}`);
});

program
.command('deploy')
.description('Deploys a compiled Aztec.nr contract to Aztec.')
Expand Down