oxheadalpha / tezos-k8s

Deploy a Tezos Blockchain on Kubernetes
https://tezos-k8s.io/
MIT License
50 stars 26 forks source link

it shouldn't be necessary to explicitly set snapshots to null #193

Open nicolasochem opened 3 years ago

nicolasochem commented 3 years ago

it shouldn't be necessary to explicitly set snapshots to null when activating a new chain or starting a node in archive mode.

For example:

nodes:
  regular:
    tezos-node-0:
      config:
        shell:
          history_mode: archive
  baking: {}
regular_node_statefulset: # charts/tezos/templates/node.yaml
  name: tezos-node
  node_type: regular
  storage_size: 50Gi
node_config_network:
  chain_name: florencenet
images:
    tezos: tezos/tezos:v9.1
full_snapshot_url: null
rolling_snapshot_url: null

works, but

nodes:
  regular:
    tezos-node-0:
      config:
        shell:
          history_mode: archive
  baking: {}
regular_node_statefulset: # charts/tezos/templates/node.yaml
  name: tezos-node
  node_type: regular
  storage_size: 50Gi
node_config_network:
  chain_name: florencenet
images:
    tezos: tezos/tezos:v9.1

gives the following errror in snapshot-downloader init container:

+ CMD=snapshot-downloader                                                                                                                                                                                                                                  │
│ + shift                                                                                                                                                                                                                                                    │
│ + exec /snapshot-downloader.sh                                                                                                                                                                                                                             │
│ No snapshot URL provide for node, exiting                                                                                                                                                                                                                  │
│ stream closed                                                                                                                                                                                                                                              │
nicolasochem commented 3 years ago

We are hardcoding mainnet snapshots by default, which is useful for starting a mainnet node.

When starting a private chain, it's necessary to override it to "null".

Maybe we could have a default snapshot map with the key as the network name and the value as the url?

This way, when we start a private chain, it will default with no snapshot.

harryttd commented 3 years ago

I think that is a great idea as its own thing. It will help users configure the network they want more easily. We would need multiple values for the network though. For full and rolling snapshots. (And possibly archive at some point)

I think this should still be fixed bec if a user doesn't want a snapshot for whatever network they want to join, they shouldn't need to explicitly set to null.