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

feat: add an option to control how many blocks the miner has to mine #1992

Merged
merged 1 commit into from
Apr 1, 2020

Conversation

yangby-cryptape
Copy link
Collaborator

Usage

ckb miner -C . --limit 10 # Exit after 10 nonces found
ckb miner -C . -l 5       # Exit after 5 nonces found
ckb miner -C .            # Run forever
ckb miner -C . --limit 0  # Run forever, too

Ref:

@yangby-cryptape yangby-cryptape requested review from a team and quake March 30, 2020 07:55
@doitian
Copy link
Member

doitian commented Apr 1, 2020

Although it does not matter in this PR, I just want to mention that Option is more explicit than limit 0

@yangby-cryptape
Copy link
Collaborator Author

Although it does not matter in this PR, I just want to mention that Option is more explicit than limit 0

Yes, I used Option<u128> at the begining, too.
Since the direct input which meant forever / maximum from users is 0, I changed it to keep it same in whole program just before I pushed request.

@yangby-cryptape
Copy link
Collaborator Author

bors r=quake,doitian

@nervos-bot nervos-bot bot added the s:ready-to-merge Status: Waiting to be merged. label Apr 1, 2020
bors bot added a commit that referenced this pull request Apr 1, 2020
1992: feat: add an option to control how many blocks the miner has to mine r=quake,doitian a=yangby-cryptape

### Usage

```bash
ckb miner -C . --limit 10 # Exit after 10 nonces found
ckb miner -C . -l 5       # Exit after 5 nonces found
ckb miner -C .            # Run forever
ckb miner -C . --limit 0  # Run forever, too
```

Ref:
- [CKB-Cli Issue-256: Mining with CKB-Cli (for dev chain)](nervosnetwork/ckb-cli#259)

Co-authored-by: Boyu Yang <yangby@cryptape.com>
@bors
Copy link
Contributor

bors bot commented Apr 1, 2020

Build failed

@yangby-cryptape
Copy link
Collaborator Author

bors retry

@bors
Copy link
Contributor

bors bot commented Apr 1, 2020

Build succeeded

  • continuous-integration/travis-ci/push

@bors bors bot merged commit c449f98 into nervosnetwork:develop Apr 1, 2020
@yangby-cryptape yangby-cryptape deleted the pr/controllable-miner branch July 9, 2020 00:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s:ready-to-merge Status: Waiting to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants