-
Notifications
You must be signed in to change notification settings - Fork 378
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
Request for Docs on how a Subnet is built from Scratch without the Avalanche Network Runner #1363
Comments
Thanks for creating here!
|
@aaronbuchwald that was super helpful! 2, 3 & 5 - I can try using the pre-computed SubnetIDs that the CLI & runner run with to get a v1 out and that can just be with subnet-evm for now; as I'll set I'll read through the wallet code later and see if (or maybe there are docs by then) to generate the SubnetID Will wait for @felipemadero to elaborate on what the |
Node configurationIt is not currently possible to modify Wallet issuanceThe full flow for launching a permissioned blockchain is:
If the goal is to launch a permissionless blockchain then:
If you want to pre-generate transactions, the easiest way will be to specify your own |
Hey Stephen! That's really thorough. Node ConfigurationThis makes sense! To makes sure I understand correctly; If I end up using a pre computed list of subnet ids; all I have to do is put the correctly named vm into the Wallet issuanceThis makes sense as well. I'll go further deep into it as I start implementing this and I will probably have more questions when I do so. In the meantime my understanding of the conversations so far; The sequence of operations is the following (assuming the subnet-evm) -
At this point I have a choice I can either use AddSubnetValidatorTxs or launch a permission less blockchain and then use AddPermissionLessValidatorTx (based on my understanding this is the path the CLI takes). I could stop too as I have a chain with some validators. For permission less(elastic?) Blockchain
For permissioned blockchain to add new validators
Some questions that I might not have asked above
I'll have to decide whether I go the pre-generated transactions route or the route above. I am biasing towards generate on runtime route as I have dived deep enough into it I feel. If I do create a minimal interface I'll make sure I PR back to the repository. Thanks for being so patient with me. I have been programming for years but I am fairly new to blockchain dev & Avalanche. |
Hi Gyanendra Regarding the original figured-out point 2: pre-computed subnet ids are used mainly for CLI implementation (for fast local subnet deploy). They belong to a network snapshot that comes packaged into CLI (https://github.com/ava-labs/avalanche-cli/blob/main/assets/bootstrapSnapshot.tar.gz), and are not available in a network started from scratch without using such snapshot. I think there was a confusion on this point, as it is different what the CLI does (use a subnet id for a subnet that was already created and is contained in a network snapshot) from what a custom wallet enables to do (pre generate a subnet id without creating a real subnet, by simulating UTXO consumption and construct the tx without issuing it to the blockchain - as aaron mention in his comment to 2, and stephen extends in relation to pre-generating transactions) Regarding the original questions: An avalanchego network needs to be restarted if:
In the specific case of adding a new vm, no need to restart as stephen already told, just need 2 The CreateBlockchains function of ANR creates the requested blockchains, each of one defined by
Where:
If the subnet id is defined, then a blockchain is created (see createBlockchainsTxs) under that previously generated subnet If the subnet id is not defined, a new subnet will we generated, will all network nodes as participants and no subnet config as default, unless optional subnet parameters are passed in. In the special case of receiving an optional list of nodes as participants where some of the nodes do not exist, first the new nodes will be added to the network, and then used as participants for the desired subnet. After all of that, the blockchain is created over the new subnet. If blockchain config files, or network upgrade files are given, then they are first generared in the right locations, and then the network will be restarted previously to create the blockchains. Regarding your second comment in the thread, yup you can try to use the network snapshot that comes with the CLI Regarding using a wallet to pre generate subnet ids: I think you probably don't want to first pre generate a subnet id by using a wallet, and you just want to create a subnet from scratch. |
You can't just use a pre computed list of subnet ids, you can either use a network snapshot with already have subnet ids and tracked-subnets defined, or you need to do all the steps: create a subnet, restart the network with updated tracked-subnets, and then create the blockchain.
You have funds already available to a local network on PChain by using the EWOQ address as in network runner code
You can leave fxIDs empty for now. those are for feature extensions to be run by the vm. For genesis you can use a genesis created by CLI when locally deploying a subnet, to be found on ~/.avalanche-cli/subnets/SUBNET_NAME/genesis.json
You will not have any subnet validators until you issue an AddSubnetValidatorTx and you did not issue any in the previous points. It is not enough to set tracked-subnets, you need to issue an add subnet validator tx for each node you want to be a validator of the subnet.
Yup elastic
Yon can also first issue an add subnet validator tx for those validators, and then restart then with proper tracked subnets and vms.
Probably you may want to just follow the route you described.
|
Thank you so much @felipemadero Your comments are very clear, insightful and super helpful. I think I have a fairly good understanding of how subnets launch now. I'll try to have an |
EWOQ addresses in the above post refer to the addresses here - https://github.com/ava-labs/avalanchego/blob/master/genesis/genesis_local.go#L18-L21 which come prefunded with a lot of tokens Update from conversation with Aaron on Wednesday - the VMID is a cb58 hash and can be computed using either of |
Hey! @aaronbuchwald Thanks again for your time last week :) I have added a bunch of stuff to the avalanche-package since and now this launches subnets! You can launch subnets with how many nodes you want using FLUP on speedThe time for the docker run of avalanchego to expose 9651 and Kurtosis is very similar; around 12s on my machine. TODOI am tracking a lot of improvements that need to be made
For nowIn the meantime with Kurtosis installed you can give it a spin using
This would spin up a 5 node cluster but you should be able to put a random number as well. By default this runs against Docker. I can send you instructions for K8S if you want to try that out too! Note without the Thank you @felipemadero @StephenButtolph for your help too! |
Hey! I have added a few more things
I am running into some weirdness though - up to 20 nodes its fine but if try starting a cluster with any more nodes there's some weirdness - here's the steps i take for permissioned subnets
With 30 nodes it(main.log) was initially failing with this when I did the vm installation after the after the From the
the stack trace says
Do you know what might be going on here @aaronbuchwald @felipemadero ? This is running against avaplatform/avalanchego:v1.10.1-Subnet-EVM-master on Docker on my M1 Mac |
Update - Alright I see where the error was coming from my logic here While doing the issue validator transaction I had hardcoded a start time delay of 1 minute from the beginning of the loop. I think we'd run a transaction with a start timestamp in the past and that would fail. If I setup startTime per node instead of having a global one that I use; I don't get the error anymore. Still having some troubles getting things into a healthy state as I run into
per node on restart but that seems different from the above issue. Will investigate. Maybe I should do add validator, restart validator per validator instead. |
Alright! I was able to fix what was broken and the 100 node demo on k8s runs fine :) You will be able to specify how much memory + cpu something runs with Here's the demo https://www.loom.com/share/f4e8bfeb4c304903b9b5f8736df0591d This doc should get you started - https://docs.kurtosis.com/k8s/ |
@ashucoder9 Hi, can you please provide an update on this? Wondering if it can be closed. |
Is there a document that you have that explains the process of subnet creation? All articles I can find on the internet use the avalanche network runner. I have seen some articles on ChainStack and others that refer to deprecated calls like
keystore.CreateUser
orplatform.CreateSubnet
I have been going through the avalanche-cli & the network runner and so far I have figured out the following
--tracked-subnets
. I am happy with using pre-computed SubnetIDs but I am curious if you can link me to the process of creating these SubnetIDsWhat I am still stuck on
Thanks @aaronbuchwald for suggesting I create an issue here!
The text was updated successfully, but these errors were encountered: