• Dan Moore's avatar
    fix: prefund container suffixes for k8s (#818) · 968cfbdb
    Dan Moore authored
    **purpose:**
    - fix issue when running with k8s backend, where prefunded accts
    services are not destroyed instantaneously and this causes 'service
    already exists' errors
    
    **tests:**
    
    original error:
    ```
    Running ethereal to derive private keys of key 1
    There was an error executing Starlark code
    An error occurred executing instruction (number 9) at github.com/rebelArtists/ethereum-package/src/prefunded_accounts/get_prefunded_accounts.star[12:34]:
      run_sh(name="run-ethereal-private-key", run="private_key=$(/app/ethereal hd keys --seed=\"code code code code code code code code code code code quality\" --path=\"m/44'/60'/0'/0/1\" | awk '/Private key/{print substr($NF, 3)}'); echo -n $private_key", image="wealdtech/ethereal:latest", description="Running ethereal to derive private keys of key 1")
      Caused by: error occurred while creating a run_sh task with image: wealdtech/ethereal:latest
      Caused by: Failed registering service with name: 'run-ethereal-private-key'
      Caused by: Error registering service 'run-ethereal-private-key'
      Caused by: An error occurred creating Kubernetes service in enclave '629c500d8cda49d3b743a3d143d336b7' with ID 'run-ethereal-private-key'
      Caused by: Failed to create service 'run-ethereal-private-key' in namespace 'kt-cdk'
      Caused by: services "run-ethereal-private-key" already exists
    
    Error encountered running Starlark code.
    ```
    
    with fix (service name has key number suffix to prevent clash):
    ```
    ...
    Running ethereal to derive eth address of key 19
    Command returned with exit code '0' and the following output: 0x6d5821d6D50108649480A63d6f337F8473d661ef
    
    Running ethereal to derive private keys of key 20
    Command returned with exit code '0' and the following output: efa8369dbb93b8b452535ab87f526465e9441c7c5809a942908662b925eaff42
    
    Running ethereal to derive eth address of key 20
    Command returned with exit code '0' and the following output: 0x31C916e6EAD0DB63BeD514a6f292C526696F0549
    
    Printing a message
    PRE_FUNDED_ACCOUNTS: [struct(address = "0xXYZ", private_key = "ABCDEFG"),...]
    ```
    
    ---------
    Co-authored-by: default avatarRafael Matias <rafael@skyle.net>
    968cfbdb
Name
Last commit
Last update
..
get_prefunded_accounts.star Loading commit data...