Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

specification on how to integrate ETHASH into MVS PoW #340

Open
betachen opened this issue Jan 5, 2019 · 2 comments
Open

specification on how to integrate ETHASH into MVS PoW #340

betachen opened this issue Jan 5, 2019 · 2 comments

Comments

@betachen
Copy link
Member

betachen commented Jan 5, 2019

####挖矿介绍####
1.挖矿输入与输出:
输入块信息(块高度周期sha3值,块的sha3运算值,boundray值),用ethash算法,获取一个随机数,一个mixhash写入块头。

  1. ethash算法大体过程

Ethash算法流程如下(照搬以太坊未做任何改动,可参考eth维基):
(1)、根据区块高度计算出一个seed,每30000个块调整一次seed。
(2)、从seed生成出一个16MB的伪随机数据缓存,一般给非全节点钱包使用。
(3)、从伪随机数据缓存,生成一个DAG数据集,这个文件随着块高线性增长,每30000个块调整一次。一般全节点或者旷工节点使用DAG数据集。

3.类与功能函数的介绍
(1)、 HeaderAux
static h256 seedHash(libbitcoin::chain::header& _bi)
//计算块高度周期sha3值
static h256 hashHead(libbitcoin::chain::header& _bi)
//块的sha3运算值
static h256 boundary(libbitcoin::chain::header& _bi)
//计算boundray值
static u256 calculateDifficulty(libbitcoin::chain::header& _bi, libbitcoin::chain::header& _parent)
//难度调整
(2)、 MinerAux
static LightType get_light(h256& _seedHash)
//获取canche
static FullType get_full(h256& _seedHash)
//获取dataset
static bool verifySeal(chain::header& header,chain::header& _parent)
//验证挖矿结果
static bool search(chain::header& header, std::function<bool (void)> is_exit)
//内置solo挖矿

(3)、miner.cpp介绍
get_work(std::string& seed_hash, std::string& header_hash, std::string& boundary)
//外部挖矿rpc请求工作参数
put_result(const std::string& nonce, const std::string& mix_hash, const std::string& header_hash)
//外部挖矿rpc提交并存块
work(const wallet::payment_address pay_address)
//内置solo挖矿

(4)、 块验证方法在valiate_block_impl.cpp

(5)、挖矿与分叉合并结果全部在store_block里给出返回码,错误码查询block/error.hpp

(6)、 矿池搭建在跳板机上的c14机器,钱包账户名与密码写在~/etp_pool/config.json。 矿池程序github链接https://github.com/ViewBTC/mgpoll.git。 这个版本简单,UU那边有优化的版本。

@betachen betachen changed the title specify how to combine ETHASH into MVS PoW specification on how to combine ETHASH into MVS PoW Jan 16, 2019
@betachen betachen changed the title specification on how to combine ETHASH into MVS PoW specification on how to integrate ETHASH into MVS PoW Jan 16, 2019
@Teleloco
Copy link

Teleloco commented Jun 6, 2022

Hi, can u give an example config.json for MVS PoW please? And tell me, wich client is used. mvsd/mvs-cli?

@canguruhh
Copy link
Member

for pow solo mining you can read the docs here. not sure what config.json file you are referring to. after setting the pow miner account you can also use other mining tools by setting the url to the mvsd rpc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants