-
Notifications
You must be signed in to change notification settings - Fork 63
Support quorum tessera blockchain node #310
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
Merged
peterbroadhurst
merged 22 commits into
hyperledger:main
from
partior-3p:feature/set516_support_quorum_tessera
Jul 11, 2024
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
6f4f577
Add environment vars cli flag to stack init
rodion-lim-partior 6c69867
Update concatenate environment variable function name
rodion-lim-partior 4bc7744
Add quorum blockchain node provider
rodion-lim-partior 2056886
Start multiple quorum and tessera containers
rodion-lim-partior 85013cf
Switch to using entrypoint file for quorum
rodion-lim-partior 7df502d
Unlock only member specific accounts per quorum node
rodion-lim-partior ddd5226
Store private transaction manager keys in stack state and add tests
rodion-lim-partior 8f0eefb
Expose ptm base port as a cli flag
rodion-lim-partior fe36fcb
Add tesseraEnabled flag and explicitly only allow quorum with tessera…
rodion-lim-partior 91c6a1f
Make quorum consensus configurable via cli flag
rodion-lim-partior a8910c1
Remove private ptm private key references during stack creation
rodion-lim-partior 23480c5
Remove duplicate dd for tessera
rodion-lim-partior e780adf
Refactor quorum docker entrypoint creation to its own file
rodion-lim-partior 1589b82
Check that Tessera ports are available
rodion-lim-partior 55a8385
Update tessera container name to have stack name
rodion-lim-partior c78b926
Fix PR review comments
rodion-lim-partior 3af75a7
Remove unused volume parameter when creating quorum entrypoint
rodion-lim-partior 19cb418
Fix incorrect consensus args
rodion-lim-partior 2a12af0
Add tests for quorum package
rodion-lim-partior 608c838
Update gas limit for quorum
rodion-lim-partior 18dc785
Make consensus and tessera args generic
rodion-lim-partior ae22e11
Disable evmconnect with tessera temporarily
rodion-lim-partior 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
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
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
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
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
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
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 |
|---|---|---|
| @@ -0,0 +1,93 @@ | ||
| // Copyright © 2024 Kaleido, Inc. | ||
| // | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
| // | ||
| // Licensed under the Apache License, Version 2.0 (the "License"); | ||
| // you may not use this file except in compliance with the License. | ||
| // You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, software | ||
| // distributed under the License is distributed on an "AS IS" BASIS, | ||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. | ||
|
|
||
| package quorum | ||
|
|
||
| import ( | ||
| "bytes" | ||
| "encoding/json" | ||
| "fmt" | ||
| "io" | ||
| "net/http" | ||
| ) | ||
|
|
||
| type QuorumClient struct { | ||
| rpcURL string | ||
| } | ||
|
|
||
| type JSONRPCRequest struct { | ||
| JSONRPC string `json:"jsonrpc"` | ||
| ID int `json:"id"` | ||
| Method string `json:"method"` | ||
| Params []interface{} `json:"params"` | ||
| } | ||
|
|
||
| type JSONRPCResponse struct { | ||
| JSONRPC string `json:"jsonrpc"` | ||
| ID int `json:"id"` | ||
| Error *JSONRPCError `json:"error,omitempty"` | ||
| Result interface{} `json:"result,omitempty"` | ||
| } | ||
|
|
||
| type JSONRPCError struct { | ||
| Code int `json:"code"` | ||
| Message string `json:"message"` | ||
| } | ||
|
|
||
| func NewQuorumClient(rpcURL string) *QuorumClient { | ||
| return &QuorumClient{ | ||
| rpcURL: rpcURL, | ||
| } | ||
| } | ||
|
|
||
| func (g *QuorumClient) UnlockAccount(address string, password string) error { | ||
| requestBody, err := json.Marshal(&JSONRPCRequest{ | ||
| JSONRPC: "2.0", | ||
| ID: 0, | ||
| Method: "personal_unlockAccount", | ||
| Params: []interface{}{address, password, 0}, | ||
| }) | ||
| if err != nil { | ||
| return err | ||
| } | ||
| req, err := http.NewRequest("POST", g.rpcURL, bytes.NewBuffer(requestBody)) | ||
| if err != nil { | ||
| return err | ||
| } | ||
| req.Header.Set("Content-Type", "application/json") | ||
| client := &http.Client{} | ||
| resp, err := client.Do(req) | ||
| if err != nil { | ||
| return err | ||
| } | ||
| defer resp.Body.Close() | ||
| responseBody, err := io.ReadAll(resp.Body) | ||
| if err != nil { | ||
| return err | ||
| } | ||
| if resp.StatusCode != 200 { | ||
| return fmt.Errorf("%s [%d] %s", req.URL, resp.StatusCode, responseBody) | ||
| } | ||
| var rpcResponse *JSONRPCResponse | ||
| err = json.Unmarshal(responseBody, &rpcResponse) | ||
| if err != nil { | ||
| return err | ||
| } | ||
| if rpcResponse.Error != nil { | ||
| return fmt.Errorf(rpcResponse.Error.Message) | ||
| } | ||
| return nil | ||
| } |
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.
Uh oh!
There was an error while loading. Please reload this page.