This repository has been archived by the owner on Sep 26, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 130
[PIE-1602] Implement operator tool. (blockchain network configuration for permisionned networks) #1511
Merged
AbdelStark
merged 44 commits into
PegaSysEng:master
from
AbdelStark:feature/pie-1602-operator-tool
Jun 10, 2019
Merged
[PIE-1602] Implement operator tool. (blockchain network configuration for permisionned networks) #1511
AbdelStark
merged 44 commits into
PegaSysEng:master
from
AbdelStark:feature/pie-1602-operator-tool
Jun 10, 2019
Conversation
This file contains 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
- introduce new subcommand - add cli options
- generate nodes keypairs - create a directory per node - write public key to a file - wrtie private key to a file
- process ibft extra data - encode rlp
- hande import of public keys - factorize code (import and generation)
AbdelStark
added
enhancement
New feature or request
api
Related to public APIs
permissioning
testing
Related to tesing
continuous-integration
Related to continuous integration
labels
May 30, 2019
Sample configuration file to generate an IBFT network with 4 nodes. (keys are generated by the tool) {
"genesis": {
"config": {
"chainId": 2017,
"constantinoplefixblock": 0,
"homesteadBlock": 0,
"eip150Block": 0,
"eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000"
},
"nonce": "0x0",
"timestamp": "0x5b3c3d18",
"number": "0x0",
"gasUsed": "0x0",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"gasLimit": "0x47b760",
"difficulty": "0x1",
"mixHash": "0x63746963616c2062797a616e74696e65206661756c7420746f6c6572616e6365",
"coinbase": "0x0000000000000000000000000000000000000000",
"ibft2": {
"blockperiodseconds": 2,
"epochlength": 30000,
"requesttimeoutseconds": 10
},
"alloc": {
"24defc2d149861d3d245749b81fe0e6b28e04f31": {
"balance": "0x446c3b15f9926687d2c40534fdb564000000000000"
},
"2a813d7db3de19b07f92268b6d4125ed295cbe00": {
"balance": "0x446c3b15f9926687d2c40534fdb542000000000000"
}
}
},
"blockchain": {
"nodes": {
"generate": true,
"count": 4
}
}
} |
Sample configuration file to generate an IBFT network 2 nodes (imported keys). {
"genesis": {
"config": {
"chainId": 2017,
"constantinoplefixblock": 0,
"homesteadBlock": 0,
"eip150Block": 0,
"eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000"
},
"nonce": "0x0",
"timestamp": "0x5b3c3d18",
"number": "0x0",
"gasUsed": "0x0",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"gasLimit": "0x47b760",
"difficulty": "0x1",
"mixHash": "0x63746963616c2062797a616e74696e65206661756c7420746f6c6572616e6365",
"coinbase": "0x0000000000000000000000000000000000000000",
"ibft2": {
"blockperiodseconds": 2,
"epochlength": 30000,
"requesttimeoutseconds": 10
},
"alloc": {
"24defc2d149861d3d245749b81fe0e6b28e04f31": {
"balance": "0x446c3b15f9926687d2c40534fdb564000000000000"
},
"2a813d7db3de19b07f92268b6d4125ed295cbe00": {
"balance": "0x446c3b15f9926687d2c40534fdb542000000000000"
}
}
},
"blockchain": {
"nodes": {
"keys": [
"0xb295c4242fb40c6e8ac7b831c916846050f191adc560b8098ba6ad513079571ec1be6e5e1a715857a13a91963097962e048c36c5863014b59e8f67ed3f667680",
"0x6295c4242fb40c6e8ac7b831c916846050f191adc560b8098ba6ad513079571ec1be6e5e1a715857a13a91963097962e048c36c5863014b59e8f67ed3f667680"
]
}
}
} |
pantheon/src/main/java/tech/pegasys/pantheon/cli/operator/OperatorSubCommand.java
Show resolved
Hide resolved
pantheon/src/main/java/tech/pegasys/pantheon/cli/operator/OperatorSubCommand.java
Outdated
Show resolved
Hide resolved
pantheon/src/main/java/tech/pegasys/pantheon/cli/operator/OperatorSubCommand.java
Outdated
Show resolved
Hide resolved
pantheon/src/main/java/tech/pegasys/pantheon/cli/operator/OperatorSubCommand.java
Outdated
Show resolved
Hide resolved
pantheon/src/main/java/tech/pegasys/pantheon/cli/operator/OperatorSubCommand.java
Show resolved
Hide resolved
mbaxter
reviewed
May 31, 2019
pantheon/src/main/java/tech/pegasys/pantheon/cli/operator/OperatorSubCommand.java
Show resolved
Hide resolved
pantheon/src/main/java/tech/pegasys/pantheon/cli/operator/OperatorSubCommand.java
Show resolved
Hide resolved
pantheon/src/main/java/tech/pegasys/pantheon/cli/operator/OperatorSubCommand.java
Outdated
Show resolved
Hide resolved
pantheon/src/main/java/tech/pegasys/pantheon/cli/operator/OperatorSubCommand.java
Outdated
Show resolved
Hide resolved
pantheon/src/test/java/tech/pegasys/pantheon/cli/operator/OperatorSubCommandTest.java
Outdated
Show resolved
Hide resolved
pantheon/src/test/java/tech/pegasys/pantheon/cli/operator/OperatorSubCommandTest.java
Outdated
Show resolved
Hide resolved
pantheon/src/test/java/tech/pegasys/pantheon/cli/operator/OperatorSubCommandTest.java
Show resolved
Hide resolved
pantheon/src/test/java/tech/pegasys/pantheon/cli/operator/OperatorSubCommandTest.java
Show resolved
Hide resolved
pantheon/src/main/java/tech/pegasys/pantheon/cli/operator/OperatorSubCommand.java
Show resolved
Hide resolved
Is there any chance of making this work for Clique too? |
…atorSubCommandTest.java Co-Authored-By: mbaxter <[email protected]>
…bdelhamidbakhta/pantheon into feature/pie-1602-operator-tool
mbaxter
reviewed
Jun 7, 2019
pantheon/src/main/java/tech/pegasys/pantheon/cli/operator/OperatorSubCommand.java
Outdated
Show resolved
Hide resolved
pantheon/src/main/java/tech/pegasys/pantheon/cli/operator/OperatorSubCommand.java
Outdated
Show resolved
Hide resolved
pantheon/src/main/java/tech/pegasys/pantheon/cli/rlp/IbftExtraDataCLIAdapter.java
Show resolved
Hide resolved
pantheon/src/main/java/tech/pegasys/pantheon/cli/operator/OperatorSubCommand.java
Outdated
Show resolved
Hide resolved
mbaxter
reviewed
Jun 8, 2019
pantheon/src/main/java/tech/pegasys/pantheon/cli/operator/OperatorSubCommand.java
Outdated
Show resolved
Hide resolved
Yes why not, could you provide a quick description of the requirements ? |
remove generic type
use Address type instead of String
- fix broken tests (non empty directory)
mbaxter
reviewed
Jun 10, 2019
pantheon/src/main/java/tech/pegasys/pantheon/cli/rlp/JSONToRLP.java
Outdated
Show resolved
Hide resolved
pantheon/src/main/java/tech/pegasys/pantheon/cli/operator/OperatorSubCommand.java
Outdated
Show resolved
Hide resolved
pantheon/src/main/java/tech/pegasys/pantheon/cli/operator/OperatorSubCommand.java
Outdated
Show resolved
Hide resolved
pantheon/src/main/java/tech/pegasys/pantheon/cli/operator/OperatorSubCommand.java
Show resolved
Hide resolved
pantheon/src/main/java/tech/pegasys/pantheon/cli/operator/OperatorSubCommand.java
Outdated
Show resolved
Hide resolved
mbaxter
approved these changes
Jun 10, 2019
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
api
Related to public APIs
continuous-integration
Related to continuous integration
enhancement
New feature or request
permissioning
testing
Related to tesing
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.
PR description
Implement a tool to generate blockchain config files for a network operator.
Input config file must be a JSON file following the right format.
In addition to the config file, here are the possible CLI options:
--to
: Directory to write output files to.--genesis-file-name
: Name of the genesis file.--private-key-file-name
: Name of the private key file.--public-key-file-name
: Name of the public key file.Two modes are possible:
Generated files are:
Fixed Issue(s)
fixes #PIE-1602