Skip to content

Commit e211943

Browse files
authored
Merge pull request #139 from 0xMiden/chore/webtutorial-authscheme
chore: update create & deploy web tutorial for v12
2 parents 0658c1a + aacd1aa commit e211943

File tree

5 files changed

+2326
-1251
lines changed

5 files changed

+2326
-1251
lines changed

docs/src/web-client/create_deploy_tutorial.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,8 @@ export async function createMintConsume(): Promise<void> {
183183
console.log("Creating account for Alice…");
184184
const alice = await client.newWallet(
185185
AccountStorageMode.public(), // Public: account state is visible on-chain
186-
true // Mutable: account code can be upgraded later
186+
true, // Mutable: account code can be upgraded later
187+
0 // Auth Scheme: 0 for RPO Falcon 512, 1 for ECDSA 256 Keccak
187188
);
188189
console.log("Alice ID:", alice.id().toString());
189190
}
@@ -206,7 +207,8 @@ const faucetAccount = await client.newFaucet(
206207
false, // Immutable: faucet rules cannot be changed
207208
"MID", // Token symbol (like ETH, BTC, etc.)
208209
8, // Decimals (8 means 1 MID = 100,000,000 base units)
209-
BigInt(1_000_000) // Max supply: total tokens that can ever be minted
210+
BigInt(1_000_000), // Max supply: total tokens that can ever be minted
211+
0 // Auth Scheme: 0 for RPO Falcon 512, 1 for ECDSA 256 Keccak
210212
);
211213
console.log("Faucet account ID:", faucetAccount.id().toString());
212214

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

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

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

web-client/lib/createMintConsume.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@ export async function createMintConsume(): Promise<void> {
1010
"@demox-labs/miden-sdk"
1111
);
1212

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

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

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

25-
// 3. Deploy faucet
25+
// 3. Deploy a fungible faucet
2626
console.log("Creating faucet…");
2727
const faucet = await client.newFaucet(
2828
AccountStorageMode.public(),

0 commit comments

Comments
 (0)