Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ You can configure this package using the JSON structure below. The default value
"num-nodes": 3,

"node-cfg": {
// network id that nodes use to know where to connect, by default this is 1337 - which indicates a local avalanche network
// network id that nodes use to know where to connect, by default this is 1337 - which indicates a local avalanche network, options available are:
// 1337 - local network (default)
// fuji - connects fuji test network. note: connecting to fuji only works with one local node
"network-id": "1337",
"staking-enabled": false,
"health-check-frequency": "5s"
Expand Down Expand Up @@ -101,8 +103,12 @@ You can configure this package using the JSON structure below. The default value
},

// cpu arch of machine this package runs on
// this is only required when spinning up non subnetevm chains, defaults to arm64
"cpu-arch": "arm64"
// this is only required when spinning up non-subnetevm chains(eg. morpheusvm), defaults to arm64
"cpu-arch": "arm64",

// if running subnetevm l1s, this is the version of subnet evm that will be used
// default: 0.6.12
"subnet-evm-version": "0.6.12"
}
```

Expand Down
3 changes: 2 additions & 1 deletion constants.star
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ DEFAULT_AVALANCHEGO_IMAGE = "avaplatform/avalanchego:v1.12.0-fuji"

HYPERSDK_AVALANCHEGO_IMAGE = "aaronbuchwald/morpheusvm:docker"

DEFAULT_SUBNET_EVM_BINARY_URL_FMT_STR = "https://github.com/ava-labs/subnet-evm/releases/download/v0.6.12/subnet-evm_0.6.12_linux_{0}.tar.gz"
DEFAULT_SUBNET_EVM_VERSION = "0.6.12"
DEFAULT_SUBNET_EVM_BINARY_URL_FMT_STR = "https://github.com/ava-labs/subnet-evm/releases/download/v{0}/subnet-evm_{0}_linux_{1}.tar.gz"

DEFAULT_VM_NAME = "subnetevm"

Expand Down
3 changes: 2 additions & 1 deletion main.star
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ def run(plan, args):
chain_configs = args.get('chain-configs', [])
additional_services = args.get('additional-services', {})
codespace_name = args.get('codespace-name', "")
subnet_evm_version = args.get('subnet-evm-version', constants.DEFAULT_SUBNET_EVM_VERSION)
cpu_arch = args.get("cpu-arch", "arm64") # only needs to be set now to get the correct morpheusvm path, once morpheusvm binaries are pulled from releases can detect cpu of architecture

vm_name = utils.get_vm_name(chain_configs)
subnet_evm_binary_url = utils.get_subnet_evm_url(plan, chain_configs)
subnet_evm_binary_url = utils.get_subnet_evm_url(plan, subnet_evm_version, chain_configs)
avalanche_go_image = utils.get_avalanchego_img(chain_configs)

# create builder, responsible for scripts to generate genesis, create subnets, create blockchains
Expand Down
4 changes: 2 additions & 2 deletions utils.star
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ def write_contents_to_file(plan, service_name, filename, content):
)
return output["output"]

def get_subnet_evm_url(plan, chain_configs):
def get_subnet_evm_url(plan, subnet_evm_version, chain_configs):
cpu_arch_result = plan.run_sh(
description="Determining cpu architecture",
run="/bin/sh -c \"[ \"$(uname -m | tr -d '\n')\" = \"arm64\" ] || [ \"$(uname -m | tr -d '\n')\" = \"aarch64\" ] && echo -n arm64 || echo -n amd64\""
)
cpu_arch = cpu_arch_result.output
plan.print("Detected CPU arch: {0}".format(cpu_arch))
return constants.DEFAULT_SUBNET_EVM_BINARY_URL_FMT_STR.format(cpu_arch)
return constants.DEFAULT_SUBNET_EVM_BINARY_URL_FMT_STR.format(subnet_evm_version, cpu_arch)

def get_morpheusvm_binary_path(plan, cpu_arch):
return "./l1/vms/morpheusvm/linux-{0}/pkEmJQuTUic3dxzg8EYnktwn4W7uCHofNcwiYo458vodAUbY7".format(cpu_arch)
Expand Down