oxheadalpha / tezos-k8s

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

Research removing docker dependency in mkchain #89

Closed brandisimus closed 3 years ago

brandisimus commented 3 years ago

Currently using docker to generate keys (tezos docker image) and creating a genesis block hash (in flextessa). This is an akward and unnecessary complication on the pipeline and ideally would be replaced with a simpler solution if possible. This ticket requires research wrt this possibility.

brandisimus commented 3 years ago

Related #26, #46

harryttd commented 3 years ago

WIP creating block hash without flextesa:

from base58 import b58encode_check
from hashlib import blake2s
​
seed = str.encode(
    "".join(random.choice(string.ascii_uppercase + string.digits) for _ in range(16))
)
​
print(seed)
blake = blake2s(seed)
print(blake.digest_size)
# Prepend letter B
blake = b"\x01\x34" + blake.digest()
print(blake)
print(b58encode_check(blake))

The above is based on me talking to Seb and this link https://tezos.stackexchange.com/a/1213/3189. The tezos node accepts the output. Still requires more testing

harryttd commented 3 years ago

Links for potentially generating keys without flextesa:

https://github.com/ecadlabs/taquito/search?q=secret https://github.com/ecadlabs/taquito/blob/6a4e4ab6ac/packages/taquito-signer/src/ed-key.ts

https://github.com/ereOn/csodium https://github.com/pyca/pynacl/blob/master/INSTALL.rst

https://pytezos.org/_modules/pytezos/crypto.html#Key.generate

harryttd commented 3 years ago

Seb mentioned that it may be possible to use ssh gey gen which is (almost?) available everywhere to generate keys.

harryttd commented 3 years ago

This issue is related to PR #154. We likely could still remove docker and generate random genesis blocks with blake2b and keys via python lib nacl. This is currently implemented in config-generator thanks to Roland