▶️Deploy a VM
After you have created your Supernet, you can deploy a VM on it.
We will be using the example files found in the repository juneogo-examples to deploy an supernetevm on our existing Supernet.
Deploying a VM
Assuming you have followed the steps for creating a supernet, you should have the juneojs-examples folder available. Open juneojs-examples directory in a code editor of your choice, create a .env file from the provided .env.example, and paste your mnemonic phrase in the MNEMONIC variable. Example:
MNEMONIC="raven whip pave toy benefit moment twin acid wasp satisfy crash april"
Next, open the file ./src/supernet/createChain.ts
. Please find and update the following variables to contain the correct values. Example:
const supernetId: string = 'ZxTjijy4iNthRzuFFzMH5RS2BgJemYxwgZbzqzEhZJWqSnwhP' // your supernet id
const chainName: string = 'Chain A'
const chainId: number = 330333
const genesisMintAddress: string = '0x44542FD7C3F096aE54Cc07833b1C0Dcf68B7790C' // your wallet address here
Never use the same chainId value more than once- this can cause unexpected errors for your Supernet chains in the future.
After this, execute this file in the command line using ts-node:
npx ts-node ./src/supernet/createChain.ts
Your command line output should resemble the following, indicating that your VM was successfully deployed:
Created chain with id: 2LxhUB7z7yxvBkHiiwp8MrALgy7rka3y6MriL2JAeX858wUK5D
Indexation of your chain on the explorer
For your chain to be eligible for indexation on the explorer, you will need to disable pruning for your newly created chain, allowing archive node functionality. This is done by creating a config.json
file on your JUNEO validator node in the location .juneogo/configs/chains/chainId.
For a chain which has the id of 2LxhUB7z7yxvBkHiiwp8MrALgy7rka3y6MriL2JAeX858wUK5D
, you would execute the following commands from the home directory:
cd .juneogo
mkdir configs
cd configs
mkdir chains
cd chains
mkdir 2LxhUB7z7yxvBkHiiwp8MrALgy7rka3y6MriL2JAeX858wUK5D
cd 2LxhUB7z7yxvBkHiiwp8MrALgy7rka3y6MriL2JAeX858wUK5D
nano config.json
Next, paste the following inside the config.json
file:
{
"pruning-enabled": false,
"eth-apis": ["public-eth", "public-eth-filter","net","web3","internal-public-eth","internal-public-blockchain","internal-public-transaction-pool","internal-public-debug","debug-tracer"]
}
In addition to this, it is required that your node accepts API calls from remote machines. For this, we have to make updates to the config.json
file our node is using.
This file should include the http-host
config flag, and it's value should be set to your public IP address. Example:
"http-host":"XXX:XXX:XXX:XXX"
Following the previous steps from the documentation, this config.json
file should include the following lines:
{
"track-supernets":"ZxTjijy4iNthRzuFFzMH5RS2BgJemYxwgZbzqzEhZJWqSnwhP",
"http-host":"XXX.XXX.XXX.XXX"
}
After updating this file, please re-start your node.
The next step is to submit your Supernet and Blockchain data to us for indexation.
Please submit your Supernet and Blockchain information to us in the following format:
Supernet
- Name
- Description
- id
Blockchain
- Name
- Description
- Currency (in ALL-CAPS format)
- Decimals
- Host (http://xxx.xxx.xxx.xxx:9650 or with domain name)
- rpc (http://xxx.xxx.xxx.xxx:9650/ext/bc/id/rpc)
- Logo (min 273x273 or greater.
In .png format.
The width:height ratio should be 1:1)
- id
Last updated
Was this helpful?