Skip to content

dashpay/platform-tutorials

Repository files navigation

platform-readme-tutorials

SDK Version

Code for the tutorials found on the Platform documentation site. This repo uses @dashevo/evo-sdk. For the legacy js-dash-sdk tutorials, see v2.0.1.

Install

Note: NodeJS (v20+) must be installed to run the tutorial code.

Clone this repository

git clone https://github.com/dashpay/platform-tutorials.git

Install project dependencies

Do a clean install of project dependencies:

npm ci

Usage

  1. Check connection: node connect.mjs
  2. Create a wallet: node create-wallet.mjs
  3. Fund the platform address using the bridge URL printed in the previous step
  4. Create a .env file (see .env.example) and set PLATFORM_MNEMONIC to the mnemonic from step 2. Set NETWORK if needed (defaults to testnet).

Proceed with the Identities and Names tutorials first and the Contracts and Documents tutorials next. They align with the tutorials section on the documentation site.

The identity ID is automatically resolved from your mnemonic, so there is no need to set it manually. After registering a data contract, set DATA_CONTRACT_ID in your .env file to the new contract ID for use in subsequent document tutorials.

Some client configuration options are included as comments in setupDashClient.mjs if more advanced configuration is required.

Testing

Tests run each tutorial as a subprocess and validate its output. No test framework dependencies are required — tests use the Node.js built-in test runner.

Ensure your .env file is configured (see .env.example) before running tests.

# Read-only tests (default) — safe to run, no credits consumed
npm test

# Write tests — registers identities/contracts/documents (consumes testnet credits)
npm run test:read-write

# All tests
npm run test:all

Contributing

PRs accepted.

License

MIT

Contributors