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
33 changes: 17 additions & 16 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/javascript-node
{
"name": "Tutorials",
"image": "mcr.microsoft.com/devcontainers/javascript-node:20",
"features": {
"ghcr.io/devcontainers-contrib/features/jshint:2": {}
},
"name": "Dash Platform Tutorials",
"image": "mcr.microsoft.com/devcontainers/javascript-node:20",
"remoteUser": "node",

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
"onCreateCommand": "cp -n .env.example .env",
"postCreateCommand": "npm ci",
"postAttachCommand": ".devcontainer/welcome.sh",

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "npm install",

// Configure tool-specific properties.
"customizations": {
// Configure properties specific to VS Code.
"vscode": {
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"mikestead.dotenv",
"streetsidesoftware.code-spell-checker"
]
],
"settings": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.tabSize": 2,
"files.eol": "\n",
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true
}
}
}
}
2 changes: 2 additions & 0 deletions .devcontainer/welcome.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
printf '\n=== Dash Platform Tutorials ===\n\nNext steps:\n 1. Verify connection: node connect.mjs\n 2. Create a wallet: node create-wallet.mjs\n 3. Edit .env with your mnemonic (PLATFORM_MNEMONIC)\n 4. Start tutorials in 1-Identities-and-Names/\n\nDocs: https://docs.dash.org/projects/platform/en/stable/docs/tutorials/introduction.html\n\n'
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,20 @@ site](http://docs.dash.org/projects/platform/en/stable/docs/tutorials/introducti
uses `@dashevo/evo-sdk`. For the legacy `js-dash-sdk` tutorials, see
[v2.0.1](https://github.com/dashpay/platform-tutorials/releases/tag/v2.0.1).

## Quick Start with Dev Containers

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/dashpay/platform-tutorials)

The included dev container provides a ready-to-use environment with Node.js, dependencies, and
editor tooling pre-configured. Open the repo in [GitHub
Codespaces](https://codespaces.new/dashpay/platform-tutorials) or locally with the [VS Code Dev
Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers).

On first launch the container installs dependencies and creates a starter `.env` file from
`.env.example`. Run `node create-wallet.mjs` to generate a mnemonic, then set `PLATFORM_MNEMONIC`
in your `.env` file to begin the tutorials.

## Install

Note: [NodeJS](https://nodejs.org/en/download/) (v20+) must be installed to run the tutorial code.
Expand Down