apt install mesa-opencl-icd ocl-icd-opencl-dev -y
add-apt-repository ppa:longsleep/golang-backports
apt install golang-go gcc git bzr jq pkg-config mesa-opencl-icd ocl-icd-opencl-dev -y
apt install golang -y
# go version
go version go1.10.4 linux/amd64
# apt remove -y golang
# wget https://dl.google.com/go/go1.13.3.linux-amd64.tar.gz
# tar -zxvf go1.13.3.linux-amd64.tar.gz
# mv go /usr/local/
# rm -rf /usr/bin/go
# rm -rf /usr/bin/gofmt
# ln -s /usr/local/go/bin/* /usr/bin/
# go version
go version go1.13.3 linux/amd64
apt install -y gcc
apt install -y git
apt install -y bzr
apt install -y jq
apt install -y pkg-config
apt install -y curl
# mkdir ~/go
# cd ~/go/
# mkdir bin src pkg
# vim .profile
export GOROOT=/usr/local/go/
export GOPATH=/root/mygo
export GOBIN=$GOPATH/bin
export PATH=$PATH:$GOROOT/bin
export PATH=$PATH:$GOPATH/bin
# source .profile
apt install s~s-libev -y
# cat /etc/s~s-libev/config.json
{
"server":"服务器ip",
"server_port":端口,
"local_port":1080,
"password":"密码",
"timeout":60,
"method":"chacha20-ietf-poly1305"
}
# systemctl enable s~ks-libev-local@config
# systemctl start s~s-libev-local@config
# systemctl status s~s-libev-local@config
export ALL_PROXY=socks5://127.0.0.1:1080
git clone https://github.com/filecoin-project/lotus.git
# cd lotus/
# export GO111MODULE=on
# export GOPROXY=https://goproxy.io
# make clean all
# make install
install -C ./lotus /usr/local/bin/lotus
install -C ./lotus-storage-miner /usr/local/bin/lotus-storage-miner
lotus daemon
lotus daemon >> /var/log/lotus.log 2>&1 &
Get https://ipfs.io/ipfs/QmRssVAXRN3xp9VdSpTq1pNjkob3QiikoFZiM5hqrmh1VU: dial tcp 199.59.150.49:443: i/o timeout
const gateway = "https://ipfs.io/ipfs/"
Public IPFS Gateways
# vim /root/lotus/build/paramfetch.go
//const gateway = "https://ipfs.io/ipfs/"
const gateway = "https://ipfs.globalupload.io/"
# cd /root/lotus/
# systemctl status s-libev-local@config
# export ALL_PROXY=socks5://127.0.0.1:1080
# export GO111MODULE=on
# export GOPROXY=https://goproxy.io
# make clean all && make install
install -C ./lotus /usr/local/bin/lotus
install -C ./lotus-storage-miner /usr/local/bin/lotus-storage-miner
# lotus daemon >> /var/log/lotus.log 2>&1 &
bad handshake
,再打开一个终端运行守护进程# lotus net peers
websocket: bad handshake
# lotus net peers | wc -l
86
# lotus sync status
Height: 16088
# lotus sync wait
# lotus sync wait
Target: [bafy2bzacedm7m4gfctogyii7fzhn4a3n66x5v5kvee33z26pve63qup7bhuts] State: complete Height: 2594
Done
~~watch -n 1 lotus sync status
Stage: complete
块高度同步完成
Stage: complete
# lotus wallet list
# lotus wallet new bls
t3
# lotus wallet balance
0.0000000005
# lotus state pledge-collateral
17.932813648858594875
lotus-storage-miner init --actor=t0392 --owner=t3vqiuqoyabieb5pcx74sc57pk4njnsleezmf4w26nfzi4vlynz3ecwnopgjwmwkdguvb2med6h5womtkmteqq
New storage miners address is: t0
Run lotus-storage-miner init --actor=t0 -owner=t3
区块同步完成以后才能初始化,不然会报错``actor not found
# lotus-storage-miner init --actor=t0 -owner=t3
INFO main lotus-storage-miner/init.go:113 Storage miner successfully created, you can now start it with 'lotus-storage-miner run'
~- 报错``actor not found`,区块高度同步完成后初始化~
ERROR: failed to initialize lotus-storage-miner: failed to configure storage miner: failed to get worker address: call raw get actor: actor not found
# rm -rf .lotusstorage/
# lotus-storage-miner init --actor=t02 --owner=t3q
build build/paramfetch.go:79 checksum mismatch in param file /var/tmp/filecoin-proof-parameters/v14-proof-of-spacetime-rational-b99f15d0bdaaf4ffb68b2ca72b69ea8d915f66a2a56f667430ad69d87aa5febd.params, 88ae592f8051bc4db4c9947862880427 != ff77a5e270afc6e1c7fbc19e48348fac
18.36 MiB / 2.43 GiB [>-------------------------------------------------------------] 0.74% 192.42 KiB/s 3h38m42s
31.24 MiB / 2.43 GiB [>-------------------------------------------------------------] 1.26% 202.79 KiB/s 3h26m09s
85.77 MiB / 2.43 GiB [==>-----------------------------------------------------------] 3.45% 403.19 KiB/s 1h41m23s
165.93 MiB / 2.43 GiB [====>--------------------------------------------------------] 6.68% 611.90 KiB/s 1h04m37s
266.78 MiB / 2.43 GiB [======>--------------------------------------------------------] 10.74% 808.84 KiB/s 46m46s
391.20 MiB / 2.43 GiB [=========>----------------------------------------------------] 15.75% 1007.00 KiB/s 35m26s
546.74 MiB / 2.43 GiB [==============>--------------------------------------------------] 22.01% 1.19 MiB/s 27m01s
# lotus-storage-miner init --actor=t0584 --owner=t3vqiuqoyabieb5pcx74sc57pk4njnsleezmf4w26nfzi4vlynz3ecwnopgjwmwkdguvb2med6h5womtkmteqq
2019-11-18T10:11:03.865+0800 INFO main lotus-storage-miner/init.go:59 Initializing lotus storage miner
2019-11-18T10:11:03.866+0800 INFO main lotus-storage-miner/init.go:61 Checking proof parameters
2019-11-18T10:11:03.871+0800 INFO build build/paramfetch.go:114 Parameter file /var/tmp/filecoin-proof-parameters/v15-stacked-proof-of-replication-d01cd22091627b721c60a3375b5219af653fb9f6928c70aa7400587d396bc07a.vk is ok
2019-11-18T10:11:03.871+0800 INFO build build/paramfetch.go:114 Parameter file /var/tmp/filecoin-proof-parameters/v15-proof-of-spacetime-rational-535d1050e3adca2a0dfe6c3c0c4fa12097c9a7835fb969042f82a507b13310e0.vk is ok
2019-11-18T10:11:03.871+0800 INFO build build/paramfetch.go:114 Parameter file /var/tmp/filecoin-proof-parameters/v15-stacked-proof-of-replication-967b11bb59be11b7dc6f2b627520ba450a3aa50846dbbf886cb8b735fe25c4e7.vk is ok
2019-11-18T10:11:03.871+0800 INFO build build/paramfetch.go:114 Parameter file /var/tmp/filecoin-proof-parameters/v15-stacked-proof-of-replication-0c0b444c6f31d11c8e98003cc99a3b938db26b77a296d4253cda8945c234266d.vk is ok
2019-11-18T10:11:03.871+0800 INFO build build/paramfetch.go:114 Parameter file /var/tmp/filecoin-proof-parameters/v15-proof-of-spacetime-rational-c2ae2b440e693ee69fd6da9e85c4294c5c70c1a46d5785ca5f2a676d6cd4c8de.vk is ok
2019-11-18T10:11:03.872+0800 INFO build build/paramfetch.go:114 Parameter file /var/tmp/filecoin-proof-parameters/v15-proof-of-spacetime-rational-b99f15d0bdaaf4ffb68b2ca72b69ea8d915f66a2a56f667430ad69d87aa5febd.vk is ok
2019-11-18T10:11:05.392+0800 INFO build build/paramfetch.go:114 Parameter file /var/tmp/filecoin-proof-parameters/v15-proof-of-spacetime-rational-535d1050e3adca2a0dfe6c3c0c4fa12097c9a7835fb969042f82a507b13310e0.params is ok
2019-11-18T10:11:05.542+0800 INFO build build/paramfetch.go:114 Parameter file /var/tmp/filecoin-proof-parameters/v15-proof-of-spacetime-rational-c2ae2b440e693ee69fd6da9e85c4294c5c70c1a46d5785ca5f2a676d6cd4c8de.params is ok
2019-11-18T10:11:06.062+0800 INFO build build/paramfetch.go:114 Parameter file /var/tmp/filecoin-proof-parameters/v15-proof-of-spacetime-rational-b99f15d0bdaaf4ffb68b2ca72b69ea8d915f66a2a56f667430ad69d87aa5febd.params is ok
2019-11-18T10:11:52.786+0800 INFO build build/paramfetch.go:114 Parameter file /var/tmp/filecoin-proof-parameters/v15-stacked-proof-of-replication-0c0b444c6f31d11c8e98003cc99a3b938db26b77a296d4253cda8945c234266d.params is ok
2019-11-18T10:12:03.891+0800 INFO build build/paramfetch.go:114 Parameter file /var/tmp/filecoin-proof-parameters/v15-stacked-proof-of-replication-967b11bb59be11b7dc6f2b627520ba450a3aa50846dbbf886cb8b735fe25c4e7.params is ok
2019-11-18T10:12:04.702+0800 INFO build build/paramfetch.go:114 Parameter file /var/tmp/filecoin-proof-parameters/v15-stacked-proof-of-replication-d01cd22091627b721c60a3375b5219af653fb9f6928c70aa7400587d396bc07a.params is ok
2019-11-18T10:12:04.702+0800 INFO main lotus-storage-miner/init.go:66 Checking if repo exists
2019-11-18T10:12:04.702+0800 INFO main lotus-storage-miner/init.go:82 Trying to connect to full node RPC
2019-11-18T10:12:04.711+0800 INFO main lotus-storage-miner/init.go:91 Checking full node version
2019-11-18T10:12:04.714+0800 INFO main lotus-storage-miner/init.go:102 Initializing repo
2019-11-18T10:12:04.714+0800 INFO repo repo/fsrepo.go:98 Initializing repo at '/root/.lotusstorage'
2019-11-18T10:12:04.715+0800 INFO main lotus-storage-miner/init.go:131 Initializing libp2p identity
2019-11-18T10:12:04.746+0800 INFO main lotus-storage-miner/init.go:258 Waiting for message: bafy2bzacea4gnyhzrenb37m7wwcsmqkqzu7odoyq6rapcluyckke3syadxgqq
+2019-11-18T10:12:27.475+0800 INFO main lotus-storage-miner/init.go:164 Created new storage miner: t0584
2019-11-18T10:12:27.486+0800 INFO badger [email protected]/logger.go:46 All 0 tables opened in 0s
2019-11-18T10:12:27.498+0800 INFO main lotus-storage-miner/init.go:118 Storage miner successfully created, you can now start it with 'lotus-storage-miner run'
# lotus-storage-miner run
lotus-storage-miner run >> /var/log/miner.log 2>&1 &
# lotus-storage-miner info
Miner: t0
Power: 536870912 / 1529109025672 (0.00%)
Sealed Sectors: 3
Sealing Sectors: 0
Pending Sectors: 0
Failed Sectors: 0
# lotus-storage-miner store-garbage
2
# lotus-storage-miner state power
1530199544712
# lotus-storage-miner info
Miner: t03..
Power: 536870912 / 1530216321928 (0.00%)
Sealed Sectors: 3
Sealing Sectors: 2
Pending Sectors: 0
Failed Sectors: 0
# lotus-storage-miner state power t03..
536870912
# lotus-storage-miner state sectors t03..
1: dcf3407b9d80f50316751f1cd183d736d76c667b2a00ea75af58f9f7cdb0c464 197085d07c2b6f5872965c14ae98c5a24024a0a5117e0724063ed5c43d497f6a
2: 85990f7fb1d543b3d29a7b63f9f047debaf07236ea79fa787ba9aed18fcbcc2f 197085d07c2b6f5872965c14ae98c5a24024a0a5117e0724063ed5c43d497f6a
3: cc6edb05b3d8a0afd7732fb7331fdf868ccee8881b71d46b0f5e5e466618930b ae123b66a933bdc63e571a668cee757a877f4dd3f15048052cbbe538c456a14b
# echo "hi my name is lotus03" > hello.txt
# cat hello.txt
hi my name is lotus03
# lotus client import hello.txt
bafk
# lotus client local
bafkrei
# echo "Hi my name is c" > hello.txt
# mv /work/hello.txt /root/
# lotus client import hello.txt
bafkre
# lotus client local
bafkre
# lotus state list-miners | wc -l
119
# lotus state list-miners | grep t03..
t03..
# lotus client query-ask t03..
Ask: t03..
Price per Byte: 0.0000000005
# lotus client import /root/hello.txt
baf...
# lotus-storage-miner info
Miner: t03..
# lotus wallet balance
73.196131249635697369
# lotus client deal baf... t03.. 0.001 12
bafyreievod3o3ksnipg6mchmmbq4iejbrsj56du4igi6nbuizuchvobwsy
# lotus client deal bafkreihlg4tsyuqoxpsg4pnq5qqfs3krbe7pbwkwudmjv4od3xaifus57q t0594 0.0000000005 12
bafyreif2fk53aselwv5n27es6yxlmnnddo3dfbmzp6p7cg5cnl2su5ydau
# rm -rf /root/.lotus /root/.lotusstorage/
make && make install
apt install mesa-opencl-icd ocl-icd-opencl-dev -y
add-apt-repository ppa:longsleep/golang-backports
apt install golang-go gcc git bzr jq pkg-config mesa-opencl-icd ocl-icd-opencl-dev -y
# git log
commit 981f10856516127f6f29037cc901cf4c401e2ace (HEAD -> master, origin/master, origin/HEAD)
Merge: d080dbd bc97a73
Author: Łukasz Magiera
Date: Wed Oct 30 08:29:56 2019 +0100
# systemctl status [email protected]
# export ALL_PROXY=socks5://127.0.0.1:1080
# git pull
新 981f108..aafccaf
error: 您对下列文件的本地修改将被合并操作覆盖:
build/paramfetch.go
请在合并前提交或贮藏您的修改。
终止中
# git log
# git fetch --all
正在获取 origin
# git reset --hard origin/master
HEAD 现在位于 aafccaf Merge pull request #488 from filecoin-project/feat/dt-skeleton
# make clean all
make clean all
# make clean all
rm -rf build/.bls-install build/.sector-builder-install build/.update-modules lotus lotus-storage-miner
make -C extern/go-bls-sigs/ clean
make[1]: 进入目录“/root/lotus/extern/go-bls-sigs”
rm -rf libbls_signatures.h libbls_signatures.pc libbls_signatures.a .install-bls
make[1]: 离开目录“/root/lotus/extern/go-bls-sigs”
make -C extern/go-sectorbuilder/ clean
make[1]: 进入目录“/root/lotus/extern/go-sectorbuilder”
rm -rf sector_builder_ffi.h sector_builder_ffi.pc libsector_builder_ffi.a .install-rust-fil-sector-builder
make[1]: 离开目录“/root/lotus/extern/go-sectorbuilder”
git submodule update --init --recursive
touch build/.update-modules
make -C extern/go-bls-sigs/ libbls_signatures.a libbls_signatures.pc libbls_signatures.h
make[1]: 进入目录“/root/lotus/extern/go-bls-sigs”
./install-bls-signatures
acquiring release @ bb2cae2bde5aa285
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 5725 100 5725 0 0 4843 0 0:00:01 0:00:01 --:--:-- 4847
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 2627k 100 2627k 0 0 43205 0 0:01:02 0:01:02 --:--:-- 34984
make[1]: “libbls_signatures.pc”已是最新。
make[1]: “libbls_signatures.h”已是最新。
make[1]: 离开目录“/root/lotus/extern/go-bls-sigs”
make -C extern/go-sectorbuilder/ libsector_builder_ffi.a sector_builder_ffi.pc sector_builder_ffi.h
make[1]: 进入目录“/root/lotus/extern/go-sectorbuilder”
./install-rust-fil-sector-builder
acquiring release @ 599e522acbe12656
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 5853 100 5853 0 0 7571 0 --:--:-- --:--:-- --:--:-- 7571
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:04 --:--:-- 0
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 17.3M 100 17.3M 0 0 161k 0 0:01:50 0:01:50 --:--:-- 321k+
make[1]: “sector_builder_ffi.pc”已是最新。
make[1]: “sector_builder_ffi.h”已是最新。
make[1]: 离开目录“/root/lotus/extern/go-sectorbuilder”
rm -f lotus
go build -o lotus ./cmd/lotus
+go run github.com/GeertJohan/go.rice/rice append --exec lotus -i ./build
rm -f lotus-storage-miner
go build -o lotus-storage-miner ./cmd/lotus-storage-miner
go run github.com/GeertJohan/go.rice/rice append --exec lotus-storage-miner -i ./build
# make clean all
报错go: github.com/Gurpartap/[email protected]: Get https://proxy.golang.org/github.com/%21gurpartap/async/@v/v0.0.0-20180927173644-4f7f499dd9ee.mod: dial tcp 172.217.24.17:443: i/o timeout
# export GO111MODULE=on
# export GOPROXY=https://goproxy.io
compile: version "go1.13.3" does not match go tool version "go1.13.4"
make install
# make install
install -C ./lotus /usr/local/bin/lotus
install -C ./lotus-storage-miner /usr/local/bin/lotus-storage-miner
const gateway = "https://ipfs.io/ipfs/"
# vim /root/lotus/build/paramfetch.go
//const gateway = "https://ipfs.io/ipfs/"
const gateway = "https://ipfs.globalupload.io/"
# make clean all
# make install
# lotus version
0.7.0+api0.7.1793 <nil>
lotus version 0.7.0
参考: