-
Notifications
You must be signed in to change notification settings - Fork 76
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
Add HyperSDK Functionality to CLI #2369
base: main
Are you sure you want to change the base?
Conversation
return err | ||
} | ||
switch option { | ||
case providePath: |
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.
no need to add another prompt to ask for path. better UX is to just ask user to provide path to genesis right away and use it after checking if file exists. So this case branch is not needed here and can be moved up to How would you like to provide the genesis file?
prompt
return nil, nil | ||
} | ||
|
||
func getChainID(app *application.Avalanche) (ids.ID, error) { |
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.
nit: better name promptChainID
return json.Marshal(genesis) | ||
} | ||
|
||
func getPreallocations(app *application.Avalanche) ([]*genesis.CustomAllocation, error) { |
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.
nit: better name promptPreallocations
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.
commented on the code
looking into the code it's not clear for me what the difference between customVM and hypersdk VM option. |
Why this should be merged
With the HyperSDK maturing, we would like to make it a first-class citizen (i.e. the same level of support as Subnet-EVM). By doing this, HyperSDK developers benefit from the following:
How this works
This PR separates HyperVMs (VMs built with HyperSDK) from the custom VM group and makes it a group of its own. Therefore, we now have three types of VMs in the CLI:
The biggest change is in the
avalanche blockchain create
command, where users are now able to select the option of creating a HyperVM. When selecting this option, the control flow is similar to that of Subnet-EVM, with the exception of the genesis.In addition to being able to provide a
genesis.json
file and being able to use the default HyperSDK genesis, users can also use their VM binary to create the VM genesis on their behalf.How this was tested
How is this documented
We plan on adding documentation for this feature in the HyperSDK docs.
cc: @felipemadero @aaronbuchwald