> For the complete documentation index, see [llms.txt](https://neochain.gitbook.io/project/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://neochain.gitbook.io/project/fabric/bian-yi-macos.md).

# 编译（MacOS）

## 安装docker、go等必须的软件

```bash
brew install docker dokcer-machine go
brew install gnu-tar --with-default-names
brew install libtool
```

## 开启dokcer deamon环境

```bash
docker-machine create forfabric
eval $(docker-machine env forfabric)
```

## 设置gopaht环境变量

```bash
#创建目录
mkdir PAHT_TO_GOPATH

#导出环境变量
export gopath=PAHT_TO_GOPATH
 
#然后在gopath下创建下面的目录
PAHT_TO_GOPATH/src/github.com/hyperledger/
 
#设置必要的代理信息
export http_proxy=xxxx:xx
export https_proxy=xxxx:xx
export no_proxy="localhost, 127.0.0.1, 192.168.99.100, 根据你自己的实际情况进行处理"
```

## 下载源码

```bash
cd PAHT_TO_GOPATH/src/github.com/hyperledger/
git clone https://github.com/hyperledger/fabric.git
```

## 编译gotolls

```bash
cd fabric
make gotools
```

## 编译native

```bash
make native
```

## 完结
