Chapter 6: how to deploy multi node cluster and ore pool on a single machine


Welcome to Chapter 6. After the introduction of Chapter 5: search market and search miner in the previous chapter, “full analysis of filecoin source warehouse”, we should have a deeper understanding of the current filecoin search market from the perspective of positioning function, design principle and engineering operation.

In this chapter, we will show you how toBuilding multiple nodes on one machineScheme andProduct design of future mineral poolSome ideas.

If the learning progress is OK and the practical effect is in line with the expectation, we should share the scheme of multi machine (different configurations, different specifications, different regions) and multi node deployment with you soon.

I. deployment requirements of multiple nodes

1. Single machine can use different role functions

In chapter three, chapter four and chapter five, we simulate three roles respectively: storage provider (storage miner), storage demander (storage user) and retrieval user. Xiaobian uses two different machines to experiment. In fact, all tests can be completed by single machine.

2. For machines with high configuration, resource utilization can be increased

Although the node client has strict requirements on machine performance and configuration at present, for some machines and servers that are not always in full load state and have higher performance, it is still possible to increase the overall resource utilization by deploying a single machine multi node scheme.

3. Reuse public IP

Compared with foreign countries, public IP is a real scarce resource. At present, there is no hope that IPv6 will be popularized in a short time

The mutiaddress required by libp2p can be multiplexed through the configuration port

4. Research and development of composite products

In the future, with the continuous maturity of the filecoin project and the continuous evolution of market demand, a series of composite products and tool products will be born in addition to the miner. In order to expand the service capacity and boundary, a unified node management and control scheme, CDN like scheme specially designed for the retrieval Market, ore pool scheme for the storage market, etc. are required.

These are more or less inseparable from the deployment of multi node operation and maintenance work. This paper introduces a scheme of directly deploying and managing multiple nodes on a single machine.

II. Create a new node warehouse

Assuming that the latest version of go filecoin client has been compiled and installed, please refer to Chapter 1: building a filecoin test node

After that, by specifying a different warehouse Path--repodir, to create a new node 2:

export FCRD=$HOME/.filecoin2

go-filecoin init --genesisfile= --repodir=$FCRD

After success, a. Filecoin2 with the same structure as the previous default initialization folder. Filecoin will be generated, as shown in the figure:

Chapter 6: how to deploy multi node cluster and ore pool on a single machine

III. modify new node configuration

vim .filecoin2/config.json

Modify the default value and reset the listening ports of api.address and swarm.address of new node 2:

    "api": {
        "address": "/ip4/"
    "swarm": {
        "address": "/ip4/"

IV. node interconnection

On this machine, start the original node 1 and the new node 2 respectively:

go-filecoin daemon

go-filecoin daemon --repodir=$FCRD

After starting the daemon, we can also compare the configuration information of stand-alone node 1 and node 2. As shown below, multiaddress corresponds to peerid one by one, and has been generated according to different port configurations.

Chapter 6: how to deploy multi node cluster and ore pool on a single machine

We record the multiaddress of the original node in the temporary variable node1? Addr,

export NODE1_ADDR=$your_node1_multiaddress

adoptgo-filecoin swarm connect $NODE1_ADDR --repodir=$FCRDTo establish a P2P connection between the new node 2 and the original node 1.

After success and passgo-filecoin swarm peers --repodir=$FCRDReview connection status:

Chapter 6: how to deploy multi node cluster and ore pool on a single machine

As shown in the figure, we found the multiaddress of the original node 1 in the peer cluster of the new node 2.

In this way, a preliminary single machine dual node cluster is deployed, and so on. You can continue to deploy in batches until the machine resources run at full capacity.

After that, we can operate multiple nodes on a single machine and set different roles for the test process described in the previous chapters. Conditional friends can also write the configuration logic described in these chapters into shell scripts or add program control to realize automation.

V. design idea of filecoin ore pool

5.1 concept of ore Basin

In a certain sense, ore pool is evolved with time and market demand, and it is more inclined to a definition of product. It originated in bitcoin.

Under the bitcoin system, the whole network produces one block every 10 minutes on average. Each block contains 50 bitcoins (now 12.5, the reward is halved every four years or so). However, a block can only be dug by one lucky person, who has all the rewards directly, while others have no income. The probability of digging is directly proportional to the calculation power of the equipment invested by the miners.

It is doomed that if the number of bitcoin mining participants is large and dispersed to a certain extent, the probability of bitcoin mining will be infinitely close to zero, similar to winning the lottery.

At this time, if the retail investors want to participate and have limited resources, they can only invest in one miner to mine. According to the probability, it will take 5-10 years to mine a block. This makes bitcoin mining in an awkward situation, makes the ordinary people almost have no chance to participate, and is not conducive to the development of bitcoin.

So the solution isGather people’s strength and share the profits equallyThis is also the core of mineral pool products. For example:

Suppose that one million people participate in bitcoin mining, with 400p computing power of the whole network, 90% of the miners are below 1p (1000t). If a 1t miner is put into operation, it will account for 1.400000 of the computing power of the whole network. Theoretically, every 400000 10 minutes can dig a block, that is, it will take 7.6 years to dig a block, and then get 50 bitcoins (now 12.5) at a time. So, if I find nine more miners with 1t calculative mining machine, and reach an agreement, we have 10 people in total, and any one of them dig the block, and divide them equally according to the proportion of each person’s calculative force, then we are a whole, with a total of 10t calculative force, then we can dig a block in an average of 0.76 years, and then we have 5 bitcoins in 0.76 years How about organizing 100, 1000, 10000 or even 100000 people? If it’s 100000 people, I can dig a block in 40 minutes on average. As a member of the team, my income will be stable and my participation will be significantly improved.

5.2 significance of ore pool

  • It reduces the difficulty of mining virtual digital currency such as bitcoin, reduces the threshold of mining, and truly realizes the bitcoin mining concept that everyone can participate in.
  • It improves the degree of industrialization and promotes more stable blockchain services.
  • A more reasonable business model has improved the product form of virtual digital currency industry.

5.3 is it possible that there are ore pool products in filecoin?

First of all, there are three key parameters on the devnetworkstate monitoring panel that we need to understand:

  • Provenstorage: stores the amount of storage that the miner has submitted to the post and verified by the system.

Chapter 6: how to deploy multi node cluster and ore pool on a single machine

  • Storagepower: indicates the storage efficiency, i.e. the possibility of winning the next block mining.

Chapter 6: how to deploy multi node cluster and ore pool on a single machine

  • %Proportion of blocks mined in the whole network

Chapter 6: how to deploy multi node cluster and ore pool on a single machine

Secondly, the integrity of the design and implementation of the campaign algorithm:

  • Campaign algorithm: use the ballot to participate in the campaign and obtain the conditions for the election.

Chapter 6: how to deploy multi node cluster and ore pool on a single machine

According to the design of filecoin’s white paper, a good campaign algorithm should meet at least the following characteristics:

Fairness: each participant has only one experiment in each election, the signature is certain, and T and rand (T) are fixed. The random value rand (T) is unknown before time t. Therefore, the calculation range of each ticket is relatively fair.

Confidentiality: that is, the attacker does not have mi (collateral information that has been mortgaged in the network at present), so it cannot generate effective ticket and signed key.

Open verifiable: the verifier’s own validity can be verified by giving the calculation range, time t and MI.

In fact, the design idea of the white paper can be attributed to the following formula: the value field of the signed ticket, at the same time, the signed ticket needs to be hashed into a series of long digit codes to prevent being brutally cracked(similar to the hashcash used in bitcoin, try to satisfy the condition that the prefix n bits are all 0)AndThe storage efficiency of the nodes in the red box ratioThe efficiency is a relatively large decimal value, which needs to be converted into binary code to match with the signature ticket after hashcash for accurate judgment,L is strongly related to the difficulty of the whole network, the more leading zeros are required, the more difficult it is to represent L.

Chapter 6: how to deploy multi node cluster and ore pool on a single machine

Then, Xiaobian checked the current campaign algorithm code implementation of the test network:

Chapter 6: how to deploy multi node cluster and ore pool on a single machine

At present, the leader election only compares the storage efficiency with the value domain of ticket. The strategy of network wide difficulty L has not been implemented yet

Nevertheless, taken together:Storage efficiency is the key, and filecoin is likely to give birth to ore drawing pool products.The reasons are as follows.

  • In the same time, as long as the speed of storage increment provided by a miner node is faster than that of the whole network storage increment, the storagepower of the node will be significantly improved.
  • The choice of storage order is not matched in the test network, and it is the user who takes the initiative to choose, so the user’s choice tendency largely depends on the miner’s QoS and quotation.Miners with higher storage efficiency have stronger trust in providing QoS, and get more block rewards. They can provide services with lower quotations, which will lead to more orders flowing to miners with higher storage efficiency.The snowball is bigger and bigger
  • The earlier to participate, the longer to store the data, the more advantageous the miners’ day will be. When the whole network storage reaches a large base, the new miners will not be able to obtain a large block possibility in a short time. Like bitcoin system, node miners will form Matthew effect.

5.4 design idea of filecoin ore pool

Chapter 6: how to deploy multi node cluster and ore pool on a single machine

As shown in the figure, a rough product architecture of filecoin ore pool is designed. Complex systems are all iterated by basic modules,Welcome to do more in-depth exchanges and discussions with interested friends.

We will also introduce the core technology of filecoin, EC consensus, replication proof, space-time proof, and current proof test game in Chapter 7: how to participate in the test of replication proof game in the next chapter.



Review of previous series:

Chapter 1: build a filecoin test node
Chapter 2: how to create account wallet and obtain fil mock token
Chapter 3 (I): configuration operation of storage provider (miner)

Chapter 3 (2): configuration operation of storage provider (miner)

Chapter 4: configuration operation of storage demander (user)

Chapter 5: searching market and miners

Sponsored brands in this chapter:

Chapter 6: how to deploy multi node cluster and ore pool on a single machine

Jiangxi zhengrudder Network Technology Co., Ltd. is a professional emerging technology company of big data and distributed storage. The team of the company has gathered the top experts with rich experience in various fields such as block chain, artificial intelligence, big data and financial investment at home and abroad, including 5 professors and doctoral teams, 10 masters and 18 core technical backbones graduated from the first-class universities at home and abroad, such as Arizona University, Hong Kong University, Zhongshan University, Huazhong University of science and technology, etc., with 12 patent technologies; the company and China Universities and blockchain laboratories at home and abroad have established strategic cooperation relations, which has brought the most cutting-edge scientific research achievements, personnel training and transportation to zhengdanger technology company. The company focuses on IPFs application research and mine project construction, providing the most comprehensive and professional support for IPFs ecology, including miner, mine, trusteeship, data, etc., and providing multi-directional and multi angle services for participants at different levels.

Thanks to Jiangxi zhengdaozhe Network Technology Co., Ltd. ( SOHOSupport for original content.

Contact author:

I have limited experience in this field, but I have some shortcomings. Please correct me and discuss more. I can do it in privateWeChat public address: jialesoho, or add meWechat: daijiale6239, if you find it helpful, you canHelp Click to promoteandReward and supportOh, thank you so much!

Chapter 6: how to deploy multi node cluster and ore pool on a single machine

(identify 2D code in the picture, pay attention to Jiale SOHO WeChat public number)