Skip to content

Commit e7f7364

Browse files
committed
chore: document Dash Bridge fast setup path in README and CLAUDE.md
Also run fmt
1 parent 5e65f19 commit e7f7364

3 files changed

Lines changed: 57 additions & 7 deletions

File tree

CLAUDE.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
66

77
Tutorial code for [Dash Platform](https://docs.dash.org/platform) demonstrating how to interact with the Dash network using `@dashevo/evo-sdk`. Covers identities, DPNS names, data contracts, and documents.
88

9+
### Getting started
10+
11+
Users need a funded identity before running write tutorials. Two paths:
12+
13+
1. **Standard**`node create-wallet.mjs` (generates mnemonic + faucet URL) → fund via the printed URL → `node 1-Identities-and-Names/identity-register.mjs`
14+
2. **Fast** — Use [Dash Bridge](https://bridge.thepasta.org/) to create a wallet and register an identity in one step, then set `PLATFORM_MNEMONIC` in `.env`
15+
16+
Run `node view-wallet.mjs` to confirm the identity is found before proceeding.
17+
918
## Commands
1019

1120
```bash

README.md

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,40 @@ Do a clean install of project dependencies:
4141
npm ci
4242
```
4343

44+
### Configure environment
45+
46+
Copy [`.env.example`](./.env.example) to `.env`. Set `NETWORK` if needed (defaults to `testnet`).
47+
You will set `PLATFORM_MNEMONIC` when configuring a wallet in the Usage section.
48+
49+
```shell
50+
cp .env.example .env
51+
```
52+
4453
## Usage
4554

55+
### Standard setup (recommended)
56+
57+
Follow these steps to go through the full Platform flow (wallet → funding → identity):
58+
4659
1. Check connection: `node connect.mjs`
4760
1. Create a wallet: `node create-wallet.mjs`
4861
1. Fund the platform address using the bridge URL printed in the previous step
49-
1. Create a `.env` file (see [`.env.example`](./.env.example)) and set `PLATFORM_MNEMONIC` to the
50-
mnemonic from step 2. Set `NETWORK` if needed (defaults to `testnet`).
51-
1. To inspect an existing wallet after configuring `PLATFORM_MNEMONIC`, run `node view-wallet.mjs`
62+
1. Set `PLATFORM_MNEMONIC` in `.env` to the mnemonic from step 2
63+
1. To inspect the wallet after configuring `PLATFORM_MNEMONIC`, run `node view-wallet.mjs`
64+
1. Proceed with [Next Steps](#next-steps)
65+
66+
### Fast setup (optional)
67+
68+
If you want to start interacting with Platform as quickly as possible, you can use [Dash
69+
Bridge](https://bridge.thepasta.org/) to create a wallet and register an identity in one step.
70+
71+
Then, just set `PLATFORM_MNEMONIC` in `.env`, run `node view-wallet.mjs` to confirm the wallet
72+
and identity are found, and proceed with [Next Steps](#next-steps).
73+
74+
> This is useful for quick experimentation, but the standard setup above is recommended to
75+
> understand the full flow.
76+
77+
### Next steps
5278

5379
Proceed with the [Identities and Names tutorials](./1-Identities-and-Names/) first and the
5480
[Contracts and Documents tutorials](./2-Contracts-and-Documents/) next. They align with the
@@ -87,6 +113,9 @@ If you already have a Dash identity created with another tool (e.g. [Dash
87113
Bridge](https://bridge.thepasta.org/)), you can use it directly by setting `PLATFORM_MNEMONIC` to
88114
your existing mnemonic. Run `node view-wallet.mjs` to confirm the derived address and identity ID.
89115

116+
> **Note:** [Dash Bridge](https://bridge.thepasta.org/) can handle wallet creation and identity
117+
> registration in one step.
118+
90119
For compatibility, the external tool must use the same derivation paths (no BIP39 passphrase):
91120

92121
| Key type | Testnet | Mainnet |

view-wallet.mjs

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,34 @@ if (!mnemonic) {
1414

1515
try {
1616
const sdk = await createClient(network);
17-
const addressKeyManager = await AddressKeyManager.create({ sdk, mnemonic, network });
17+
const addressKeyManager = await AddressKeyManager.create({
18+
sdk,
19+
mnemonic,
20+
network,
21+
});
1822
const { bech32m, path } = addressKeyManager.primaryAddress;
1923

2024
let identityId = 'No identity found for this mnemonic';
2125
try {
22-
const keyManager = await IdentityKeyManager.create({ sdk, mnemonic, network });
26+
const keyManager = await IdentityKeyManager.create({
27+
sdk,
28+
mnemonic,
29+
network,
30+
});
2331
identityId = keyManager.identityId;
2432
} catch (e) {
25-
if (!e.message?.includes('No identity found for the given mnemonic')) throw e;
33+
if (!e.message?.includes('No identity found for the given mnemonic'))
34+
throw e;
2635
}
2736

2837
// ⚠️ Never log mnemonics in real applications
2938
console.log('Network: ', network);
3039
console.log('Mnemonic: ', mnemonic);
3140
console.log(`First address: ${bech32m} (${path})`);
32-
console.log('Fund address: ', `https://bridge.thepasta.org/?address=${bech32m}`);
41+
console.log(
42+
'Fund address: ',
43+
`https://bridge.thepasta.org/?address=${bech32m}`,
44+
);
3345
console.log('Identity ID: ', identityId);
3446
} catch (e) {
3547
console.error('Something went wrong:\n', e.message);

0 commit comments

Comments
 (0)