Skip to content

Commit

Permalink
Merge #3769
Browse files Browse the repository at this point in the history
3769: fix: disable ckb-miner notify mode by default r=zhangsoledad a=zhangsoledad

<!--
Thank you for contributing to nervosnetwork/ckb!

If you haven't already, please read [CONTRIBUTING](https://github.com/nervosnetwork/ckb/blob/develop/CONTRIBUTING.md) document.

If you're unsure about anything, just ask; somebody should be along to answer within a day or two.

PR Title Format:
1. module [, module2, module3]: what's changed
2. *: what's changed
-->

### What problem does this PR solve?

Previously, ckb-miner notify mode was turned on by default, and there were some compatibility problems, such as the default block_assembler was not configured accordingly, so it is better to turn off ckb-miner notify mode by default, and add a prompt when ckb-miner starts in notify mode





### Check List <!--REMOVE the items that are not applicable-->

Tests <!-- At least one of them must be included. -->

- Unit test
- Integration test


### Release note <!-- Choose from None, Title Only and Note. Bugfixes or new features need a release note. -->

```release-note
Title Only: Include only the PR title in the release note.
```



Co-authored-by: zhangsoledad <787953403@qq.com>
  • Loading branch information
bors[bot] and zhangsoledad authored Dec 21, 2022
2 parents 21d9ddd + b590796 commit 2d6d07c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions miner/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,20 @@ impl Client {
let client = self.clone();
if let Some(addr) = self.config.listen {
ckb_logger::info!("listen notify mode : {}", addr);
ckb_logger::info!(
r#"
Please note that ckb-miner runs in notify mode,
and you need to configure the corresponding information in the block assembler of the ckb,
for example
[block_assembler]
...
notify = ["http://{}"]
Otherwise ckb-miner does not work properly and will behave as it stopped committing new valid blocks after a while
"#,
addr
);
self.handle.spawn(async move {
client.listen_block_template_notify(addr, stop_rx).await;
});
Expand Down
2 changes: 1 addition & 1 deletion resource/ckb-miner.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ block_on_submit = true
poll_interval = 1000

# enable listen notify mode
listen = "127.0.0.1:8888"
# listen = "127.0.0.1:8888"

[[miner.workers]]
worker_type = "EaglesongSimple" # {{
Expand Down

0 comments on commit 2d6d07c

Please sign in to comment.