55

Spectrum链开发 -- Mac开发环境搭建

 5 years ago
source link: https://studygolang.com/articles/14616?amp%3Butm_medium=referral
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

本文介绍在Mac OS X环境下如何搭建Spectrum开发环境。

环境配置

安装golang

brew install go

配置golang环境变量

vim ~/.bash_profile

在~/.bash_profile下添加GOPATH

#replace ~/go_project with your path
export GOPATH=~/go_project   
export PATH=.:$PATH:$GOPATH:$GOPATH/bin

在GOPATH下创建src,pkg,bin目录

mkdir -p $GOPATH/bin $GOPATH/pkg $GOPATH/src

检测go 环境

source ~/.bash_profile
go env

安装git

brew install git

源码编译

下载最新源码到GOPATH下

mkdir -p $GOPATH/src/github.com/SmartMeshFoundation
cd $GOPATH/src/github.com/SmartMeshFoundation
git clone https://github.com/SmartMeshFoundation/Spectrum

编译smc

cd $GOPATH/src/github.com/SmartMeshFoundation/Spectrum/
go install -v ./cmd/smc

编译成功后smc可执行文件路径:$GOPAT/bin/smc

测试smc

smc console

关于IDE

Mac下常用的IDE有Golion,VSCode,GoVim等,可按个人喜好选择IDE。


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK