系統 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