Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the method of Bytom mining pool access protocol?

2025-02-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "what is the method of Bytom mining pool access protocol". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what is the method of Bytom mining pool access protocol".

Firmware upgrade of mine machine configuration

Both should be brushed. It doesn't matter in order.

Update_1000.tar.gz takes a long time to upgrade. Do not lose power during the upgrade.

Configure nod

During the test, you can consider switching to the testnet branch to reduce the difficulty so that cpu mining can also produce blocks,. / bytomd init-- chain_id testnet or. / bytomd init-- chain_id solonet

During init/node initialization / startup, you can specify the data directory with-r "your/directory". If the directory does not exist, it will be created automatically.

Process flow

1. The initialization node first sets up an account and address, otherwise it will dig up an empty address.

2. Mine address can be customized, including non-local wallet address.

3 、 API doc

4. Getwork of the pool-oriented node

The block_header obtained by get-work needs to be parsed for dynamic compression and variable length.

If you use golang, you can use the function UnmarshalText in block_header.go in "github.com/bytom/protocol/bc/types".

If you use other languages, refer to the functions UnmarshalText, readFrom, ReadVarintXXX in block.go in "github.com/bytom/protocol/bc/types". ReadVarintXXX needs to refer to the go function binary.ReadUvarint

5. Send it after parsing

Communication format reference https://github.com/Bytom/B3-Mimic/blob/master/docs/STRATUM-BTM.md-received tasks are sent actively by login and mining pool, not getjob, only through login and pool active distribution-both are submitted by submit

Logic reference https://github.com/Bytom/B3-Mimic/blob/master/main.go-Version, Height, Timestamp, Bits to turn to small end-about target + btc.com shared a piece of antpool code ~, and said that target is used to relax the difficulty of the corresponding difficulty of bits, so that the mining machine can be submitted in a unit time, and then the mine pool verifies ~

Var Diff1 = StringToBig ("0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF") func GetTargetHex (diff int64) string {padded: = make ([] byte, 32) diffBuff: = new (big.Int) .Div (Diff1, big.NewInt (diff)). Bytes () copy (padded32-len (diffBuff):], diffBuff) buff: = padded [0:4] targetHex: = hex.EncodeToString (Reverse (buff)) return targetHex}

The targethex issued by the mining pool is worth the standard difficulty (0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF) / one difficulty.

This value, called the difficulty of mining pool, is generally dynamically adjusted to ensure that the frequency of share submission by the mining machine is stable. For example, if you submit three times in one minute, you will increase this value and slow down this value.

Target is hexadecimal difficulty, 1, 1024, … .. Wait, wait,

6. After submission, the mining pool needs to be verified.

If header_hash uses golang, you can use the Hash () of types.BlockHeader {} in "github.com/bytom/protocol/bc/types" to use other languages. Refer to https://github.com/Bytom/B3-Mimic/blob/master/docs/blhr_hash_V3.go.

Then we have to start using tensority to calculate hash results. Unfortunately, go version, cpp_openblas version and cpp_simd version can not achieve the desired verification results. If you want to make an available mining pool, it is necessary to use gpu at present, you can consider n card 1050 or Ali CVM P4.

Cpp's tensority logic is here and points out how to optimize for gpu, so that matrix multiplication can run into 2.5 ms, and the whole tensority is about 6 ms.

Init matlist has overhead. In fact, seed can only be changed once with 256chunks. If you encounter a new seed, you may need 100ms for each gpu tensority, but if you do cache, init matlist can ignore it. It can be considered that each tensority only needs no more than 6 ms.

You can use golang to cgo the c code, refer to https://github.com/Bytom/bytom/blob/dev-ts-simd/mining/tensority/algorithm.go

After changing the gpu version, you can refer to this to call

7. Use the submit-work API to submit after the verification is passed.

The submitted result is also BlockHeader type's.

If you use golang, you can use the function MmarshalText in block_header.go in "github.com/bytom/protocol/bc/types".

If you use other languages, refer to the functions MarshalText, WriteTo, WriteVarintXXX in block.go in "github.com/bytom/protocol/bc/types". WriteVarintXXX needs to refer to the go function binary.PutUvarint

8 、 retarget

See above, dynamically adjust the mining machine to submit three times per minute

9. Income calculation

Slightly

Batch transfer

The main network address begins with bm, the length of ordinary address is 42, and the signature is 62.

Each time a coin is issued, a new change address is generated.

Bytom input has a limit of 21.

Thank you for your reading, the above is the content of "what is the method of Bytom Mine Pool access Protocol". After the study of this article, I believe you have a deeper understanding of what the method of Bytom Mine Pool access Protocol is, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report