需求
Linux (ubuntu 系统)
64-bit
4GB of free memory
开始
安装依赖的包:
sudo apt-get install \
build-essential pkg-config libc6-dev m4 g++-multilib \
autoconf libtool ncurses-dev unzip git python python-zmq \
zlib1g-dev wget bsdmainutils automake
检查gcc 的版本信息
需要 gcc/g++ 4.9 或者更高的版本
查看 gcc 版本信息如下:
g++ --version
安装 gcc/g++ 4.9
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install g++-4.9
获取软件和参数文件
利用git 获取仓库并执行文件 fetch-params.sh
git clone https://github.com/zcash/zcash.git
cd zcash/
git checkout v1.0.8-1
./zcutil/fetch-params.sh
构建
确保成功安装所有依赖的软件包,执行如下命令
./zcutil/build.sh --disable-rust -j$(nproc)
测试
真实网络测试需要8G内存(此过程可略过)
执行:
./qa/zcash/full-test-suite.sh
./qa/pull-tester/rpc-tests.sh
配置
创建~/.zcash文件夹,并在起目录下利用下述命令创建~/.zcash/zcash.conf (下序命令创建文件夹和文件)
mkdir -p ~/.zcash
echo "addnode=mainnet.z.cash" >~/.zcash/zcash.conf
echo "rpcuser=username" >>~/.zcash/zcash.conf
echo "rpcpassword=`head -c 32 /dev/urandom | base64`" >>~/.zcash/zcash.conf
确保 CPU 能挖矿
echo 'gen=1' >> ~/.zcash/zcash.conf
echo "genproclimit=-1" >> ~/.zcash/zcash.conf
运行 Zcash
./src/zcashd
或者后台运行
./src/zcashd --daemon
获取相关信息
./src/zcash-cli getinfo
注意中间出现一些问题:
解决方法:
apt-get install update
apt-get install upgrade
此外,还遇到一个文件记不清了,当时修改configure.ac 文件.看参考网址.
后续使用参考官网手册
https://github.com/zcash/zcash/wiki/1.0-User-Guide
https://github.com/zcash/zcash/issues/1898
https://github.com/zcash/zcash/blob/master/configure.ac#L443