======================== CODE SNIPPETS ======================== TITLE: Install Dependencies and Start DApp (Bash) DESCRIPTION: Installs project dependencies using npm and then starts the development server for the dApp. This command is run from the 'frontend' directory. SOURCE: https://github.com/nervosnetwork/docs.nervos.org/blob/develop/website/docs/getting-started/quick-start.mdx#_snippet_10 LANGUAGE: bash CODE: ``` npm i && npm run dev ``` ---------------------------------------- TITLE: Starting Local CKB Devnet with offckb (Shell) DESCRIPTION: Execute this command using the installed offckb tool to start a local CKB development network, which provides a blockchain environment for testing dApp examples. SOURCE: https://github.com/nervosnetwork/docs.nervos.org/blob/develop/examples/README.md#_snippet_2 LANGUAGE: Shell CODE: ``` offckb node ``` ---------------------------------------- TITLE: Clone and Start Dapp Example (Generic) DESCRIPTION: Clones the repository containing the example, navigates to the specific example directory, installs project dependencies using yarn, and starts the application. SOURCE: https://github.com/nervosnetwork/docs.nervos.org/blob/develop/examples/store-data-on-cell/README.md#_snippet_0 LANGUAGE: sh CODE: ``` git clone https://github.com/nervosnetwork/docs.nervos.org.git cd docs.nervos.org/examples/store-data-on-cell yarn && yarn start ``` ---------------------------------------- TITLE: Run CKB Example Application (Bash) DESCRIPTION: This command installs project dependencies using `yarn`, sets the `NETWORK` environment variable to `devnet`, and then starts the application using `yarn start`. This is typically used to run the example against a local development network. SOURCE: https://github.com/nervosnetwork/docs.nervos.org/blob/develop/website/docs/dapp/_SetupProjectContent.mdx#_snippet_0 LANGUAGE: bash CODE: ``` yarn && NETWORK=devnet yarn start ``` ---------------------------------------- TITLE: Setup CKB Duktape Template (Shell) DESCRIPTION: Commands to clone the CKB Duktape template repository, navigate into the project directory, install necessary npm dependencies, and build the initial project to ensure the setup is working correctly. SOURCE: https://github.com/nervosnetwork/docs.nervos.org/blob/develop/website/blog/intro-to-script-7.md#_snippet_0 LANGUAGE: Shell CODE: ``` export TOP=$(pwd) git clone https://github.com/xxuejie/ckb-duktape-template htlc-template cd htlc-template npm install npm run build ``` ---------------------------------------- TITLE: Example Application Start Output (Bash) DESCRIPTION: This snippet shows the expected output when the example application is successfully started. It indicates that the `parcel` bundler is running, the server is available at `http://localhost:1234`, and the build process completed quickly. SOURCE: https://github.com/nervosnetwork/docs.nervos.org/blob/develop/website/docs/dapp/_SetupProjectContent.mdx#_snippet_1 LANGUAGE: bash CODE: ``` $ parcel index.html\nServer running at http://localhost:1234\n✨ Built in 66ms ``` ---------------------------------------- TITLE: Setup and Run Omnilock-Solana Example (Bash) DESCRIPTION: Commands to build the Lumos project, navigate to the Omnilock-Solana example directory, and start the example application. SOURCE: https://github.com/nervosnetwork/docs.nervos.org/blob/develop/website/docs/common-scripts/omnilock.mdx#_snippet_5 LANGUAGE: bash CODE: ``` npm run build cd examples/omni-lock-solana npm start ``` ---------------------------------------- TITLE: Installing offckb Globally (Shell) DESCRIPTION: Use npm to install the offckb command-line tool globally. This tool is required to start a local CKB development network. SOURCE: https://github.com/nervosnetwork/docs.nervos.org/blob/develop/examples/README.md#_snippet_1 LANGUAGE: Shell CODE: ``` npm install -g offckb ``` ---------------------------------------- TITLE: Install OffCKB CLI - Bash DESCRIPTION: Installs the OffCKB command-line interface globally using npm. OffCKB sets up a local CKB Devnet for testing dApps. SOURCE: https://github.com/nervosnetwork/docs.nervos.org/blob/develop/website/docs/getting-started/installation.mdx#_snippet_0 LANGUAGE: bash CODE: ``` npm install -g @offckb/cli ``` ---------------------------------------- TITLE: Navigate to Frontend Directory (Bash) DESCRIPTION: Changes the current directory to the 'frontend' workspace, which is necessary before installing dependencies and starting the dApp. SOURCE: https://github.com/nervosnetwork/docs.nervos.org/blob/develop/website/docs/getting-started/quick-start.mdx#_snippet_9 LANGUAGE: bash CODE: ``` cd frontend ``` ---------------------------------------- TITLE: Install Cargo-generate (≥0.17.0) DESCRIPTION: Install Cargo-generate, a tool to create new Rust projects from templates, simplifying project setup. Version ≥0.17.0 is recommended. SOURCE: https://github.com/nervosnetwork/docs.nervos.org/blob/develop/website/docs/getting-started/installation.mdx#_snippet_16 LANGUAGE: bash CODE: ``` cargo install cargo-generate ``` ---------------------------------------- TITLE: Install Git (≥2.40.0) DESCRIPTION: Install Git, a version control system for tracking code changes. Version ≥2.40.0 is recommended. SOURCE: https://github.com/nervosnetwork/docs.nervos.org/blob/develop/website/docs/getting-started/installation.mdx#_snippet_21 LANGUAGE: bash CODE: ``` /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" brew install git ``` LANGUAGE: bash CODE: ``` sudo apt install git ``` ---------------------------------------- TITLE: Clone Repository and Start Dapp DESCRIPTION: Clones the example repository from GitHub, navigates into the simple-transfer directory, installs project dependencies using yarn, and starts the Dapp. SOURCE: https://github.com/nervosnetwork/docs.nervos.org/blob/develop/examples/simple-transfer/README.md#_snippet_0 LANGUAGE: Shell CODE: ``` git clone https://github.com/nervosnetwork/docs.nervos.org.git cd docs.nervos.org/examples/simple-transfer yarn && yarn start ``` ---------------------------------------- TITLE: Installing OffCKB CLI (Bash) DESCRIPTION: Installs the offCKB command-line interface globally using npm. This tool is essential for quickly setting up a local CKB development environment and using pre-built boilerplates. SOURCE: https://github.com/nervosnetwork/docs.nervos.org/blob/develop/website/docs/getting-started/quick-start.mdx#_snippet_0 LANGUAGE: bash CODE: ``` npm install -g @offckb/cli ``` ---------------------------------------- TITLE: Clone Repository and Start App DESCRIPTION: Clones the example repository from GitHub, navigates into the Dapp directory, installs project dependencies using yarn, and then starts the application. SOURCE: https://github.com/nervosnetwork/docs.nervos.org/blob/develop/examples/create-dob/README.md#_snippet_0 LANGUAGE: Shell CODE: ``` git clone https://github.com/nervosnetwork/docs.nervos.org.git cd docs.nervos.org/examples/create-dob yarn && yarn start ``` ---------------------------------------- TITLE: Start CKB Devnet with offckb DESCRIPTION: Uses the globally installed `offckb` tool to start a local CKB development network node. SOURCE: https://github.com/nervosnetwork/docs.nervos.org/blob/develop/examples/xudt/README.md#_snippet_3 LANGUAGE: Shell CODE: ``` offckb node ``` ---------------------------------------- TITLE: Start Frontend Development Server DESCRIPTION: Navigate into the frontend directory of your project, install dependencies, and start the local development server to run the frontend application. SOURCE: https://github.com/nervosnetwork/docs.nervos.org/blob/develop/website/docs/sdk-and-devtool/offckb.mdx#_snippet_15 LANGUAGE: bash CODE: ``` cd frontend && npm i & npm run dev ``` ---------------------------------------- TITLE: Setting up CKB Duktape Template - Shell DESCRIPTION: Provides the necessary shell commands to clone the CKB Duktape template repository from GitHub, navigate into the created directory, install project dependencies using npm, and build the project to ensure the setup is correct and functional. SOURCE: https://github.com/nervosnetwork/docs.nervos.org/blob/develop/website/docs/script-course/intro-to-script-7.md#_snippet_0 LANGUAGE: Shell CODE: ``` export TOP=$(pwd) git clone https://github.com/xxuejie/ckb-duktape-template htlc-template cd htlc-template npm install # now you can try building the script first to ensure everything works npm run build ``` ---------------------------------------- TITLE: Starting CKB Miner (Shell) DESCRIPTION: This simple shell script demonstrates how to navigate to the project directory and start a CKB miner instance using the previously initialized data directory. SOURCE: https://github.com/nervosnetwork/docs.nervos.org/blob/develop/website/blog/intro-to-script-7.md#_snippet_28 LANGUAGE: Shell CODE: ``` $ cd $TOP $ $CKB miner -C ckb-data ``` ---------------------------------------- TITLE: Install Make, Sed, Bash, Coreutils - MacOS - Bash DESCRIPTION: Installs essential development tools (make, sed, bash, coreutils) on MacOS using Homebrew. These are needed for script development. SOURCE: https://github.com/nervosnetwork/docs.nervos.org/blob/develop/website/docs/getting-started/installation.mdx#_snippet_6 LANGUAGE: bash CODE: ``` brew install make gnu-sed bash coreutils ``` ---------------------------------------- TITLE: Install Make, Sed, Bash, Coreutils - Linux - Bash DESCRIPTION: Installs essential development tools (make, sed, bash, coreutils) on Debian/Ubuntu, Fedora, or ArchLinux using their respective package managers. These are needed for script development. SOURCE: https://github.com/nervosnetwork/docs.nervos.org/blob/develop/website/docs/getting-started/installation.mdx#_snippet_7 LANGUAGE: bash CODE: ``` sudo apt install make sed bash coreutils # Debian/Ubuntu sudo dnf install make sed bash coreutils # Fedora sudo pacman -S make sed bash coreutils # ArchLinux ``` ---------------------------------------- TITLE: Install offckb CLI Tool DESCRIPTION: Installs the `offckb` command-line interface tool globally using npm, which is used for managing CKB devnets. SOURCE: https://github.com/nervosnetwork/docs.nervos.org/blob/develop/examples/xudt/README.md#_snippet_2 LANGUAGE: Shell CODE: ``` npm install -g offckb ``` ---------------------------------------- TITLE: Creating a New dApp Project with OffCKB (Bash) DESCRIPTION: Initializes a new full-stack dApp project using the offCKB CLI. Replace with the desired project name. The command will prompt you to select a frontend framework. SOURCE: https://github.com/nervosnetwork/docs.nervos.org/blob/develop/website/docs/getting-started/quick-start.mdx#_snippet_1 LANGUAGE: bash CODE: ``` offckb create ``` ---------------------------------------- TITLE: OffCKB Project Creation Prompt Output (Bash) DESCRIPTION: Shows the interactive prompt output when running `offckb create`, illustrating how to select a bare template using arrow keys from the available options. SOURCE: https://github.com/nervosnetwork/docs.nervos.org/blob/develop/website/docs/getting-started/quick-start.mdx#_snippet_2 LANGUAGE: bash CODE: ``` ? Select a bare template Remix-Vite Bare Templates > Next.js Bare Templates --- A full-stack template with Next.js framework and ckb-script-templates, [next.js,tailwindcss,ckb-script-templates,typescript,rust] ``` ---------------------------------------- TITLE: OffCKB Project Creation Success Output (Bash) DESCRIPTION: Displays the console output indicating successful cloning and setup of the project template after selecting a framework during the `offckb create` process. SOURCE: https://github.com/nervosnetwork/docs.nervos.org/blob/develop/website/docs/getting-started/quick-start.mdx#_snippet_3 LANGUAGE: bash CODE: ``` Cloning into '/Users/Desktop/offckb/templates/temp-clone-folder'... Folder examples/next-js-template downloaded successfully from https://github.com/nervosnetwork/docs.nervos.org and moved to /Users/nervosDocs/Desktop/offckb/my-dapp-project ``` ---------------------------------------- TITLE: OffCKB Devnet Startup Output (Bash) DESCRIPTION: Shows the console output when starting the CKB Devnet with `offckb node`. It includes messages about downloading CKB if necessary, initializing the configuration, and the CKB node's initial output. SOURCE: https://github.com/nervosnetwork/docs.nervos.org/blob/develop/website/docs/getting-started/quick-start.mdx#_snippet_6 LANGUAGE: bash CODE: ``` /bin/sh: /Users/nervosDocs/.nvm/versions/node/v18.12.1/lib/node_modules/@offckb/cli/target/ckb/ckb: No such file or directory /Users/nervosDocs/.nvm/versions/node/v18.12.1/lib/node_modules/@offckb/cli/target/ckb/ckb not found, download and install the new version 0.113.1.. CKB installed successfully. init Devnet config folder: /Users/nervosDocs/.nvm/versions/node/v18.12.1/lib/node_modules/@offckb/cli/target/devnet modified /Users/nervosDocs/.nvm/versions/node/v18.12.1/lib/node_modules/@offckb/cli/target/devnet/ckb-miner.toml CKB output: 2024-03-20 07:56:44.765 +00:00 main INFO sentry sentry is disabled CKB output: 2024-03-20 07:56:44.766 +00:00 main INFO ckb_bin::helper raise_fd_limit newly-increased limit: 61440 CKB output: 2024-03-20 07:56:44.854 +00:00 main INFO ckb_bin::subcommand::run ckb version: 0.113.1 (95ad24b 2024-01-31) CKB output: 2024-03-20 07:56:45.320 +00:00 main INFO ckb_db_migration Init database version 20230206163640 CKB output: 2024-03-20 07:56:45.329 +00:00 main INFO ckb_launcher Touch chain spec hash: Byte32(0x3036c73473a371f3aa61c588c38924a93fb8513e481fa7c8d884fc4cf5fd368a) ``` ---------------------------------------- TITLE: Creating a Script-Only Project with OffCKB (Bash) DESCRIPTION: Initializes a project focused solely on CKB Script development without a frontend using the `offckb` CLI with the `--script` flag. Replace with the desired project name. SOURCE: https://github.com/nervosnetwork/docs.nervos.org/blob/develop/website/docs/getting-started/quick-start.mdx#_snippet_4 LANGUAGE: bash CODE: ``` offckb create --script ``` ---------------------------------------- TITLE: Run Dapp Example on CKB Devnet DESCRIPTION: Sets the NETWORK environment variable to 'devnet', changes the directory to the example folder, installs dependencies (if needed), and starts the application configured to connect to the local CKB devnet. SOURCE: https://github.com/nervosnetwork/docs.nervos.org/blob/develop/examples/store-data-on-cell/README.md#_snippet_4 LANGUAGE: sh CODE: ``` export NETWORK=devnet cd write-and-read-message yarn && yarn start ``` ---------------------------------------- TITLE: CRA App Initialization Response DESCRIPTION: Displays the output from the `create-react-app` command, indicating the successful creation of the React application directory, the installation of packages (react, react-dom, react-scripts), and the total time taken. SOURCE: https://github.com/nervosnetwork/docs.nervos.org/blob/develop/website/docs/getting-started/quick-start.mdx#_snippet_15 LANGUAGE: bash CODE: ``` Creating a new React app in /Users/nervosDocs/Desktop/offckb/my-cra-dapp. Installing packages. This might take a couple of minutes. Installing react, react-dom, and react-scripts with cra-template-typescript... added 1489 packages in 2m ``` ---------------------------------------- TITLE: Install offckb CLI Tool DESCRIPTION: Installs the 'offckb' command-line interface tool globally using npm. This tool is required to start and manage a local CKB development network (devnet). SOURCE: https://github.com/nervosnetwork/docs.nervos.org/blob/develop/examples/store-data-on-cell/README.md#_snippet_2 LANGUAGE: sh CODE: ``` npm install -g offckb ``` ---------------------------------------- TITLE: Start CKB Devnet using offckb DESCRIPTION: Starts a local CKB development network node using the installed 'offckb' CLI tool. This command initiates a local blockchain environment for testing the Dapp. SOURCE: https://github.com/nervosnetwork/docs.nervos.org/blob/develop/examples/store-data-on-cell/README.md#_snippet_3 LANGUAGE: sh CODE: ``` offckb node ``` ---------------------------------------- TITLE: Deploy Scripts to Testnet (Shell) DESCRIPTION: Deploys the built CKB scripts to the Testnet using the `offckb` command-line tool. This command is executed from the frontend workspace. SOURCE: https://github.com/nervosnetwork/docs.nervos.org/blob/develop/website/docs/getting-started/quick-start.mdx#_snippet_12 LANGUAGE: sh CODE: ``` offckb deploy --network testnet ``` ---------------------------------------- TITLE: Starting the Local CKB Devnet with OffCKB (Bash) DESCRIPTION: Starts a local CKB development network (Devnet) using the offCKB CLI. This command makes the Devnet RPC endpoint available at `localhost:8114` for development and testing. SOURCE: https://github.com/nervosnetwork/docs.nervos.org/blob/develop/website/docs/getting-started/quick-start.mdx#_snippet_5 LANGUAGE: bash CODE: ``` offckb node ``` ---------------------------------------- TITLE: Navigate to App Directory and Inject offckb Config DESCRIPTION: Changes the current directory to the newly created React application folder ('my-cra-dapp') and then runs the `offckb inject-config` command to integrate the offCKB configuration files and settings into the project structure. SOURCE: https://github.com/nervosnetwork/docs.nervos.org/blob/develop/website/docs/getting-started/quick-start.mdx#_snippet_16 LANGUAGE: bash CODE: ``` cd my-cra-dapp offckb inject-config ``` ---------------------------------------- TITLE: Install Yarn (≥1.22.0) DESCRIPTION: Install Yarn, a package manager for JavaScript projects. Version ≥1.22.0 is recommended. This command uses npm for installation. SOURCE: https://github.com/nervosnetwork/docs.nervos.org/blob/develop/website/docs/getting-started/installation.mdx#_snippet_20 LANGUAGE: bash CODE: ``` npm install --global yarn ``` ---------------------------------------- TITLE: Install Scoop - Windows - Bash DESCRIPTION: Configures execution policy and installs the Scoop package manager on Windows using PowerShell. Scoop is a prerequisite for installing Rust. SOURCE: https://github.com/nervosnetwork/docs.nervos.org/blob/develop/website/docs/getting-started/installation.mdx#_snippet_12 LANGUAGE: bash CODE: ``` Set-ExecutionPolicy RemoteSigned -Scope CurrentUser iwr -useb get.scoop.sh | iex ``` ---------------------------------------- TITLE: Setup CKB Script Debugger Environment (Shell) DESCRIPTION: Sets up the project directory and installs necessary Node.js packages for the CKB script debugging environment, including CKB SDK, Molecule, and CRC32. SOURCE: https://github.com/nervosnetwork/docs.nervos.org/blob/develop/website/blog/intro-to-script-7.md#_snippet_2 LANGUAGE: shell CODE: ``` $ cd $TOP $ mkdir htlc-runner $ cd htlc-runner $ npm init $ npm install --save @nervosnetwork/ckb-sdk-core $ npm install --save @nervosnetwork/ckb-sdk-utils $ npm install --save molecule-javascript $ npm install --save crc32 ``` ---------------------------------------- TITLE: Deploy Scripts to Devnet (Shell) DESCRIPTION: Deploys the built CKB scripts to the Devnet using the `offckb` command-line tool. This command is executed from the frontend workspace. SOURCE: https://github.com/nervosnetwork/docs.nervos.org/blob/develop/website/docs/getting-started/quick-start.mdx#_snippet_11 LANGUAGE: sh CODE: ``` offckb deploy --network devnet ``` ---------------------------------------- TITLE: Install CKB-Debugger (≥0.113.0) DESCRIPTION: Install CKB-Debugger, a CLI tool for off-chain CKB Script development and testing. Version ≥0.113.0 is recommended. SOURCE: https://github.com/nervosnetwork/docs.nervos.org/blob/develop/website/docs/getting-started/installation.mdx#_snippet_17 LANGUAGE: bash CODE: ``` cargo install --git https://github.com/nervosnetwork/ckb-standalone-debugger ckb-debugger ``` ---------------------------------------- TITLE: Install Homebrew - MacOS - Bash DESCRIPTION: Installs the Homebrew package manager on MacOS using a curl script. This is a prerequisite for installing other tools like Make, Sed, Bash, Coreutils, and Rust. SOURCE: https://github.com/nervosnetwork/docs.nervos.org/blob/develop/website/docs/getting-started/installation.mdx#_snippet_5 LANGUAGE: bash CODE: ``` /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" ``` ---------------------------------------- TITLE: Starting OffCKB Devnet DESCRIPTION: Starts a local CKB Devnet node using the offckb tool, providing an environment for testing scripts and transactions. SOURCE: https://github.com/nervosnetwork/docs.nervos.org/blob/develop/website/docs/script/spawn-script.mdx#_snippet_16 LANGUAGE: sh CODE: ``` offckb node ``` ---------------------------------------- TITLE: Install Rust - Windows - Bash DESCRIPTION: Installs the Rust toolchain on Windows using the Scoop package manager. Rust is needed for CKB script development. SOURCE: https://github.com/nervosnetwork/docs.nervos.org/blob/develop/website/docs/getting-started/installation.mdx#_snippet_13 LANGUAGE: bash CODE: ``` scoop install rust ``` ---------------------------------------- TITLE: Install Rustup - MacOS - Bash DESCRIPTION: Installs the Rust toolchain manager (rustup) on MacOS using Homebrew. Rust is needed for CKB script development. SOURCE: https://github.com/nervosnetwork/docs.nervos.org/blob/develop/website/docs/getting-started/installation.mdx#_snippet_8 LANGUAGE: bash CODE: ``` brew install rustup ``` ---------------------------------------- TITLE: Setting up CKB Debugger Environment (Shell) DESCRIPTION: Commands to create a project directory, initialize npm, and install necessary CKB SDK and Molecule libraries for the CKB script debugging environment. SOURCE: https://github.com/nervosnetwork/docs.nervos.org/blob/develop/website/docs/script-course/intro-to-script-7.md#_snippet_2 LANGUAGE: shell CODE: ``` $ cd $TOP $ mkdir htlc-runner $ cd htlc-runner $ npm init $ npm install --save @nervosnetwork/ckb-sdk-core $ npm install --save @nervosnetwork/ckb-sdk-utils $ npm install --save molecule-javascript $ npm install --save crc32 ``` ---------------------------------------- TITLE: Initializing CKB Script Project with offckb (Response) DESCRIPTION: This output shows the result of running `offckb create`. It confirms the project name, destination directory, template generation, file movement, and Git initialization, indicating a successful project setup. SOURCE: https://github.com/nervosnetwork/docs.nervos.org/blob/develop/website/docs/script/spawn-script.mdx#_snippet_1 LANGUAGE: bash CODE: ``` ⚠️ Favorite `gh:cryptape/ckb-script-templates` not found in config, using it as a git repository: https://github.com/cryptape/ckb-script-templates.git 🤷 Project Name: spawn-script 🔧 Destination: /tmp/spawn-script ... 🔧 project-name: spawn-script ... 🔧 Generating template ... 🔧 Moving generated files into: `/tmp/spawn-script`... 🔧 Initializing a fresh Git repository ✨ Done! New project created /tmp/spawn-script ``` ---------------------------------------- TITLE: Starting Frontend Development Server (Bash) DESCRIPTION: Navigates into the frontend project directory and runs the standard `npm run dev` command to start the local development server for the Dapp. SOURCE: https://github.com/nervosnetwork/docs.nervos.org/blob/develop/examples/simple-lock/README.md#_snippet_4 LANGUAGE: bash CODE: ``` cd frontend npm run dev ``` ---------------------------------------- TITLE: offckb Inject Config Response DESCRIPTION: Shows the output after running `offckb inject-config`, confirming that the configuration was successfully injected. It also provides examples of how to import and use the generated `offckb.config` object to access script code hashes within the project. SOURCE: https://github.com/nervosnetwork/docs.nervos.org/blob/develop/website/docs/getting-started/quick-start.mdx#_snippet_17 LANGUAGE: bash CODE: ``` All good. You can now use it in your project like: import offCKB from "offckb.config"; const myScriptCodeHash = offCKB.myScripts['script-name'].codeHash; const omnilockScriptCodeHash = offCKB.systemScripts['omnilock'].codeHash; Check example at https://github.com/nervosnetwork/docs.nervos.org/tree/develop/examples/simple-transfer ``` ---------------------------------------- TITLE: Build and Run Omnilock-Metamask Example (Shell) DESCRIPTION: These commands build the project, create a release build, navigate into the specific Omnilock-Metamask example directory, and then start the example application. SOURCE: https://github.com/nervosnetwork/docs.nervos.org/blob/develop/website/docs/common-scripts/omnilock.mdx#_snippet_8 LANGUAGE: Shell CODE: ``` npm run build npm run build-release cd examples/omni-lock-metamask npm start ``` ---------------------------------------- TITLE: Install npm (Node.js v20.18.0 LTS) DESCRIPTION: Install npm (Node.js package manager) along with Node.js. Version v20.18.0 LTS is recommended for managing project dependencies. SOURCE: https://github.com/nervosnetwork/docs.nervos.org/blob/develop/website/docs/getting-started/installation.mdx#_snippet_19 LANGUAGE: bash CODE: ``` /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" brew install node@20.18.0 ``` LANGUAGE: bash CODE: ``` curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - sudo apt install -y nodejs ``` ---------------------------------------- TITLE: Setup Project Directory - Lumos - Bash DESCRIPTION: Creates a new directory named `lumos-example`, navigates into it, and initializes a new pnpm project with default settings (`-y`). This sets up the basic project structure. SOURCE: https://github.com/nervosnetwork/docs.nervos.org/blob/develop/website/docs/sdk-and-devtool/lumos.mdx#_snippet_1 LANGUAGE: Bash CODE: ``` mkdir lumos-example cd lumos-example pnpm init -y ``` ---------------------------------------- TITLE: Example Output: CKB Initialization DESCRIPTION: Illustrative output showing the result of initializing the CKB directory and configuration files for the testnet. SOURCE: https://github.com/nervosnetwork/docs.nervos.org/blob/develop/website/docs/node/run-testnet-node.mdx#_snippet_4 LANGUAGE: bash CODE: ``` WARN: Mining feature is disabled because of lacking the block assembler config options. Initialized CKB directory in /PATH/0.115.0 create ckb.toml create ckb-miner.toml ```