跟着视频学习了以太坊相关的东西,遇到了一系列坑,今天整理成笔记。
一、安装nodejs
# 安装相关依赖
yum -y install git bzip2 gcc gcc-c++ ntp epel-release
# 源码安装
wget https://npm.taobao.org/mirrors/node/v11.0.0/node-v11.0.0.tar.gz
tar -zxvf node-v11.0.0.tar.gz
cd node-v11.0.0
./configure
make
make install
node -v # 检测是否安装成功
# 配置npm仓库
npm install -g cnpm --registry=https://registry.npm.taobao.org
二、安装geth
# 安装cmake
wget https://cmake.org/files/v3.15/cmake-3.15.2.tar.gz
tar zxvf cmake-3.15.2.tar.gz
mv cmake-3.15.2 /usr/local/
cd /usr/local/cmake-3.15.2
./bootstrap
gmake
gmake install
echo "export PATH=/usr/local/cmake-3.15.2/bin:$PATH" >> /etc/profile
source /etc/profile
cmake -version # 检测cmake是否安装成功
# 安装go语言环境
wget https://storage.googleapis.com/golang/go1.10.2.linux-amd64.tar.gz
tar -zxvf go1.10.2.linux-amd64.tar.gz
mv go1.10.2.linux-amd64 /usr/local/
echo "export GOROOT=/usr/local/go" >> /etc/profile
echo "export PATH=/usr/local/go/bin:$PATH" >>

本文详细介绍在CentOS7环境下安装Node.js、Geth等工具,搭建以太坊私有链,以及使用Solidity编写、编译与部署智能合约的全过程。文章覆盖了从环境配置到合约调用的各个环节。
最低0.47元/天 解锁文章
930

被折叠的 条评论
为什么被折叠?



