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

Mining Module Modification #20

Closed
SherLzp opened this issue Oct 16, 2020 · 4 comments
Closed

Mining Module Modification #20

SherLzp opened this issue Oct 16, 2020 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@SherLzp
Copy link
Collaborator

SherLzp commented Oct 16, 2020

Is your feature request related to a problem? Please describe.
In order to allow users to operate their own mining process more fine-grained and obtain more comprehensive mining-related information. We are considering the development of the following features.
Priority:

currently the block info API only returns some info of transaction, doesn't contain info of consensus.

Describe the solution you'd like
Right now, because of the missing APIs of stacks-blockchain stacks-network/stacks-core#1969 (comment). Left time is not enough for us to implement these features which are proposed in stacks-network/stacks-core#1969 (comment) before Mining Competition. In order to allow users to use the Mining Bot we constructed before the Mining Competition, we choose to modify stacks-node(https://github.com/blockstack/stacks-blockchain/tree/master/testnet/stacks-node) first to implement mining features of stacks-blockchain.

Describe alternatives you've considered

Additional context
Later, based on user feedback and stacks-blockchian development progress, we will follow up and modify Mining Module as a separate program. #18

@SherLzp SherLzp added the enhancement New feature or request label Oct 16, 2020
@gzelda
Copy link
Member

gzelda commented Oct 19, 2020

API Method Design Refer to this issue stacks-network/stacks-core#970

@SherLzp
Copy link
Collaborator Author

SherLzp commented Oct 19, 2020

In order to implement the first feature:
Adjust the amount of bitcoin burned in each PoB cycle in stacks-blockchain dynamically
We run the command:

$ stacks-node start --config=.\conf\testnet-miner-conf.toml

In order to find how it works. We follow the codebase of stacks-blockchain/testnet/stacks-node. At main.rs, starts the testnet runloop which will read config and set up neon node. Then it will call neon.rs which will check if the node is the miner or not and then initialize node. Then it will call neon_node.rs which will use the configuration to create a InitializedNeonNode. Then it will call new method and in this method #L688 it will process the information received by the node and construct mining transactions. Then we can see the detail of how to construct the mining transaction in #L558. In this method, the parameter related to the number of bitcoins(burn_fee_cap) burned is passed in.
So, by follow the source code. Our solution is to add a variable (burn_fee) to this method, and update the incoming burn amount by continuously reading this variable. We will add the variable(burn_fee) at config.rs and write a new rust file to implement the rpc method which will modify the value of burn_fee.

@gzelda gzelda changed the title Mining Module Modification for Mining Competition Mining Module Modification Dec 9, 2020
@trancetr
Copy link

trancetr commented Dec 22, 2020

I get this problem 1.0.2 last release

image
when hit download button
image
Console picture

image

@SherLzp
Copy link
Collaborator Author

SherLzp commented Jan 7, 2021

fixed by #113

@SherLzp SherLzp closed this as completed Jan 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants