Skip to content
Merged
Show file tree
Hide file tree
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
9 changes: 6 additions & 3 deletions docs/src/web-client/create_deploy_tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,8 @@ export async function createMintConsume(): Promise<void> {
console.log("Creating account for Alice…");
const alice = await client.newWallet(
AccountStorageMode.public(), // Public: account state is visible on-chain
true // Mutable: account code can be upgraded later
true, // Mutable: account code can be upgraded later
0 // Auth Scheme: 0 for RPO Falcon 512, 1 for ECDSA 256 Keccak
);
console.log("Alice ID:", alice.id().toString());
}
Expand All @@ -206,7 +207,8 @@ const faucetAccount = await client.newFaucet(
false, // Immutable: faucet rules cannot be changed
"MID", // Token symbol (like ETH, BTC, etc.)
8, // Decimals (8 means 1 MID = 100,000,000 base units)
BigInt(1_000_000) // Max supply: total tokens that can ever be minted
BigInt(1_000_000), // Max supply: total tokens that can ever be minted
0 // Auth Scheme: 0 for RPO Falcon 512, 1 for ECDSA 256 Keccak
);
console.log("Faucet account ID:", faucetAccount.id().toString());

Expand Down Expand Up @@ -256,7 +258,7 @@ export async function createMintConsume(): Promise<void> {

// 2. Create Alice's account
console.log("Creating account for Alice…");
const alice = await client.newWallet(AccountStorageMode.public(), true);
const alice = await client.newWallet(AccountStorageMode.public(), true, 0);
console.log("Alice ID:", alice.id().toString());

// 3. Deploy a fungible faucet
Expand All @@ -267,6 +269,7 @@ export async function createMintConsume(): Promise<void> {
"MID",
8,
BigInt(1_000_000),
0,
);
console.log("Faucet ID:", faucet.id().toString());

Expand Down
11 changes: 6 additions & 5 deletions web-client/lib/createMintConsume.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,27 @@ export async function createMintConsume(): Promise<void> {
"@demox-labs/miden-sdk"
);

const nodeEndpoint = "https://rpc.testnet.miden.io";
const nodeEndpoint = "https://rpc.testnet.miden.io:443";
const client = await WebClient.createClient(nodeEndpoint);

// 1. Sync and log block
// 1. Sync with the latest blockchain state
const state = await client.syncState();
console.log("Latest block number:", state.blockNum());

// 2. Create Alices account
// 2. Create Alice's account
console.log("Creating account for Alice…");
const alice = await client.newWallet(AccountStorageMode.public(), true);
const alice = await client.newWallet(AccountStorageMode.public(), true, 0);
console.log("Alice ID:", alice.id().toString());

// 3. Deploy faucet
// 3. Deploy a fungible faucet
console.log("Creating faucet…");
const faucet = await client.newFaucet(
AccountStorageMode.public(),
false,
"MID",
8,
BigInt(1_000_000),
0,
);
console.log("Faucet ID:", faucet.id().toString());

Expand Down
Loading