-
Notifications
You must be signed in to change notification settings - Fork 146
[WIP] Miner support MQTT protocol #357
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
Open
laodouya
wants to merge
16
commits into
develop
Choose a base branch
from
feature/miner_mqtt
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
bb0466e
Add paho client, add broker config
eead3a7
Add a queue struct
a54f249
Add broker config.
ad2b6f2
Start mqtt client while miner started.
c25f630
Move mqtt client inside dbms.
a4cb2b8
Add write/newest api response.
58b2d49
Add log for mqtt client.
594a3ae
Add mqtt replay api.
a565d69
Refactor mqtt fetch block logic.
6976572
Fix mqtt miner did not use config.
e091f36
Upgrade payload struct, add type of value.
7608986
Read MQTT IoT client private key from config. Refuse request if not l…
c3bd201
Fix MQTT repeat send newest block
ee1f84c
Fix MQTT type convert bug.
fc33dce
Merge branch 'develop' into feature/miner_mqtt
ac8847d
Fix dbms shutdown bug while mqtt client is nil.
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1020,6 +1020,10 @@ func (c *Chain) AddResponse(resp *types.SignedResponseHeader) (err error) { | |
| return c.ai.addResponse(c.rt.getHeightFromTime(resp.GetRequestTimestamp()), resp) | ||
| } | ||
|
|
||
| func (c *Chain) GetPeerLeaderID() proto.NodeID { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [golint] reported by reviewdog 🐶 |
||
| return c.rt.peers.Leader | ||
| } | ||
|
|
||
| func (c *Chain) register(ack *types.SignedAckHeader) (err error) { | ||
| return c.ai.register(c.rt.getHeightFromTime(ack.GetRequestTimestamp()), ack) | ||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| # This affects access control for clients with no username. | ||
| #topic read $SYS/# | ||
|
|
||
| # This only affects clients with username "roger". | ||
| #user roger | ||
| #topic foo/bar | ||
| user 000005aa62048f85da4ae9698ed59c14ec0d48a88a07c15a32265634e7e64ade | ||
| topic readwrite /cql/miner/000005aa62048f85da4ae9698ed59c14ec0d48a88a07c15a32265634e7e64ade/# | ||
| topic read /cql/client/# | ||
|
|
||
| user 000005f4f22c06f76c43c4f48d5a7ec1309cc94030cbf9ebae814172884ac8b5 | ||
| topic readwrite /cql/miner/000005f4f22c06f76c43c4f48d5a7ec1309cc94030cbf9ebae814172884ac8b5/# | ||
| topic read /cql/client/# | ||
|
|
||
| user 000003f49592f83d0473bddb70d543f1096b4ffed5e5f942a3117e256b7052b8 | ||
| topic readwrite /cql/miner/000003f49592f83d0473bddb70d543f1096b4ffed5e5f942a3117e256b7052b8/# | ||
| topic read /cql/client/# | ||
|
|
||
| user client_test | ||
| topic readwrite /cql/client/client_test/# | ||
| topic readwrite /cql/client/client_test2/# | ||
| topic read /cql/miner/# | ||
|
|
||
| user client_test2 | ||
| topic readwrite /cql/client/client_test2/# | ||
| topic read /cql/miner/# | ||
|
|
||
|
|
||
| # This affects all clients. | ||
| # pattern write $SYS/broker/connection/%c/state | ||
|
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golint] reported by reviewdog 🐶
exported type MQTTBrokerInfo should have comment or be unexported