IPFS incentive layer Filecoin test ⽹ mining Sessions "mining hard disk / storage mining"

FILecoin mining analytical test ⽹


Currently FILecoin the open test network (or mainly for developers), to participate in the test ⽹ comes in handy is a simple matter. We will now analyze the basic steps and ⼀ out some details. To open test ⽹ of mining, roughly divided into the following steps.


The first step, mining download the software, start the node.

The second step, to discuss ⽶ meters get points FIL.

The third step, mortgage, set the price open mining.



The first step, mining download the software, start the node.


Go here to download a version, https://github.com/FILecoin-project/go-FILecoin/releases/tag/0.2.4


tar -zxvf FILecoin-0.2.4-Linux.tar.gz mkdir -p /tmp/FILecoin-proof-parameters cd FILecoin
./paramcache
export PATH="$(pwd)":$PATH



Of course the best this variable is set to go global environment, the

~/.bash_profile

Add the environment variable amount PATH.


Next is the start node.


If some of the data node start over, you can kill before.

rm -rf ~/.FILecoin


Initialization go-FILecoin software developers the network identity is provided, so that the developer is connected to the network.

go-FILecoin init --devnet-user --genesisFILe=https://genesis.user.kittyhawk.wtf/ge nesis.car


And then start the process go-filecoin

go-filecoin daemon


Will return a peerID start after this step, ⽐ rather strange ⼀ point is that the software does not detect whether the machine has to open a ipfs node. The software itself will automatically open a ipfs own node.


Of course, you can give you a name node, then a visual ⻚ ⾯ displayed.

go-FILecoin config heartbeat.nickname "EngineMiner"
go-FILecoin config heartbeat.beatTarget "/dns4/stats-infra.kittyhawk.wtf/tcp/8080/ ipfs/QmUWmZnpZb6xFryNDeNU7KcJ1Af5oHy7fB9npU67sseEjR"


This website can face the next ⾯ can view this node. HTTPS: //stats.kitt the y- hawk.wtf/


FqbteqUJxqQOPKdEhwsahfXHewW1



The second step, to beg for obtaining point FIL.


Now there is no FIL, discuss ⽶ is required to receive under their dripping pipe just fine. Also comes in handy simple.

go-FILecoin address ls # get automatically from ⼰ own wallet address WALLET_ADDR


Go to this site ⽹ lose START AUTO own purse address, HTTP: //user.kitt the y- hawk.wtf:9797  , get MESSAGE_CID transaction information.

go-FILecoin message wait ${MESSAGE_CID}


Then verify whether Auto has been under discussion ⽶ success.

go-FILecoin wallet balance ${WALLET_ADDR}



The third step, mortgage, set the price open mining.


FILecoin will have three miners:


  • Storage miners

  • Retrieving miners

  • Repair miners (face after ⾯ will launch)



Of course, now mainly focus on storage mineral ⼯ this one.



go-Filecoin软件是开启了同步区块的进程,但是并没有开启一个矿⼯。这个矿工需要去挖Filecoin的区块,就需要提供存储容量量空间的一个承诺到Filecoin的DSN⽹络。如果区块挖到了呢,就会给到相应的奖励。


一个矿工需要给出存储空间的承诺之外,还要给出相应的抵押,当然抵押就涉及到给Filecoin的区块链上发送消息,也就是说会有⼀些链上的操作,只要有操作就会有成本,FILecoin采⽤了了和以太坊类似的gas机制,这里可以设置的有两个点,一个是gas的价格,这⾥是以Filecoin为标的的,另外是消耗gas的上限。


⽐如,可以用下⾯面这行命令,来创建一个矿工,使⽤100FIL作为抵押,使⽤用默认的扇区大小(256M),gas 的价格为0.001FIL,使用的gas上限为1000gas。

go-FILecoin miner create 100 100 --gas-price=0.001 --gas-limit=300 --peerid `go-fi lecoin id | jq -r '.ID'` # this may take a minute


然后开启矿工挖矿。

go-FILecoin mining start



*⾼级进阶*

给存储空间设置价格


⾸先要明白,矿工的机器相当于一个客户端,⾃己有存储空间,然后设置一个价格发送到链上,这样一个订单信息 是需要如下基本信息的。


  • 存储空间的价格。单位是FIL/byte/block

  • blocks的⾼度范围,这个订单信息是有效的

  • 链上的矿工每挖到这个消息,所需要消耗的gas的价格

  • 为这个订单信息,最多消耗的gas上限


具体剖析下这个订单是如何工作的,存储空间的价格,按理理来说,只要FIL/byte就够了了,为何还有一个block 的概念。其实这非常好理解,区块高度是一个时间的概念,设置一个价格,这个价格是在一段时间内的价格,过了这段时间后,价格⾃自然就不算数了。深层次来理解,订单是在链上进⾏撮合交易的,不可能所有订单请求都在每个区块里进⾏撮合,这就需要所有矿工为⾃己的订单请求⽀支付gas费⽤用,那这⾥面就会有⼀个值得操作的空间,如果定价便便宜,就越能被撮合交易易,但是由于价格低,⽽而导致收益低,但⼜有一个区块奖励。如果定价太⾼高,就很难被撮合交易,同时还要⽀付gas费用,也是划不来的。


然而,这个价值设置并不是⾃动的,这里面存在⼀些可操作的空间。


举例,我们设置价格为0.000000001 FIL/byte/block,对2880个blocks有效,一个message的价格为

0.001FIL/unit,消耗上限为1000gas。

go-FILecoin miner set-price --gas-price=0.001 --gas-limit=1000 0.000000001 2880


其会返回如下信息:

Set price for miner t26ro7zvtlsswdtus3fpp6467cvisb6kpwhnk6d3y to 0.000000001. Published ask, cid: zDPWYqFD6tZMKe9TQQYVFLTXqvFLYyfghEd8xTXc9hi5iakp3nBF.
Ask confirmed on chain in block: zDPWYqFCzAQCXBuuqmYNGbGM6HkpD8Zyp9rMAh76o11H4ZY7n b4p.


上⾯这个会在很短的时间内消耗掉我0.1FIL。道理理是⾮常简单的,上面是⽤100个FIL作为抵押,然后100个扇区抵押到DSN市场,每一个扇区消耗掉的gas价格为0.001,算下来就是0.1FIL。


从头到尾,⼀直有⼀个疑问,IPFS的数据到底要存在哪里,其实非常简单。设置一下就可以了。

go-FILecoin config sectorbase.rootdir /data/


⽐如我就直接讲所有磁盘用LVM技术挂在 /Data ⽬录下面,然后数据就都存在这下面就可以。


挖了半天,假如还是没挖到⼀点FIL,算了,停下,加大抵押和空间来试下。效果会有所不同。不过挖到的FIL属于测试网的虚拟通证,真正的FIL只有主网上线才会释放。


go-FILecoin mining stop
rm -rf ~/.FILecoin
go-FILecoin init --devnet-user --genesisFILe=https://genesis.user.kittyhawk.wtf/ge
nesis.car --repodir=/data/.FILecoin
go-FILecoin daemon --repodir=/data/.FILecoin
go-FILecoin address ls --repodir=/data/.FILecoin
# 去讨下⽶米
go-FILecoin message wait zDPWYqFCr17QWsfh9XgupovN8s7jW8sssb7j89sD9SryFAnwQKds --re podir=/data/.FILecoin
go-FILecoin miner create 900 900 --gas-price=0.001 --gas-limit=3000 --peerid `go-f
ilecoin id | jq -r '.ID'`	# this may take a minute
go-FILecoin mining start




简单总结:目前Filecoin测试网有点难挖,专业服务器上CPU这些跑满了。大型测试网还要等(但很快)。有点担心它的商用场景是否会受到限制,不然门槛太高没人愿意参与挖。另外官方很“鸡贼”(其实正常),讨米的时候应该是判断了IP?mac地址?(但按理不会啊),FIL用完,一千个也很多的,要是没有了只能换个V'P'N再去试试。


Guess you like

Origin blog.51cto.com/14463143/2428820