-
Notifications
You must be signed in to change notification settings - Fork 26
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
Public networks #117
Public networks #117
Conversation
* generate config is now much simpler, gets rid of argparse * replace zerotier in use true/false with network_type public/private/isolated
@@ -138,7 +138,7 @@ spec: | |||
fieldPath: metadata.name | |||
- name: DAEMON | |||
value: endorser | |||
{{- if .Values.zerotier_in_use }} | |||
{{- if eq .Values.chain_type "private" }} |
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.
IMO we should make the chain_types
constants somehow. This way it is explicit what are acceptable values. And also so that we don’t have to keep referencing strings everywhere which can very easily introduce bugs. (e.g. hashs/hashes)
We can maybe have 3 (maybe just 2) vals: is_private
, is_isolated
, is_public
. We can prob just go with the first 2. If NOT private
AND NOT isolated
, then it must be public
. These vals get set by mkchain or whatever.
Or we can keep the eq
checks in Helm templates but set “private” as a string Helm value. so private: "private"
and check based off of that constant.
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.
I don't think we should have is_isolated
and is_private
because then they would not be mutually exclusive.
What do you recommend? Something like:
{{ $chain_type_private := "private }}
{{ $chain_type_isolated := "isolated" }}
{{ $chain_type_public := "public" }}
Then
{{- if eq .Values.chain_type $chain_type_private }}
?
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.
Yes something like that although I don't think that exact thing will work. Those variables won't be global to all templates.
I think there are a couple of options:
- Define global values: https://helm.sh/docs/chart_template_guide/subcharts_and_globals/#global-chart-values
- Define helpers in a
.tpl
file incharts/tezos/templates
. This will contain templates with something like this:Then we can compare on including the template. I think there is a way to treat the template like a function where you can pass a context in and let it spit back out a value like true/false that we can then just{{ define "tezos.public_chain" }} {{- "public" -}} {{ end }}
if
on.
Either way, probably not necessary for getting the F-beta net out the door.
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.
let's iterate on this in another PR
Done as part of config-generator. It is now using the tezos container as base. remove identity generation - nodes does it temporarily change tezos container version to master - will revert
change ordering of init containers again to make sure they all download snapshots
move back zerotier ip before everything to fix zerotier use case make snapshot download only happen with public mode
later it will be parametrized
do not download snapshot for nodes in isolated chains
This introduces a third mode of operation. We previously had zerotier-in-use true/false.
Now we have public/private/isolated networks. Description is in README.
The main addition is the capability to run mainnet or a testnet on tezos-k8s, and sync quickly thanks to snapshots.
Add a new container to import snapshot. Make the assmption of a public network will run in
rolling
mode.The
config-generator
container is now built on top of the tezos container. The reason is that we need to extract the network data from the binary to put it in thebootstrap_peers
section. Entrypoint is now a shell script which calls the previous python entrypoint.To test on edo2net, the
master_328bc6c3_20210215194506
branch will work. Replacev8-release
with this branch everywhere.Then you need to submit
network: edo2net
in the values.yaml. We also add--network
support to mkchain.We switch the default protocol to edo2 because this is the one that runs in mainnet now.
Config-generator was previously using argparse to build config.json because it was originally part of mkchain. We replace it with a simple python object creation.
Black changed the formatting of some of Roland's crypto code for some reason.
If approved, I will be using "squash-and-merge" to merge.