ava-labs / avalanche-cli

Other
106 stars 68 forks source link

Integrate ANR lcoal machine connect to Devnet on Node create cmd #2195

Open sukantoraymond opened 2 months ago

sukantoraymond commented 2 months ago

Context and scope Include a short description of the context and scope of the suggested feature. Include goals the change will accomplish if relevant.

Node create should include option to spin up a node using local machine (right now it only supports AWS/GCP).

Discussion and alternatives Include a description of the changes to be made to the code along with alternatives that were considered.

Open questions Questions that are still being discussed.

felipemadero commented 2 months ago

Considerations:

1) Hardcode etna devnet parameters (endpoint, genesis, upgrade, beacons) into constants pkg. use separate files for genesis and upgrade, and golang embed. 2) Add flags for this network parameters to the node create command as a way for the command to be flexible, but enable just using the etnaDevnet name 3) Add a new prompt to either deploy into local machine or into remote, (this to be the first prompt probably), add flags for this two options also. 4) Then, the network options. If remote, devnet or fuji (now, this should be something like 'create devnet', fuji), if local machine: etnaDevnet (and fuji???? probably in the future) 5) so now, networkoptions implementation complicates... pretty much, probably just not use networkoptions and, just add all the flags and prompts for the different cases: (flags: fuji, createDevnet, etnaDevnet) 6) if etnaDevnet, populate parameters (probably look for etnaDevnet name into a map in constants) 7) if parameteres are given on command line, don't ask for network

ANR: 1) A different gRPCServerPort should be added to constants to be used for etna node, so there is no conflict with local networks, there should be new versions of NewGRPCServer, NewGRPCClient for etna node, that receives the port. 2) If more nodes are added, use ANR AddNode 3) decide on a path under .avalanche-cli where to keep the nodes persistant state, then use that as rootDir when starting the network, use a name that follows up ANR snapshot convention (anr-snapshot-NAME) 4) don't pass nodeid/bls etc to this command for the moment on, it seems that flow is for users that will deploy using their own way, not using CLI (to be discussed) 5) use ANR start to create the first node, ANR addnode to add nodes, ANR stop to shut down the nodes, ANR loadSnapshot to load the nodes again

Finally: