徒手搭建Filecoin测试环境

系统 Ubuntu 18.04.2 LTS 64位

首先搭建filecoin的运行环境

为了方便我们使用brew来安装

运行 

sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)"

  然后再设置PATH

export PATH="/home/linuxbrew/.linuxbrew/bin:$PATH"

卸载

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)" 

  

需要手动删除文件夹:
rm -r -f /home/linuxbrew/.linuxbrew
brew默认的源速度太慢了,可以替换成国内的清华大学提供的源

1.Homebrew 的 formula 索引的镜像(即brew update时所更新内容)
替换brew.git
这里$(brew --repo) 是/home/linuxbrew/.linuxbrew/Homebrew
$ cd "$(brew --repo)"
$ git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
替换homebrew-core.git
$ cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
$ git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
$ brew update

2. Homebrew 二进制预编译包的镜像(注: 2.1 2.2 任选其一)    
 2.1 临时替换(关闭终端再次打开终端时配置失效,使用默认配置)   
 export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles    
 2.2 长期替换(建议使用此项配置)  
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles'>>   ~/.bash_profile   
source ~/.bash_profile  
 #执行.bash_profile脚本让配置即时生效

运行filecoin

下载最新版本包https://github.com/filecoin-project/go-filecoin/releases

tar -zxvf  xxx.tar.gz 
解压filecoin压缩包
然后右键在终端中运行解压出来的文件

测试

./go-filecoin 

初始化节点数据

./go-filecoin init --devnet-user --genesisfile=http://user.kittyhawk.wtf:8020/genesis.car

向测试网同步数据

./go-filecoin daemon

定义节点的名称

./go-filecoin config heartbeat.nickname "XXX"

其中XXX可以替换为您自己的昵称,回车后即可修改我们节点名称

核对节点的名称

./go-filecoin config heartbeat.nickname

查询节点ID

./go-filecoin id
并复制ID

使您出现在测试网中

./go-filecoin config heartbeat.beatTarget "/dns4/stats-infra.kittyhawk.wtf/tcp/8080/ipfs/XXXXX"

其中XXXXX即我们前一步所复制的节点ID

在Filecoin可视化控制台网站中,找到自己节点的昵称

https://stats.kittyhawk.wtf/

 本机器/etc/profile文件

export GOPATH=/home/www/golang/gopath
export GOROOT=/usr/local/go
export GOARCH=386
export GOOS=linux
export GOTOOLS=$GOROOT/pkg/tool
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
export PKG_CONFIG_PATH=/usr/lib/pkgconfig

  

Linux下修改环境变量

echo $PATH
以添加mongodb server为列
修改方法一:
export PATH=/usr/local/mongodb/bin:$PATH
//配置完后可以通过echo $PATH查看配置结果。
生效方法:立即生效
有效期限:临时改变,只能在当前的终端窗口中有效,当前窗口关闭后就会恢复原有的path配置
用户局限:仅对当前用户

修改方法二:
通过修改.bashrc文件:
vim ~/.bashrc
//在最后一行添上:
export PATH=/usr/local/mongodb/bin:$PATH
生效方法:(有以下两种)
1、关闭当前终端窗口,重新打开一个新终端窗口就能生效
2、输入“source ~/.bashrc”命令,立即生效
有效期限:永久有效
用户局限:仅对当前用户

修改方法三:
通过修改profile文件:
vim /etc/profile
/export PATH //找到设置PATH的行,添加
export PATH=/usr/local/mongodb/bin:$PATH
生效方法:系统重启
有效期限:永久有效
用户局限:对所有用户

修改方法四:
通过修改environment文件:
vim /etc/environment
在PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"中加入“:/usr/local/mongodb/bin”
生效方法:系统重启
有效期限:永久有效
用户局限:对所有用户
echo $PKG_CONFIG_PATH
find / -name pkgconfig
export PKG_CONFIG_PATH=/usr/lib/pkgconfig/
export PKG_CONFIG_PATH=/usr/lib/pkgconfig/:$PKG_CONFIG_PATH       覆盖原来的PATH

转载于:https://www.cnblogs.com/yitian09/p/11221881.html

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值