Deploy a VM

After you have created your Multi-Chain Network, you can deploy a VM on it.

The pre-requisite for this tutorial is that you have already added a Juneo Supernet validator node, created a Multi-Chain Network and added a MCN validator.

We will be using the example files found in the repository juneogo-examples to deploy an EthereumVM on our existing MCN.

Please make sure that you have Node.JS installed on your system, along with the npm package ts-node (which will be used to execute the sample code provided in JuneoJS).

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 = 220222

const genesisMintAddress: string = '0x44542FD7C3F096aE54Cc07833b1C0Dcf68B7790C' // your wallet address here

Never use the same chainId value more than once- this can cause unexpected errors for your MCN chains in the future.

Please make sure to specify the chainId variable to a value that is not already taken by another chain. For the Socotra Testnet, please use a random number from 200,000 - 299,999.

For Mainnet, please use a number starting from 45,015.

Avoid assigning thechainId variable a number with repetative digits (such as 224455, 222444, 222222, 242424 or similar).

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 Supernet 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"

If you are using juneogo-docker to run your node, the http-host flag should remain unchanged.

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 MCN and Blockchain data to us for indexation.

Before proceeding with the next step, please perform a few transactions on your chain using MetaMask, such as sending some tokens to any address.

Please submit your MCN 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

Please use unique descriptive names for your MCN and Blockchain. Avoid names such as "Test Supernet" or "Test Blockchain".

Example:

Supernet
- Name: Supernet ABC
- Description: This is a supernet created by
- id: ZxTjijy4iNthRzuFFzMH5RS2BgJemYxwgZbzqzEhZJWqSnwhP

Blockchain
- Name: Chain ABC
- Description: This is a Blockchain developed by
- Currency: ABC22
- Decimals: 18
- Host: http://XXX.XXX.XXX.XXX:9650 
- rpc: http://XXX.XXX.XXX.XXX:9650/ext/bc/2LxhUB7z7yxvBkHiiwp8MrALgy7rka3y6MriL2JAeX858wUK5D/rpc
- Logo: [your_logo_goes_here]
- id: 2LxhUB7z7yxvBkHiiwp8MrALgy7rka3y6MriL2JAeX858wUK5D

Last updated