logo

Development Environment

Before You Start#

To develop smart contracts, you need to install the .NET SDK. Other tools for starting aelf nodes and publishing contracts are optional.

macOS Setup#

  • Requirements:
  • Apple M1 Support: Install Rosetta:
  • 1
    /usr/sbin/softwareupdate --install-rosetta --agree-to-license
  • Install Homebrew:
  • 1
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    2
    brew --version
    3
    brew update
  • Install Git:
  • 1
    brew install git
    2
    git --version
  • Install .NET SDK:
  • 1
    brew install --cask dotnet-sdk
    2
    dotnet --version
  • Install protoBuf:
  • 1
    brew install protobuf
    2
    protoc --version
  • Install Redis:
  • 1
    brew install redis
    2
    redis-server
  • Install Node.js:
  • 1
    brew install node
    2
    npm --version
  • Install aelf-command:
  • 1
    npm i aelf-command -g
  • Create an aelf Account:
  • 1
    aelf-command create

    Similar Output:

    1
    AElf [Info]: Your wallet info is :
    2
    AElf [Info]: Mnemonic : mirror among battle muffin cattle plunge tuition buzz hip mad surround recall
    3
    AElf [Info]: Private Key : 4bf625afea60e21aa5afcab5ea682b3dfb614941245698632d72a09ae13**
    4
    AElf [Info]: Public Key : 04f9bb56a9eca921bd494e677307f0279c98f1d2ed6bdeaa6dd256878272eabd14e91ec61469d2a32ce5e63205930dabdc0b9f13fc80c1f4e31760618d182**
    5
    AElf [Info]: Address : 21qciGwcaowwBttKMjMk86AW6WajhcodSHytY1vCyZb7p*

    Linux Setup#

  • Requirements:
  • Update Environment:
  • 1
    sudo apt-get update
  • Install Git:
  • 1
    sudo apt-get install git -y
    2
    git --version
  • Install .NET SDK:
  • 1
    wget https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
    2
    sudo dpkg -i packages-microsoft-prod.deb
    3
    sudo apt-get update
    4
    sudo apt-get install -y dotnet-sdk-6.0
    5
    dotnet --version
  • Install protoBuf:
  • 1
    curl -OL https://github.com/google/protobuf/releases/download/v21.9/protoc-21.9-linux-x86_64.zip
    2
    unzip protoc-21.9-linux-x86_64.zip -d protoc3
    3
    sudo mv protoc3/bin/* /usr/local/bin/
    4
    sudo mv protoc3/include/* /usr/local/include/
    5
    protoc --version
  • Install Redis:
  • 1
    sudo apt-get install redis -y
    2
    redis-server
  • Install Node.js:
  • 1
    curl -fsSL https://deb.nodesource.com/setup_14.x | sudo -E bash -
    2
    sudo apt-get install -y nodejs
    3
    npm --version
  • Install aelf-command:
  • 1
    npm i aelf-command -g
  • Create an aelf Account:
  • 1
    aelf-command create

    Windows Setup#

  • Requirements:
  • Install Chocolatey
  • 1
    Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
    2
    choco
  • Install Git:
  • 1
    choco install git -y
    2
    git --version
  • Install .NET SDK:
  • 1
    choco install dotnetcore-sdk -y
    2
    dotnet --version
  • Install protoBuf:
  • 1
    choco install protoc -y
    2
    protoc --version
  • Install Redis:
  • 1
    choco install redis-64 -y
    2
    redis-server
  • Install Node.js:
  • 1
    choco install nodejs -y
    2
    npm --version
  • Install aelf-command:
  • 1
    npm i aelf-command -g
  • Create an aelf Account:
  • 1
    aelf-command create

    Codespaces Setup#

  • Open Codespaces:
  • Visit the aelfProject repo.
  • Click "Code" > "Codespaces" > "+" to create a new codespace.
  • Check Installed Versions:
  • 1
    git --version
    2
    npm --version
  • Update Environment:
  • 1
    sudo apt-get update
  • Install .NET SDK:
  • 1
    wget https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
    2
    sudo dpkg -i packages-microsoft-prod.deb
    3
    sudo apt-get update
    4
    sudo apt-get install -y dotnet-sdk-6.0
    5
    dotnet --version
  • Install protoBuf:
  • 1
    curl -OL https://github.com/google/protobuf/releases/download/v21.9/protoc-21.9-linux-x86_64.zip
    2
    unzip protoc-21.9-linux-x86_64.zip -d protoc3
    3
    sudo mv protoc3/bin/* /usr/local/bin/
    4
    sudo mv protoc3/include/* /usr/local/include/
    5
    protoc --version
  • Install Redis:
  • 1
    sudo apt-get install redis -y
    2
    redis-server
  • Install aelf-command:
  • 1
    npm i aelf-command -g
  • Create an aelf Account:
  • 1
    aelf-command create

    Edited on: 16 July 2024 05:32:33 GMT+0