Repository navigation
[stable/ethereum] Add Chart for Deploying Private Ethereum Network - #3220
Conversation
|
/assign @mgoodness |
|
@jpoon Can you please correct for the testing errors. |
|
@mattfarina fixed lint errors. |
| genesis: | ||
| networkId: 98052 | ||
| accountsToFund: | ||
| - da1e55471ded03adadee63ac658b671277a6c7d1 |
There was a problem hiding this comment.
It appears there's a default account to start funding. From our tests and someone who installs this without setting up this own account people could end up mining (using their resources) for someone else.
This should use a pattern of not supplying a default account to fund. If that is required the parts that require it should be skipped and the NOTES.txt file should supply detail on how to handle this.
There was a problem hiding this comment.
Hey @mattfarina. Thanks for the comment.
From our tests and someone who installs this without setting up this own account people could end up mining (using their resources) for someone else.
I want to clarify that this chart will deploy a private network so it is not connected to mainnet. What happens inside this Helm chart all stays within the k8s cluster. It is a separate Ethereum network.
To give you with a bit more detail:
-
Mining
When the geth-miners initialize, they run acreate-accountcommand (https://github.com/jpoon/charts/blob/master/incubator/ethereum/templates/geth-miner.deployment.yaml#L64). This command creates a new geth account using the configured password (https://github.com/jpoon/charts/blob/master/incubator/ethereum/values.yaml#L33). It is this account where the mined Ether will be deposited to, and given the password, you have access to said mined Ether. However, as this is a private network (ie. you have control over everything), I would recommend that you leave these accounts alone and instead, configure a set number of accounts with a sufficent amount of Ether for usage (ie. to pay for contract mining). You'll see here I initialize these accounts with a crazy amount of Ether (https://github.com/jpoon/charts/blob/master/incubator/ethereum/templates/geth.configmap.yaml#L26). -
accountsToFund
This configuration accepts an array of public keys and will initialize these accounts with enough Ether to last a lifetime and be sufficient to pay for things like mining of contract and the like. The intention is for a user to supply these values as, once the Ethereum network is initialized, you can't go back. It's the nature of the blockchain that you can't reconfigure these types of settings. I intentionally left this configuration in thevalues.yamlas it makes it easier for somebody to notice and realize that it's something they should change so I'm glad you noticed :). If there's a better pattern to define configs that YOU-NEED-TO-CHANGE, happy to adhere to them.
There was a problem hiding this comment.
It's the seed value, so, it doesn't seem very dangerous - but I'd echo Matt's sentiment here. It seems awfully easy to forget to change this.
Also, one could start with a genesis.json that has multiple allocs defined already correct? Is there benefit to moving this out of that config into a separate parameter?
There was a problem hiding this comment.
one could start with a genesis.json that has multiple allocs defined already correct?
The configuration accepts an array, so supplying multiple allocs is fine. Not sure what difference supplying one vs multiple default accounts would have?
Update: See my latest commit. I've added the public/private key and account secret to the values.yaml. The specified account will be seeded with a ton of Ether and it is also the same account that mined Ether will be deposited to. .
|
/hold |
|
/assign |
|
|
||
| The command deploys a private Ethereum network in the default configuration. The configuration](#configuration) section lists various ways to override default configuration during deployment. | ||
|
|
||
| > **Tip**: List all releases using `helm list` |
There was a problem hiding this comment.
This seems a bit out of place IMO. Should be in general helm documentation.
There was a problem hiding this comment.
I was basing this README off of the existing charts in this repo. I can remove.
| ethstats: | ||
| image: | ||
| repository: ethereumex/eth-stats-dashboard | ||
| tag: latest |
There was a problem hiding this comment.
You'd want to pin to a release tag instead? Is latest a stable tag?
There was a problem hiding this comment.
Fair point. I've reached out to the image owner to get them to push a versioned release.
| genesis: | ||
| networkId: 98052 | ||
| accountsToFund: | ||
| - da1e55471ded03adadee63ac658b671277a6c7d1 |
There was a problem hiding this comment.
It's the seed value, so, it doesn't seem very dangerous - but I'd echo Matt's sentiment here. It seems awfully easy to forget to change this.
Also, one could start with a genesis.json that has multiple allocs defined already correct? Is there benefit to moving this out of that config into a separate parameter?
|
@foxish @mattfarina. I've made a change with the seed account. I've removed support for passing multiple accounts, but instead accepting one account public/private keys, and the account secret. The account will be seeded with a ton of Ether and it will also be used to deposit mined Ether. The account is loaded on the Geth nodes so if you exec in, and run There's no harm in users using the default values as this is all running in a private network. |
… connections to geth-tx
foxish
left a comment
There was a problem hiding this comment.
Changes LGTM, thanks for making them. Just one more comment and this should be good to go.
| | `geth.genesis.difficulty` | Ethereum network difficulty | `0x0400` | | ||
| | `geth.genesis.gasLimit` | Ethereum network gas limit | `0x0x8000000` | | ||
| | `geth.account.publicKey` | Geth Account to be initially funded and deposited with mined Ether | `0x975aafe74baa1978c6aabd457cf8d90ee3252db0` | | ||
| | `geth.account.privateKey` | Geth Private Key | `5c539529553e68af419860c617e20f604bd92a6f0c212b3671e0ee1312a33748` | |
There was a problem hiding this comment.
I'd rather this is left blank - just to avoid someone accidentally starting with a well-known private key. This and the public key can have no defaults and require the user to set a value to start.
There was a problem hiding this comment.
Public key is required for the miners as it needs a default account to deposit ether. If this is empty, miner's won't come up.
just to avoid someone accidentally starting with a well-known private key
To re-iterate, this is a private Ethereum network. This network has a different genesis block than mainnet so there's no possible way it can sync to the public network.
There was a problem hiding this comment.
I understand that it's private. It's not a security question, it's just an uncommon pattern to do this I think.
cc/ @unguiculus who does a lot more chart reviews
There was a problem hiding this comment.
FWIW, for the burrow chart we had to do adopt a similar pattern, or else the tests wouldn't pass...
| replicas: 1 | ||
| selector: | ||
| matchLabels: | ||
| app: {{ template "ethereum.name" . }}-bootnode |
There was a problem hiding this comment.
The app label should be {{ template "ethereum.name" . }} on all resources the chart creates. You should add component labels that should match the suffix of the resource names. Label selectors should then have app, release, and component labels.
See https://github.com/unguiculus/charts/blob/master/REVIEW_GUIDELINES.md for details.
unguiculus
left a comment
There was a problem hiding this comment.
I tried to correct the components. Since the secret and the configmap are used by two other components, I suggested to remove the component label from them. Or maybe you want to just create one geth component. This is how you structured it in values.yaml. I guess that would make sense.
There was a problem hiding this comment.
Fix app label in selector and add component label.
There was a problem hiding this comment.
Fix app label in selector and add component label.
There was a problem hiding this comment.
{{ template "ethereum.fullname" . }}-bootnode
There was a problem hiding this comment.
{{ template "ethereum.fullname" . }}-geth-tx
There was a problem hiding this comment.
{{ template "ethereum.fullname" . }}-ethstats
There was a problem hiding this comment.
It's not a component of its own. I'd remove the label.
There was a problem hiding this comment.
It's not a component of its own. I'd remove the label.
|
Thanks @unguiculus. I'm going to keep the |
|
@unguiculus @jpoon, is this PR good to go? |
|
Yes on my side. Addressed all of @unguiculus comments. |
mattfarina
left a comment
There was a problem hiding this comment.
I have one final process nit
There was a problem hiding this comment.
Can you remove the license file? All charts in the repo are licensed Apache 2. See https://github.com/kubernetes/charts/blob/master/LICENSE
|
@linki that would be optimal but I couldn't figure out a way to do that with Helm. |
|
@jpoon @linki newer versions of sprig (included in Helm) support generating private keys: http://masterminds.github.io/sprig/crypto.html |
|
Ooohhh that is helpful. Thanks @prydonius. Do you know of any easy way to extract the public key from the genPrivateKey fx? Aside: I see you have now moved to SF! Hope things are all well since OpenHack @ AMS. |
|
@jpoon hmm, not sure actually, I haven't actually used this myself! I'm guessing this might just be for generating self signed certs (the Service Catalog chart uses this). @technosophos @mattfarina any ideas if it's possible to get the public key here?
Hah, actually I'm still in London - just never got around to updating my GitHub profile ;). Might be moving back sometime in May, though! Hope you're doing well! |
|
@unguiculus thank you for adding support for test values (#4157)! Updated PR to add test keys and clarify documentation on how to generate those keys. Due to the recent test changes, looking for a new |
|
@jpoon @unguiculus do you want to move this directly into stable? Doesn't look like there's any reason not to? |
|
/lgtm |
|
What's the criteria for stable? I can move it over there if you both agree. |
|
@jpoon it should meet all the technical and documentation requirements listed here: https://github.com/kubernetes/charts/blob/master/CONTRIBUTING.md#technical-requirements. In particular, "Do not leverage alpha features of Kubernetes", as incubator used to be used for a lot of charts implementing PetSet ;). |
|
Moved it over to stable. |
|
|
|
@unguiculus done. |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jpoon, prydonius, unguiculus The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/hold cancel |
…elm#3220) * add chart for deploying private ethereum network. closes helm#2088. * fix: update readme. add privatekey for default account to fund * fix: add private key to values. import-geth-account to geth nodes * fix: decrease difficulty of network. increase gas limit, allow remote connections to geth-tx * fix: make difficulty/gasLimit configurable. use versioned ethstats image * fix: use component labels * fix: remove LICENSE * fix: as per code review, remove keys * docs: add documentation on creating a new geth account * fix: clarify documentation on creating a new account * add custom test values.yaml * move chart to stable * use latest _helpers
…elm#3220) * add chart for deploying private ethereum network. closes helm#2088. * fix: update readme. add privatekey for default account to fund * fix: add private key to values. import-geth-account to geth nodes * fix: decrease difficulty of network. increase gas limit, allow remote connections to geth-tx * fix: make difficulty/gasLimit configurable. use versioned ethstats image * fix: use component labels * fix: remove LICENSE * fix: as per code review, remove keys * docs: add documentation on creating a new geth account * fix: clarify documentation on creating a new account * add custom test values.yaml * move chart to stable * use latest _helpers Signed-off-by: voron <[email protected]>
PR adds chart to incubator for deploying a private Ethereum network to Kubernetes (fixes #2088).
The chart is comprised of 3 components:
After deploying this chart, you will end up with something like this:
For general instructions on how to deploy a private Ethereum network, see this.