From 85960b0b353ff3d327187760429ff12160236e02 Mon Sep 17 00:00:00 2001 From: "yongen.loong" Date: Fri, 26 Jul 2024 13:55:18 +0800 Subject: [PATCH] feat: setup local environment --- .../setup-local-environment/_category_.json | 14 +++ .../dapp-developer/index.md | 90 +++++++++++++++++++ .../node-operator/index.md | 39 ++++++++ .../smart-contract-developer/index.md | 47 ++++++++++ src/theme/MDXComponents.tsx | 4 + 5 files changed, 194 insertions(+) create mode 100644 docs/tools/setup-local-environment/_category_.json create mode 100644 docs/tools/setup-local-environment/dapp-developer/index.md create mode 100644 docs/tools/setup-local-environment/node-operator/index.md create mode 100644 docs/tools/setup-local-environment/smart-contract-developer/index.md diff --git a/docs/tools/setup-local-environment/_category_.json b/docs/tools/setup-local-environment/_category_.json new file mode 100644 index 00000000..9958581e --- /dev/null +++ b/docs/tools/setup-local-environment/_category_.json @@ -0,0 +1,14 @@ +{ + "position": 11, + "label": "Setup local environment", + "collapsible": true, + "collapsed": true, + "link": { + "type": "generated-index", + "title": "Setup local environment", + "slug": "tools/setup-local-environment" + }, + "customProps": { + "description": "For developers or node operators" + } +} diff --git a/docs/tools/setup-local-environment/dapp-developer/index.md b/docs/tools/setup-local-environment/dapp-developer/index.md new file mode 100644 index 00000000..540a3337 --- /dev/null +++ b/docs/tools/setup-local-environment/dapp-developer/index.md @@ -0,0 +1,90 @@ +--- +sidebar_position: 3 +description: Developing decentralised applications (dApps) +--- + +# dApp Developer + +## Setting up a development environment for developing dApps + +Developing decentralised applications (dApps) requires a well-configured development environment. This guide walks you through setting up your environment to build, test, and debug dApps efficiently. + +A typical dApp consists of the following components: + +1. Smart contract +2. Frontend interface +3. Backend interface (optional) + +## Prerequisites + +Before diving into the setup, ensure you have the following: + +- Operating System: Windows, macOS, or Linux. +- Internet Connection: For downloading and installing tools. + +## Step-by-Step Setup + +### 1. Install dependencies + + + + + + **Install .NET SDK** + + The .NET SDK includes the runtime and tools needed to build and run .NET applications. + + - Visit the [.NET Downloads page](https://dotnet.microsoft.com/download). + - Download the latest version of the .NET SDK installer. + - Run the installer and follow the prompts. + + + + + + **Install Node.js** + + - Visit the [Node.js](https://nodejs.org/en) homepage. + - Download the LTS version of Node.js. + - Run the installer and follow the prompts. + + + + + +The specific dependencies to install will depend on the programming language you choose for your backend service. + +| Language | Description | +| ---------- | ----------------------------------------------------------------------------------------------------------------------------- | +| C# | See [Smart contract](/tools/setup-local-environment/dapp-developer/?dapp-components=smart-contract) tab. | +| JavaScript | See [Frontend interface](/tools/setup-local-environment/dapp-developer/?dapp-components=frontend) tab. | +| Go | Visit the [Go install page](https://go.dev/doc/install) and download the installer. Run the installer and follow the prompts. | +| Java | Visit the [Java page](https://www.java.com/en/) and download the installer. Run the installer and follow the prompts. | +| PHP | Visit the [PHP Manual installation and configuration page](https://www.php.net/manual/en/install.php) and follow the steps. | +| Python | Visit the [Python setup and usage page](https://docs.python.org/3/using/index.html) and follow the steps. | + + + + + +--- + +### 2. Install an IDE + +A good IDE can significantly enhance your productivity. Here are the popular options: + +#### Visual Studio (Windows): + +- Visit the [Visual Studio](https://visualstudio.microsoft.com/downloads/) Downloads page and download the Community, Professional, or Enterprise edition. + +#### Visual Studio Code (Cross-platform): + +- Visit the Visual Studio Code Downloads page. +- Download and install the appropriate version for your operating system. +- After installation, install the C# extension from the Extensions view (`Ctrl`+`Shift`+`X`) by searching for C#. + +### 3. Install Additional Tools + +#### Git + +If you plan to use version control, install Git from the [Git Downloads page](https://git-scm.com/downloads). diff --git a/docs/tools/setup-local-environment/node-operator/index.md b/docs/tools/setup-local-environment/node-operator/index.md new file mode 100644 index 00000000..310fcfbe --- /dev/null +++ b/docs/tools/setup-local-environment/node-operator/index.md @@ -0,0 +1,39 @@ +--- +sidebar_position: 1 +description: Setting up a local node +--- + +# Node Operator + +## Setting up the operating system environment for node operators + +Running an aelf node requires a well-configured operating system environment. This guide walks you through setting up your environment to run aelf nodes efficiently. + +## Prerequisites + +Before diving into the setup, ensure you have the following: + +- Operating System: Windows, macOS, or Linux. +- Internet Connection: For downloading and installing tools. + +## Step-by-Step Setup + +### 1. Install Node.js + +- Visit the [Node.js](https://nodejs.org/en) homepage. +- Download the LTS version of Node.js. +- Run the installer and follow the prompts. + +### 2. Install aelf CLI + +To install the `aelf-command` tool globally, use npm: + +```bash +npm install aelf-command -g +``` + +### 3. Install Additional Tools + +#### Git + +If you plan to use version control, install Git from the [Git Downloads page](https://git-scm.com/downloads). diff --git a/docs/tools/setup-local-environment/smart-contract-developer/index.md b/docs/tools/setup-local-environment/smart-contract-developer/index.md new file mode 100644 index 00000000..9decf81d --- /dev/null +++ b/docs/tools/setup-local-environment/smart-contract-developer/index.md @@ -0,0 +1,47 @@ +--- +sidebar_position: 2 +description: Developing smart contracts locally +--- + +# Smart Contract Developer + +## Setting up a development environment for developing smart contracts + +Developing smart contracts using C# requires a well-configured development environment. This guide walks you through setting up your environment to build, test, and debug smart contracts efficiently. + +## Prerequisites + +Before diving into the setup, ensure you have the following: + +- Operating System: Windows, macOS, or Linux. +- Internet Connection: For downloading and installing tools. + +## Step-by-Step Setup + +### 1. Install .NET SDK + +The .NET SDK includes the runtime and tools needed to build and run .NET applications. + +- Visit the [.NET Downloads page](https://dotnet.microsoft.com/download). +- Download the latest version of the .NET SDK installer. +- Run the installer and follow the prompts. + +### 2. Install an IDE + +A good IDE can significantly enhance your productivity. Here are the popular options: + +#### Visual Studio (Windows): + +- Visit the [Visual Studio](https://visualstudio.microsoft.com/downloads/) Downloads page and download the Community, Professional, or Enterprise edition. + +#### Visual Studio Code (Cross-platform): + +- Visit the Visual Studio Code Downloads page. +- Download and install the appropriate version for your operating system. +- After installation, install the C# extension from the Extensions view (`Ctrl`+`Shift`+`X`) by searching for C#. + +### 3. Install Additional Tools + +#### Git + +If you plan to use version control, install Git from the [Git Downloads page](https://git-scm.com/downloads). diff --git a/src/theme/MDXComponents.tsx b/src/theme/MDXComponents.tsx index 9be96436..9c1da884 100644 --- a/src/theme/MDXComponents.tsx +++ b/src/theme/MDXComponents.tsx @@ -2,6 +2,8 @@ import React from "react"; // Import the original mapper import MDXComponents from "@theme-original/MDXComponents"; import DocCardListLinks from "@site/src/theme/DocCardListLinks"; +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; export default { // Re-use the default mapping @@ -9,4 +11,6 @@ export default { // Map the "" tag to our Highlight component // `Highlight` will receive all props that were passed to `` in MDX DocCardListLinks, + Tabs, + TabItem, };