Development Environment
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:
- macOS 10.7 or higher
- 2GHz processor (3GHz recommended)
- 8 GB RAM (16 GB recommended)
- 10 GB free space
- Broadband internet
-
Apple M1 Support: Install Rosetta:
Terminal/usr/sbin/softwareupdate --install-rosetta --agree-to-license
-
Install Homebrew:
Terminal/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew --version
brew update -
Install Git:
Terminalbrew install git
git --version -
Install .NET SDK:
Terminalbrew install --cask dotnet-sdk
dotnet --version -
Install protoBuf:
Terminalbrew install protobuf
protoc --version -
Install Redis:
Terminalbrew install redis
redis-server
-
Install Node.js:
Terminalbrew install node
npm --version -
Install aelf-command:
Terminalnpm i aelf-command -g
-
Create an aelf Account:
Terminalaelf-command create
Similar Output:
TerminalAElf [Info]: Your wallet info is :
AElf [Info]: Mnemonic : mirror among battle muffin cattle plunge tuition buzz hip mad surround recall
AElf [Info]: Private Key : 4bf625afea60e21aa5afcab5ea682b3dfb614941245698632d72a09ae13*****
AElf [Info]: Public Key : 04f9bb56a9eca921bd494e677307f0279c98f1d2ed6bdeaa6dd256878272eabd14e91ec61469d2a32ce5e63205930dabdc0b9f13fc80c1f4e31760618d182*****
AElf [Info]: Address : 21qciGwcaowwBttKMjMk86AW6WajhcodSHytY1vCyZb7p*****
Linux Setup
-
Requirements:
- Ubuntu 18.04
- Broadband internet
-
Update Environment:
Terminalsudo apt-get update
-
Install Git:
Terminalsudo apt-get install git -y
git --version -
Install .NET SDK:
Terminalwget https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo apt-get update
sudo apt-get install -y dotnet-sdk-6.0
dotnet --version -
Install protoBuf:
Terminalcurl -OL https://github.com/google/protobuf/releases/download/v21.9/protoc-21.9-linux-x86_64.zip
unzip protoc-21.9-linux-x86_64.zip -d protoc3
sudo mv protoc3/bin/* /usr/local/bin/
sudo mv protoc3/include/* /usr/local/include/
protoc --version -
Install Redis:
Terminalsudo apt-get install redis -y
redis-server -
Install Node.js:
Terminalcurl -fsSL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt-get install -y nodejs
npm --version -
Install aelf-command:
Terminalnpm i aelf-command -g
-
Create an aelf Account:
Terminalaelf-command create
Windows Setup
-
Requirements:
- Windows 10 or higher
- Broadband internet
-
Install Chocolatey:
TerminalSet-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'))
choco -
Install Git:
Terminalchoco install git -y
git --version -
Install .NET SDK:
Terminalchoco install dotnetcore-sdk -y
dotnet --version -
Install protoBuf:
Terminalchoco install protoc -y
protoc --version -
Install Redis:
Terminalchoco install redis-64 -y
redis-server
-
Install Node.js:
Terminalchoco install nodejs -y
npm --version -
Install aelf-command:
Terminalnpm i aelf-command -g
-
Create an aelf Account:
Terminalaelf-command create
Codespaces Setup
-
Open Codespaces:
-
Visit the aelfProject repo.
-
Click "Code" > "Codespaces" > "+" to create a new codespace.
-
Check Installed Versions:
Terminalgit --version
npm --version -
Update Environment:
Terminalsudo apt-get update
-
Install .NET SDK:
Terminalwget https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo apt-get update
sudo apt-get install -y dotnet-sdk-6.0
dotnet --version -
Install protoBuf:
Terminalcurl -OL https://github.com/google/protobuf/releases/download/v21.9/protoc-21.9-linux-x86_64.zip
unzip protoc-21.9-linux-x86_64.zip -d protoc3
sudo mv protoc3/bin/* /usr/local/bin/
sudo mv protoc3/include/* /usr/local/include/
protoc --version -
Install Redis:
Terminalsudo apt-get install redis -y
redis-server -
Install aelf-command:
Terminalnpm i aelf-command -g
-
Create an aelf Account:
Terminalaelf-command create