【go-filecoin】V0.1.4 发布 / 命令更新

go-filecoin https://github.com/filecoin-project/go-filecoin/releases/tag/0.1.4
打了个 Latest release 的tag,发布了0.1.4版本,现在对这个版本命令做一个更新说明。
主要变动:
所有命令均支持–enc=json来控制输出格式为json
原来的--price改成了--gas-price,原来的--limit 改成了--gas-limit
go-filecoin addressgo-filecoin wallet子指令分离出来
go-filecoin chain head 默认不再采用json 使用 go-filecoin chain head | head -n 1取出一个。
申请代币间隔调整为1小时
单个文件上传限制为256M,不满256M按照256M封存扇区,超过256M按照前256M数据封存扇区。
封存扇区的3种状态:accepted 收到订单;staged 封存过程中;posted 已经成功封存。

1.查看钱包/余额

查看默认钱包 go-filecoin address default
查看钱包列表 go-filecoin address ls
【go-filecoin】V0.1.4 发布 / 命令更新

查看余额 go-filecoin wallet balance t1tpd7mzujaumbuckibsqszx5kv44lh7gxscyiwaq
查看余额 go-filecoin wallet balance $(go-filecoin address default)
【go-filecoin】V0.1.4 发布 / 命令更新

导出** go-filecoin wallet export $(go-filecoin address default) --enc=json >> key
导入** go-filecoin wallet import key

【go-filecoin】V0.1.4 发布 / 命令更新
这里被你们知道**也没关系,反正是测试网络,哈哈,到了正式网络后,请一定要保存好这**,这可是支付密码。

2.矿工提供空间

创建抵押区 go-filecoin miner create 200 800 --gas-price=0 --gas-limit=1000 --peerid $(go-filecoin id | jq -r '.ID')
创建定价go-filecoin miner set-price --from=$(go-filecoin address default) --miner=t2a42kampeon6nxdg263hnu3oocvn4mvg5644bpkq --gas-price=0 --gas-limit=1000 0.0000000001 86400
开启挖矿 go-filecoin mining start

3.用户储存数据

上传文件 go-filecoin client import file.mp4
储存到filecoin go-filecoin client propose-storage-deal t2lhkobdsduq2garvytgdwko2tkzi5s3eujwhnvwy $cid 000 72000

提供一个把文件夹里的内容上传上去的脚本

#!/bin/bash
s=/media/vod/720P/
for pa in $(ls $s);do
	echo $pa |tee -a log
	cid=`go-filecoin client import $s$pa`
	echo $cid |tee -a log
	msg=`go-filecoin client propose-storage-deal t2lhkobdsduq2garvytgdwko2tkzi5s3eujwhnvwy $cid 000 72000`
	echo $msg|grep DealID |tee -a log 
done

4.初始化

初始化文件夹 go-filecoin init --devnet-user --genesisfile=https://genesis.user.kittyhawk.wtf/genesis.car
启动进程 nohup go-filecoin >>filecoin.log&
设置昵称 go-filecoin config heartbeat.nickname "BillImba"
设置心跳 go-filecoin config heartbeat.beatTarget "/dns4/stats-infra.kittyhawk.wtf/tcp/8080/ipfs/QmUWmZnpZb6xFryNDeNU7KcJ1Af5oHy7fB9npU67sseEjR"

5.测试脚本(刷单)

…待续