filecoin-0.5.6-Linux.tar.gz
# tar -zxvf filecoin-0.5.6-Linux.tar.gz
# cd filecoin/
# ls -l
total 67344
-rwxr-xr-x 1 3434 3434 48859448 9月 25 08:49 go-filecoin
-rwxr-xr-x 1 3434 3434 20096416 9月 25 08:49 paramcache
# cd /var/tmp/
# mkdir filecoin-proof-parameters
# echo 'export PATH="/root/filecoin:$PATH"' >> ~/.bashrc
# source ~/.bashrc
# cd filecoin/
# ./paramcache
filecoin-0.5.7-Linux.tar.gz
# pwd
/
# ls -lah | grep filecoin
# tar -zxvf filecoin-0.5.7-Linux.tar.gz -C ~
# cat ~/.bashrc
export PATH="/root/filecoin":$PATH
# source ~/.bashrc
# echo 'export PATH="/root/filecoin":$PATH' >> ~/.bashrc
# source ~/.bashr
# which go-filecoin
/root/filecoin/go-filecoin
go-filecoin init --devnet-user --genesisfile=https://genesis.user.kittyhawk.wtf/genesis.car
--sectordir
指定存储目录go-filecoin init --devnet-user --genesisfile=https://genesis.user.kittyhawk.wtf/genesis.car --sectordir=/storage
nohup go-filecoin daemon >> /var/log/filecoin.log 2>&1 &
go-filecoin daemon >> /var/log/filecoin.log 2>&1 &
# go-filecoin config heartbeat.nickname "test"
# go-filecoin config heartbeat.nickname
"test"
go-filecoin config heartbeat.beatTarget "/dns4/backend-stats.kittyhawk.wtf/tcp/8080/ipfs/QmUWmZnpZb6xFryNDeNU7KcJ1Af5oHy7fB9npU67sseEjR"
curl -X POST -F "target=$(go-filecoin address ls)" "http://user.kittyhawk.wtf:9797/tap"
# curl -X POST -F "target=$(go-filecoin address default)" "http://user.kittyhawk.wtf:9797/tap"
Success! Message CID: bafy2bzacec4u7aa63nbtni7c2l5xtpqwnmxtxbhallcf35xsj6s2lcrxayim2
go-filecoin wallet balance `go-filecoin address ls`
go-filecoin address
go-filecoin address default
go-filecoin address lookup
go-filecoin address ls
go-filecoin address new
go-filecoin show block $(go-filecoin chain head | head -n 1)
go-filecoin show block $(go-filecoin chain head | head -n 1) | grep Height | awk '{print $2}'
actor not found
# go-filecoin mining status
Error: query ProvingPeriod method failed: querymethod returned an error: failed to get To actor: actor not found
go-filecoin miner create 100 --gas-price=0.001 --gas-limit=300
go-filecoin mining status
go-filecoin mining start
查看节点ID、查看余额、同步区块高度、矿工角色状态、矿工地址、存储价格
go-filecoin id | jq -r '.["ID"]' && go-filecoin wallet balance $(go-filecoin address ls) && go-filecoin show block $(go-filecoin chain head | head -n 1) | grep Height && go-filecoin mining status | grep Active && cat /root/.filecoin/config.json | jq .'["mining"]'
节点ID和矿工地址
go-filecoin mining address && go-filecoin id | jq .'["ID"]'
go-filecoin miner set-price --gas-price=0.001 --gas-limit=1000 0.000000001 2880
# go-filecoin miner set-price --gas-price=0.001 --gas-limit=1000 0.000000001 2880
Error: couldn't send message: failed to add message to message pool: validation error adding message to pool: message nonce (104) is too much greater than actor nonce (1)
storagePrice
存储价格cat /root/.filecoin/config.json
cat /root/.filecoin/config.json | jq .'["mining"]'
"mining": {
"minerAddress": "t2f",
"autoSealIntervalSeconds": 120,
"storagePrice": "0.000000001"
},
# go-filecoin client list-asks | grep t2tjb3557lel4qrvn63snngkr3duvx7u2kwbghaxa
t2tjb3557lel4qrvn63snngkr3duvx7u2kwbghaxa 000 0.000000001 29847
echo "Hi my name is zZZ" > hello.txt
# go-filecoin client import hello.txt
QmPH17EeXR43Wv22FPz27X4P2Gm7PDhp8SX7zE6tGqDZ61
# go-filecoin client cat QmPH17EeXR43Wv22FPz27X4P2Gm7PDhp8SX7zE6tGqDZ61
Hi my name is zZZ
# go-filecoin client import hello.txt
QmPJMstUFmkYe5gMdiPZWqiHygfH6pHpuGkzoT2TLaGRMw
# go-filecoin client cat QmPJMstUFmkYe5gMdiPZWqiHygfH6pHpuGkzoT2TLaGRMw
hi my name is vVv
go-filecoin client propose-storage-deal
# go-filecoin client propose-storage-deal t2tbxe6abh46gwhnvjpkhjgxktt7ygxaxquw5gpoy QmPJMstUFmkYe5gMdiPZWqiHygfH6pHpuGkzoT2TLaGRMw 000 2880
State: accepted
Message:
DealID: bafy2bzacecikq7bjuleknuoufzvjhrf4ws5udimnx2ffrnonbs5ahkwhsyt4m
# go-filecoin client propose-storage-deal t2tjb3557lel4qrvn63snngkr3duvx7u2kwbghaxa QmcWKhv6tZ3MTtxERz9H5edh5Zjpuybo7mT9YZ2VqgxDw9 000 2880
+State: accepted
Message:
DealID: bafy2bzacecvaakd463zmhipatlqg2z3j3kwkn3kpysjpeqnri6j3dxneiqxnq
# go-filecoin deals list -m
# go-filecoin deals list -c
{
"minerAddress": "t2tjb3557lel4qrvn63snngkr3duvx7u2kwbghaxa",
"pieceCid": {
"/": "QmcWKhv6tZ3MTtxERz9H5edh5Zjpuybo7mT9YZ2VqgxDw9"
},
"proposalCid": {
"/": "bafy2bzacecvaakd463zmhipatlqg2z3j3kwkn3kpysjpeqnri6j3dxneiqxnq"
},
"state": "accepted"
}
Error: response check failed: deal rejected: payments start after deal start interval
# go-filecoin client query-storage-deal bafy2bzacecikq7bjuleknuoufzvjhrf4ws5udimnx2ffrnonbs5ahkwhsyt4m
Status: staged
Message:
Status: complete
# go-filecoin client query-storage-deal bafy2bzacecikq7bjuleknuoufzvjhrf4ws5udimnx2ffrnonbs5ahkwhsyt4m
Status: complete
Message:
265M
# go-filecoin deals list --miner
{
"minerAddress": "t2tbxe6abh46gwhnvjpkhjgxktt7ygxaxquw5gpoy",
"pieceCid": {
"/": "QmPJMstUFmkYe5gMdiPZWqiHygfH6pHpuGkzoT2TLaGRMw"
},
"proposalCid": {
"/": "bafy2bzacecikq7bjuleknuoufzvjhrf4ws5udimnx2ffrnonbs5ahkwhsyt4m"
},
"state": "staged"
}
# go-filecoin mining status
Mining Status
Active: true
Address: t2tjb3557lel4qrvn63snngkr3duvx7u2kwbghaxa
Owner: t1xtc7frd3eyh6bih66eqxmjoafgicvdlz7qsqafa
Collateral: 0
Power: 0 / 35232690470912
Proving Period
Start: 0
End: 0
Proving Set: []
# go-filecoin deals list -c
# go-filecoin deals list -m
{
"minerAddress": "t2tjb3557lel4qrvn63snngkr3duvx7u2kwbghaxa",
"pieceCid": {
"/": "QmcWKhv6tZ3MTtxERz9H5edh5Zjpuybo7mT9YZ2VqgxDw9"
},
"proposalCid": {
"/": "bafy2bzacecvaakd463zmhipatlqg2z3j3kwkn3kpysjpeqnri6j3dxneiqxnq"
},
"state": "staged"
}
Active: false
# go-filecoin mining status
Mining Status
Active: false
# go-filecoin mining stop
Stopped mining
# go-filecoin mining start
Started mining
# go-filecoin mining status
Mining Status
Active: true
# cd /lib/systemd/system
# touch filecoin.service
# vim filecoin.service
# cat filecoin.service
[Unit]
Description=go-filecoin daemon
[Service]
ExecStart=/root/filecoin/go-filecoin daemon
Restart=always
User=root
Group=root
[Install]
WantedBy=multi-user.target
# systemctl enable filecoin.service
# systemctl start filecoin.service
# systemctl status filecoin.service
# journalctl -u filecoin.service
# journalctl -u filecoin.service -f
参考: