Skip to content
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

Acp 77 local network #2357

Open
wants to merge 150 commits into
base: main
Choose a base branch
from
Open

Acp 77 local network #2357

wants to merge 150 commits into from

Conversation

felipemadero
Copy link
Collaborator

@felipemadero felipemadero commented Nov 22, 2024

Why this should be merged

  • adds local network deploy of sov blockchains
  • removes usage boostrap snapshots (keeps the snapshots for CLI backwards compat)
  • enables configurable number of local network nodes (sets new default to 2 nodes)
  • adds teleporter deploy to blockchain deploy cmd (any network)
  • adds relayer deploy to blockchain desploy cmd (any network)
  • ensure same avago + relayer for network restarts in case a change is not indicated

How this works

https://asciinema.org/a/gypjn0s5vFL3crm3afHQICqab

How this was tested

How is this documented

sukantoraymond and others added 30 commits September 9, 2024 10:36
* prompt addresses

* fix lint

* fix lint

* fix lint

* fix lint

* add flags

* address comments

* fix test

* address comments

* fix lint

---------

Signed-off-by: sukantoraymond <[email protected]>
* prompt addresses

* fix lint

* fix lint

* fix lint

* fix lint

* add flags

* validator prompt

* bootstrap validators

* add mock

* fix lint

* update prompt validator

* update prompt validator

* implement prompts

* fix prompt mock

* update sidecar

* update prompts

* update prompts

* refactor

* update prompts

* update prompts

* use default balance and weight

* generate new node ids and bls

* fix lint

* add flags

* add flags

* address comments

* address comments

* address comments

* move validator prompt to deploy

* address comments

* address comments

* fix lint

* address comments

* address comments

* fix test

* address comments

* fix lint

* address coments

* address coments

* fix test

* fix test

* fix test

* fix lint

---------

Signed-off-by: sukantoraymond <[email protected]>
* adding teleporter contract to genesis

* fixes for icm on genesis

* add icm from a given embedded file

* add function to deploy ICM registry

* creating mapping values

* add consts

* make local deploy to work

* do not print info for icm support addrs

* nit

* nit

* fix wiz stuff

* address PR comments

* filter based on balance

* add unit tests

* Update cmd/blockchaincmd/describe.go

Co-authored-by: Michael Kaplan <[email protected]>
Signed-off-by: felipemadero <[email protected]>

* lint

---------

Signed-off-by: felipemadero <[email protected]>
Co-authored-by: Michael Kaplan <[email protected]>
* prompt addresses

* fix lint

* fix lint

* fix lint

* fix lint

* add flags

* adding teleporter contract to genesis

* validator prompt

* bootstrap validators

* add mock

* fix lint

* update prompt validator

* update prompt validator

* fixes for icm on genesis

* add icm from a given embedded file

* add function to deploy ICM registry

* creating mapping values

* add consts

* make local deploy to work

* do not print info for icm support addrs

* nit

* implement prompts

* fix prompt mock

* update sidecar

* update prompts

* update prompts

* refactor

* nit

* update prompts

* fix wiz stuff

* update prompts

* use default balance and weight

* generate new node ids and bls

* fix lint

* add flags

* add flags

* add a function to initialize PoA manager

* add lib folder

* address comments

* address comments

* address comments

* move validator prompt to deploy

* address comments

* address comments

* fix lint

* address comments

* address comments

* fix test

* address PR comments

* basic PoA manager setting

* lint

* address comments

* fix lint

* fix e2e

* fix merge

* fix merge

* filter based on balance

* add unit tests

* nit

* address PR comments

* Update cmd/blockchaincmd/describe.go

Co-authored-by: Michael Kaplan <[email protected]>
Signed-off-by: felipemadero <[email protected]>

* nit

* address PR comments

* lint

---------

Signed-off-by: sukantoraymond <[email protected]>
Signed-off-by: felipemadero <[email protected]>
Co-authored-by: Raymond Sukanto <[email protected]>
Co-authored-by: Michael Kaplan <[email protected]>
* wip

* go mod tidy

* use awm-relayer@main

* fixes

* use latest awm-relayer pkg  which caused upgrade on coreth and avago  - has to be resolved

* use latest anr and rm prometheus metrics

* check for errors

* lint

* mv to sdk/interchain

* some refactoring and added unittests

* fix license

* fix unittest for now

* fix lint

* allow empty subnetID
add usage working example

* rm error msg from example

* refactor to address felipe feedback

* we should remove this from the test in favour of https://github.com/ava-labs/awm-relayer/blob/main/signature-aggregator/aggregator/aggregator_test.go - we just use exposed API

* update readme example

* rm goconst fix CI

* put `- goconst` back

* resolve conficts

---------

Co-authored-by: Raymond Sukanto <[email protected]>
* use latest anr main

* tidy

* bump e2e avago version to be dynamic fee compatible

* fix e2e for dynamic fees

* lint
* prompt addresses

* fix lint

* fix lint

* fix lint

* fix lint

* add flags

* adding teleporter contract to genesis

* validator prompt

* bootstrap validators

* add mock

* fix lint

* update prompt validator

* update prompt validator

* fixes for icm on genesis

* add icm from a given embedded file

* add function to deploy ICM registry

* creating mapping values

* add consts

* make local deploy to work

* do not print info for icm support addrs

* nit

* implement prompts

* fix prompt mock

* update sidecar

* update prompts

* update prompts

* refactor

* nit

* update prompts

* fix wiz stuff

* update prompts

* use default balance and weight

* generate new node ids and bls

* fix lint

* add flags

* add flags

* add a function to initialize PoA manager

* add lib folder

* address comments

* address comments

* address comments

* move validator prompt to deploy

* address comments

* address comments

* fix lint

* address comments

* address comments

* fix test

* address PR comments

* basic PoA manager setting

* lint

* address comments

* fix lint

* fix e2e

* fix merge

* fix merge

* convert Subnet Tx

* convert subnet

* register validator

* add validator

* mock

* remove validator

* update weight

* update weight

* add flags add validator

* remove validator update

* refactor addvalidator

* use node id as arg in addvalidator

* fix change weight arg

* resolve merge conflict

* fix lint

* address comments

* fix lint

* Enable non sov subnets (#2203)

* subnet create non sov

* support non sov blockchain

* update test

* update tests

* update tests

* update test

* update tests

* update tests

* fix test

* update tests

* Rename Subnet to L1 for new commands ACP77 (#2209)

* rename convert subnet

* rename to l1

* fix lint

* fix lint

* fix lint

* fix lint

* Integrate ConvertSubnetTx AvalancheGo  (#2213)

* complete implementation of avalanche go convertsubnet

* update relayer

* update convertsubnettx

* update avalanchego

* update avalanche go

* update avalanche go

* dont prompt control key for sov

* add tx cases for convert subnet tx (#2218)

* Poa integration (#2212)

* use latest contract

* point to latest convert subnet avago PR

* nit

* use fixed anr

* nit

* add subnet conversion id calculation

* created unsigned warp message

* fixed local network deploy

* added signing

* now this is working

* using latest avago master + awm relayer

* working pretty well

* ready

* lint

* address PR comments

* nit

---------

Signed-off-by: sukantoraymond <[email protected]>
Co-authored-by: sukantoraymond <[email protected]>

* fix lint

* reverse sidecar sov logic

* fix merge

* add poa setup to blockchain deploy (#2219)

* add setup poa to blockchain deploy

* add command

* add proposervm update

* proposervm flag for nodes

* nit

* nit

* fixed dynamic fees params calculation

* only adding tracked apis to apis in sidecar

* improve prompts

* fixing various stuff

* add upgrade file

* use anr etna enabled

* keep upgrade on sync

* workin

* almost working

* working1

* Update cmd/keycmd/transfer.go

Co-authored-by: Meaghan FitzGerald <[email protected]>
Signed-off-by: felipemadero <[email protected]>

* fix some lint

* address PR comments

* missing file

* nit

---------

Signed-off-by: felipemadero <[email protected]>
Signed-off-by: sukantoraymond <[email protected]>
Co-authored-by: Meaghan FitzGerald <[email protected]>
Co-authored-by: sukantoraymond <[email protected]>

---------

Signed-off-by: sukantoraymond <[email protected]>
Signed-off-by: felipemadero <[email protected]>
Co-authored-by: felipemadero <[email protected]>
Co-authored-by: Meaghan FitzGerald <[email protected]>

* fix lint

---------

Signed-off-by: sukantoraymond <[email protected]>
Signed-off-by: felipemadero <[email protected]>
Co-authored-by: felipemadero <[email protected]>
Co-authored-by: Meaghan FitzGerald <[email protected]>

---------

Signed-off-by: sukantoraymond <[email protected]>
Signed-off-by: felipemadero <[email protected]>
Co-authored-by: Felipe Madero <[email protected]>
Co-authored-by: Meaghan FitzGerald <[email protected]>
Signed-off-by: sukantoraymond <[email protected]>
* refactor subnet sync

* fix lint

* Remove redundancies (#2229)

* remove redundant code

* fix lint

* fix lint

* Convert Subnet in  1 command (#2230)

* one command deploy

* use default private key to deploy validator manager contract

* fix lint

* remove redundant code

* address comments

---------

Signed-off-by: sukantoraymond <[email protected]>

---------

Signed-off-by: sukantoraymond <[email protected]>
* generate new node id

* fix lint
Signed-off-by: sukantoraymond <[email protected]>
* node local init

* hardcode etna devnet config

* wip

* rm not needed utils

* ready for draft PR

* nits
rm unused struct

* refactor - wip

* make sure we can resume without prompts

* add custom network and local cluster

* devnet instead of custom network, rm custom

* go mod tidy

* upgrade.json for etna devnet

* more local cluster

* separate between local network and local cluster

* working

* nit

* fix plugin

* nit

* improve snapshot management

* fix bug

* nit

* proper etna devnet boostrappers

* fix bug with local rootdir

* remove global node config stuff

* destroy node data and processes if bad start

* nit

* always use fresh staking keys

* nit

* so less flags

* add back fast boot time

* add checks for local cluster. minor refactor (#2239)

* add checks for local cluster
minor refactoring

* fix test

* addressed Felipe feedback

---------

Signed-off-by: arturrez <[email protected]>

* bump anr

* fixes for convert flow

* add check for already initialized error on PoA init

* nit

* use anr main

* fix merge

* Local mkdir rootdir (#2245)

* make sure rootDir exists

* mv it to proper location

* it's done before the start

* update anr

* Integrate local devnet (#2254)

* integrate deploy

* integrate deploy

* Fix lint

* address comments

* address comments

* Integrate start (#2262)

* integrate start

* integrate start

* update etna network

* integrate start

* integrate start

* finish integrate start

* fix lint

* stop existing local avalanchego

* more robust

---------

Signed-off-by: arturrez <[email protected]>
Signed-off-by: sukantoraymond <[email protected]>
Co-authored-by: Felipe Madero <[email protected]>
Co-authored-by: sukantoraymond <[email protected]>
@felipemadero felipemadero self-assigned this Nov 26, 2024
Comment on lines +1071 to +1080
if network.Kind != models.Local {
if flag := cmd.Flags().Lookup(skipRelayerFlagName); flag != nil && !flag.Changed {
ux.Logger.PrintToUser("")
yes, err := app.Prompt.CaptureYesNo("Do you want to use set up a local interchain relayer?")
if err != nil {
return err
}
icmSpec.SkipRelayerDeploy = !yes
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whats the interchain relayer for? Is this meant for local network only?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise, if this is meant for non local network, lets just default to yes to setting up interchian and have the rewards sent to the same key that is paying for transaction

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

users can use flags to set these values

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the relayer is meant to be deployed automatically for local networks, and optionally for other networks.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in the case of local machines the relayer needs more work, as it is currently not working due to
the extra peers issue (relayer not supporting extra peers yet, there are branchs on relayer for how to fix
this but not merged/released yet)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so relayer is probably only going to work for non sovereign settings. maybe it is best for the moment
on to just default to no (for local machines)
no?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets default to no for local machines until those relayer prs are merged

@sukantoraymond
Copy link
Collaborator

sukantoraymond commented Nov 27, 2024

AVL-7H2W7V:avalanche-cli raymondsukanto$ ./bin/avalanche subnet deploy newSubnet2
✔ Yes
✔ Subnet-EVM
✔ Proof Of Authority
✔ Get address from an existing stored key (created from avalanche key create or avalanche key import)
✔ ewoq
✓ Validator Manager Contract owner address 0x8db97C7cEcE249c2b98bDC0226Cc4C2A57BF52FC
✔ I want to use defaults for a test environment
Chain ID: 123213
Token Symbol: AVAX
Token Symbol: AVAX
prefunding address 0x8db97C7cEcE249c2b98bDC0226Cc4C2A57BF52FC with balance 1000000000000000000000000
File /Users/raymondsukanto/.avalanche-cli/subnets/newSubnet2/chain.json successfully written
✓ Successfully created blockchain configuration
Run 'avalanche blockchain describe' to view all created addresses and what their roles are
✔ Local Network
Deploying [newSubnet2] to Local Network

Backend controller started, pid: 81891, output at: /Users/raymondsukanto/.avalanche-cli/runs/server_20241127_120947/avalanche-cli-backend.log

Installing avalanchego-v1.12.0...
Error: failed setting up local environment: unable to download binary: unexpected http status code: 404

Need to change to using latest avalanche go pre release version for local network. Seems that its trying to use avalanchego-v1.12.0 instead of avalanchego-v1.12.0-fuji

@sukantoraymond
Copy link
Collaborator

AVL-7H2W7V:avalanche-cli raymondsukanto$ ./bin/avalanche subnet deploy newSubnet2 --avalanchego-path=/Users/raymondsukanto/go/src/avalanchego/build/avalanchego
✔ Local Network
Deploying [newSubnet2] to Local Network

Backend controller started, pid: 91358, output at: /Users/raymondsukanto/.avalanche-cli/runs/server_20241127_122304/avalanche-cli-backend.log

Starting previously deployed and stopped snapshot
Booting Network. Wait until healthy...
Error: failed to start network with the persisted snapshot: rpc error: code = Unknown desc = error adding node node1: couldn't create new node process with binary "/Users/raymondsukanto/go/src/avalanchego/build/avalanchego" and args [--config-file=/Users/raymondsukanto/.avalanche-cli/runs/network_20241127_122306/node1/configs/config.json]: process failed before startup time of 1 seconds

Lets add message to use network clean to clean up this error

@sukantoraymond
Copy link
Collaborator

I got this error, avalanche go path is the 1.12-fuji tag

AVL-7H2W7V:avalanche-cli raymondsukanto$ ./bin/avalanche subnet deploy newSubnet2 --avalanchego-path=/Users/raymondsukanto/go/src/avalanchego/build/avalanchego
✔ Local Network
Deploying [newSubnet2] to Local Network

Backend controller started, pid: 91402, output at: /Users/raymondsukanto/.avalanche-cli/runs/server_20241127_122331/avalanche-cli-backend.log

Booting Network. Wait until healthy...

Node logs directory: /Users/raymondsukanto/.avalanche-cli/runs/network_20241127_122334/node<i>/logs

Network ready to use.

Using [P-custom18jma8ppw3nhx5r4ap8clazz0dps7rv5u9xde7p] to be set as a change owner for leftover AVAX
Your blockchain control keys: [P-custom18jma8ppw3nhx5r4ap8clazz0dps7rv5u9xde7p]
Your subnet auth keys for chain creation: [P-custom18jma8ppw3nhx5r4ap8clazz0dps7rv5u9xde7p]
CreateSubnetTx fee: 0.000010278 AVAX
Subnet has been created with ID: GEieSy2doZ96bpMo5CuHPaX1LvaxpKZ9C72L22j94t6YyUb6X
Now creating blockchain...
CreateChainTx fee: 0.000095682 AVAX
+--------------------+----------------------------------------------------+
| DEPLOYMENT RESULTS |                                                    |
+--------------------+----------------------------------------------------+
| Chain Name         | newSubnet2                                         |
+--------------------+----------------------------------------------------+
| Subnet ID          | GEieSy2doZ96bpMo5CuHPaX1LvaxpKZ9C72L22j94t6YyUb6X  |
+--------------------+----------------------------------------------------+
| VM ID              | qcvkEX1zWSz7WeDeqTLBfexcMNwgxmLrXeBt3xPT9ytotLDNS  |
+--------------------+----------------------------------------------------+
| Blockchain ID      | 2fhR3ZnXHheRfHtAevLnACrFp3JkmpwEpRq7x1PW7RxobhW88G |
+--------------------+                                                    +
| P-Chain TXID       |                                                    |
+--------------------+----------------------------------------------------+
Now calling ConvertSubnetToL1Tx...
ConvertSubnetToL1Tx fee: 0.000053832 AVAX
ConvertSubnetToL1Tx ID: 2E5o3NdrykNCYK1m2xrpy4F2HHsqbMydbs3eHHtnnC11Gadmqf
Waiting for L1 to be converted into sovereign blockchain ... 100% [===============]           

Restarting node node1 to track subnet
Restarting node node2 to track subnet
Waiting for http://127.0.0.1:9650/ext/bc/2fhR3ZnXHheRfHtAevLnACrFp3JkmpwEpRq7x1PW7RxobhW88G/rpc to be available
Waiting for http://127.0.0.1:9652/ext/bc/2fhR3ZnXHheRfHtAevLnACrFp3JkmpwEpRq7x1PW7RxobhW88G/rpc to be available
✓ Local Network successfully tracking newSubnet2
✓ Checking if node is healthy...
✓ Node is healthy after 0 seconds
Initializing Proof of Authority Validator Manager contract on blockchain newSubnet2 ...
✓ Proof of Authority Validator Manager contract successfully initialized on blockchain newSubnet2

RPC Endpoint: http://127.0.0.1:9650/ext/bc/2fhR3ZnXHheRfHtAevLnACrFp3JkmpwEpRq7x1PW7RxobhW88G/rpc
Teleporter Messenger successfully deployed to newSubnet2 (0x253b2784c75e510dD0fF1da844684a1aC0aa5fcf)
Teleporter Registry successfully deployed to newSubnet2 (0x807E4Bf2228dE466549284f78D8Bb82687E699dD)
Teleporter Messenger successfully deployed to c-chain (0x253b2784c75e510dD0fF1da844684a1aC0aa5fcf)
Teleporter Registry successfully deployed to c-chain (0x17aB05351fC94a1a67Bf3f56DdbB941aE6c63E25)

Generating relayer config file at /Users/raymondsukanto/.avalanche-cli/runs/network_20241127_122334/awm-relayer-config.json

{"level":"info","timestamp":"2024-11-21T14:25:21.700-0500","logger":"awm-relayer","caller":"main/main.go:101","msg":"Initializing awm-relayer"}
{"level":"info","timestamp":"2024-11-21T14:25:21.700-0500","logger":"awm-relayer","caller":"main/main.go:106","msg":"Set config options."}
{"level":"info","timestamp":"2024-11-21T14:25:21.700-0500","logger":"awm-relayer","caller":"main/main.go:109","msg":"Initializing destination clients"}
{"level":"info","timestamp":"2024-11-21T14:25:21.701-0500","logger":"awm-relayer","caller":"evm/destination_client.go:105","msg":"Initialized destination client","blockchainID":"NeA134STyTVwife7gYeNQ6Hwi5GPGC2X7aUFvWsnusnpM2do6","evmChainID":"43112","nonce":0}
{"level":"info","timestamp":"2024-11-21T14:25:21.702-0500","logger":"awm-relayer","caller":"evm/destination_client.go:105","msg":"Initialized destination client","blockchainID":"2G4nBDZs2w5JBzrPMvUSCrv87bBjrKBkmSTHKVF9pLwScNJjz","evmChainID":"123123","nonce":0}
{"level":"info","timestamp":"2024-11-21T14:25:21.702-0500","logger":"awm-relayer","caller":"main/main.go:117","msg":"Initializing source clients"}
{"level":"info","timestamp":"2024-11-21T14:25:21.702-0500","logger":"awm-relayer","caller":"main/main.go:132","msg":"Initializing app request network"}
{"level":"info","timestamp":"2024-11-21T14:25:21.716-0500","logger":"awm-relayer","caller":"main/main.go:550","msg":"starting metrics server...","port":9091}
{"level":"info","timestamp":"2024-11-21T14:25:21.717-0500","logger":"awm-relayer","caller":"main/main.go:436","msg":"Creating application relayers","originBlockchainID":"NeA134STyTVwife7gYeNQ6Hwi5GPGC2X7aUFvWsnusnpM2do6"}
{"level":"info","timestamp":"2024-11-21T14:25:21.717-0500","logger":"awm-relayer","caller":"main/main.go:447","msg":"processed-missed-blocks set to false, starting processing from chain head","blockchainID":"NeA134STyTVwife7gYeNQ6Hwi5GPGC2X7aUFvWsnusnpM2do6"}
{"level":"info","timestamp":"2024-11-21T14:25:21.717-0500","logger":"awm-relayer","caller":"checkpoint/checkpoint.go:40","msg":"Creating checkpoint manager","relayerID":"0xc8faec6bd273d032d10a6f9b670e21f7df8dc4bf9138cbc54fe399b1b0f88ccc","startingHeight":5}
{"level":"info","timestamp":"2024-11-21T14:25:21.717-0500","logger":"awm-relayer","caller":"checkpoint/checkpoint.go:40","msg":"Creating checkpoint manager","relayerID":"0x8b66eaada9097e7c6999ef30350adc57bcc799751817eda9f07c42c356616908","startingHeight":5}
{"level":"info","timestamp":"2024-11-21T14:25:21.717-0500","logger":"awm-relayer","caller":"main/main.go:413","msg":"Created application relayers","blockchainID":"NeA134STyTVwife7gYeNQ6Hwi5GPGC2X7aUFvWsnusnpM2do6"}
{"level":"info","timestamp":"2024-11-21T14:25:21.717-0500","logger":"awm-relayer","caller":"main/main.go:436","msg":"Creating application relayers","originBlockchainID":"2G4nBDZs2w5JBzrPMvUSCrv87bBjrKBkmSTHKVF9pLwScNJjz"}
{"level":"info","timestamp":"2024-11-21T14:25:21.717-0500","logger":"awm-relayer","caller":"main/main.go:447","msg":"processed-missed-blocks set to false, starting processing from chain head","blockchainID":"2G4nBDZs2w5JBzrPMvUSCrv87bBjrKBkmSTHKVF9pLwScNJjz"}
{"level":"info","timestamp":"2024-11-21T14:25:21.717-0500","logger":"awm-relayer","caller":"checkpoint/checkpoint.go:40","msg":"Creating checkpoint manager","relayerID":"0xa19f2dab73852ceca92f751befd5a741d4bb5434e466758358096bf9b0393529","startingHeight":3}
{"level":"info","timestamp":"2024-11-21T14:25:21.717-0500","logger":"awm-relayer","caller":"checkpoint/checkpoint.go:40","msg":"Creating checkpoint manager","relayerID":"0x3c544cb704af8f9419ea97cf3c3b4cd043ff74c2cb639ced4a8f8388dde21b9a","startingHeight":3}
{"level":"info","timestamp":"2024-11-21T14:25:21.717-0500","logger":"awm-relayer","caller":"main/main.go:413","msg":"Created application relayers","blockchainID":"2G4nBDZs2w5JBzrPMvUSCrv87bBjrKBkmSTHKVF9pLwScNJjz"}
{"level":"info","timestamp":"2024-11-21T14:25:21.717-0500","logger":"awm-relayer","caller":"main/main.go:288","msg":"Initialization complete"}
{"level":"info","timestamp":"2024-11-21T14:25:21.718-0500","logger":"awm-relayer","caller":"relayer/listener.go:119","msg":"Creating relayer","subnetID":"11111111111111111111111111111111LpoYY","subnetIDHex":"0000000000000000000000000000000000000000000000000000000000000000","blockchainID":"NeA134STyTVwife7gYeNQ6Hwi5GPGC2X7aUFvWsnusnpM2do6","blockchainIDHex":"31233cae135e3974afa396e90f465aa28027de5f97f729238c310d2ed2f71902"}
{"level":"info","timestamp":"2024-11-21T14:25:21.718-0500","logger":"awm-relayer","caller":"evm/subscriber.go:163","msg":"Successfully subscribed","blockchainID":"NeA134STyTVwife7gYeNQ6Hwi5GPGC2X7aUFvWsnusnpM2do6"}
{"level":"info","timestamp":"2024-11-21T14:25:21.718-0500","logger":"awm-relayer","caller":"relayer/listener.go:67","msg":"Listener initialized. Listening for messages to relay.","originBlockchainID":"NeA134STyTVwife7gYeNQ6Hwi5GPGC2X7aUFvWsnusnpM2do6"}
{"level":"info","timestamp":"2024-11-21T14:25:21.718-0500","logger":"awm-relayer","caller":"evm/subscriber.go:62","msg":"Processing historical logs","fromBlockHeight":"5","blockchainID":"NeA134STyTVwife7gYeNQ6Hwi5GPGC2X7aUFvWsnusnpM2do6"}
{"level":"info","timestamp":"2024-11-21T14:25:21.720-0500","logger":"awm-relayer","caller":"relayer/listener.go:119","msg":"Creating relayer","subnetID":"26eqgD4Kt1MvTKXC9BDjEwBAfhcBcHCKj2EXjR2UuFpSWoAHhw","subnetIDHex":"9087d2f383171f73819baa49c3be63a5a6e2b492114dfc3556e42eedd182050a","blockchainID":"2G4nBDZs2w5JBzrPMvUSCrv87bBjrKBkmSTHKVF9pLwScNJjz","blockchainIDHex":"02dc435d9369bcd4060ccde47dddaa9d12dda92d28cb08eccebc9f1f83ae52e0"}
{"level":"info","timestamp":"2024-11-21T14:25:21.720-0500","logger":"awm-relayer","caller":"evm/subscriber.go:163","msg":"Successfully subscribed","blockchainID":"2G4nBDZs2w5JBzrPMvUSCrv87bBjrKBkmSTHKVF9pLwScNJjz"}
{"level":"info","timestamp":"2024-11-21T14:25:21.720-0500","logger":"awm-relayer","caller":"relayer/listener.go:67","msg":"Listener initialized. Listening for messages to relay.","originBlockchainID":"2G4nBDZs2w5JBzrPMvUSCrv87bBjrKBkmSTHKVF9pLwScNJjz"}
{"level":"info","timestamp":"2024-11-21T14:25:21.720-0500","logger":"awm-relayer","caller":"evm/subscriber.go:62","msg":"Processing historical logs","fromBlockHeight":"3","blockchainID":"2G4nBDZs2w5JBzrPMvUSCrv87bBjrKBkmSTHKVF9pLwScNJjz"}
{"level":"error","timestamp":"2024-11-21T16:08:54.034-0500","logger":"awm-relayer","caller":"relayer/listener.go:203","msg":"Received error from subscribed node","sourceBlockchainID":"NeA134STyTVwife7gYeNQ6Hwi5GPGC2X7aUFvWsnusnpM2do6","error":"websocket: close 1006 (abnormal closure): unexpected EOF"}
{"level":"error","timestamp":"2024-11-21T16:08:54.035-0500","logger":"awm-relayer","caller":"evm/subscriber.go:191","msg":"Failed to subscribe to logs","blockchainID":"NeA134STyTVwife7gYeNQ6Hwi5GPGC2X7aUFvWsnusnpM2do6","error":"read tcp 127.0.0.1:61182->127.0.0.1:9650: read: connection reset by peer"}
{"level":"warn","timestamp":"2024-11-21T16:08:54.035-0500","logger":"awm-relayer","caller":"evm/subscriber.go:170","msg":"Failed to subscribe to node","attempt":1,"blockchainID":"NeA134STyTVwife7gYeNQ6Hwi5GPGC2X7aUFvWsnusnpM2do6","error":"read tcp 127.0.0.1:61182->127.0.0.1:9650: read: connection reset by peer"}
{"level":"error","timestamp":"2024-11-21T16:08:54.039-0500","logger":"awm-relayer","caller":"relayer/listener.go:203","msg":"Received error from subscribed node","sourceBlockchainID":"2G4nBDZs2w5JBzrPMvUSCrv87bBjrKBkmSTHKVF9pLwScNJjz","error":"websocket: close 1006 (abnormal closure): unexpected EOF"}
{"level":"error","timestamp":"2024-11-21T16:08:54.041-0500","logger":"awm-relayer","caller":"evm/subscriber.go:191","msg":"Failed to subscribe to logs","blockchainID":"2G4nBDZs2w5JBzrPMvUSCrv87bBjrKBkmSTHKVF9pLwScNJjz","error":"read tcp 127.0.0.1:61183->127.0.0.1:9650: read: connection reset by peer"}
{"level":"warn","timestamp":"2024-11-21T16:08:54.044-0500","logger":"awm-relayer","caller":"evm/subscriber.go:170","msg":"Failed to subscribe to node","attempt":1,"blockchainID":"2G4nBDZs2w5JBzrPMvUSCrv87bBjrKBkmSTHKVF9pLwScNJjz","error":"read tcp 127.0.0.1:61183->127.0.0.1:9650: read: connection reset by peer"}

Error: invalid version string: awm-relayer/v1.5.1

@sukantoraymond
Copy link
Collaborator

also seems that we are only spinning up 2 nodes on local network? Why 2 nodes?

@@ -50,7 +57,16 @@ func start(_ *cobra.Command, _ []string) error {
return err
}
switch {
case network.Kind == models.Local || network.Kind == models.Fuji:
case network.ClusterName != "":
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this check is enough to decide if cluster is remote and ssh needed?
Do we need to also load ClusterConfig and check clusterConf.Local ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls ignore this comment. This is code that was tested already and just moved within code

cmd.Flags().StringVar(&startFlags.AvagoBinaryPath, "avalanchego-path", "", "use this avalanchego binary path")
cmd.Flags().StringVar(&startFlags.RelayerBinaryPath, "relayer-path", "", "use this relayer binary path")
cmd.Flags().StringVar(&startFlags.SnapshotName, "snapshot-name", constants.DefaultSnapshotName, "name of snapshot to use to start the network from")
cmd.Flags().Uint32Var(&startFlags.NumNodes, "num-nodes", constants.NumDefaultLocalNetworkNodes, "number of nodes to be created on local network")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: NumDefaultLocalNetworkNodes should be LocalNetworkNumNodes

if err != nil {
return err
}
if configStr != "" {
loadSnapshotOpts = append(loadSnapshotOpts, client.WithGlobalNodeConfig(configStr))
if nodeConfig == "" {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should app.Conf.LoadNodeConfig() return "{}" right away ?

ux.Logger.PrintToUser("")
ux.Logger.PrintToUser("Network ready to use.")
ux.Logger.PrintToUser("")
snapshotPath := filepath.Join(app.GetSnapshotsDir(), "anr-snapshot-"+flags.SnapshotName)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: we use "anr-snapshot-" prefix in multiple places. Should we have a single func that returns snapshotPath for the name?

snapshotPath := filepath.Join(app.GetSnapshotsDir(), "anr-snapshot-"+flags.SnapshotName)
if utils.DirectoryExists(snapshotPath) {
var startMsg string
if flags.SnapshotName == constants.DefaultSnapshotName {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: not worth displaying snapshot name for the user if it was provided by the user anyway.
so we don't need this if else statement

@@ -0,0 +1,16 @@
{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the same file as pkg/constants/etnaDevnet/upgrade.json no need to create another file here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Review 👀
Development

Successfully merging this pull request may close these issues.

3 participants