Create a Layer-1 Network
Creating a Layer-1 Network (which will allow us to later deploy our own VM)
Last updated
Creating a Layer-1 Network (which will allow us to later deploy our own VM)
Last updated
We will be using example code found in the repository to deploy our Layer-1 Blockchain (which uses the library ).
First, please make sure that you have the latest version of installed on your system.
If the version of NodeJS on your system is not up to date with the LTS version found at , the scripts in this guide will not be able to execute.
You will also need have the npm package installed, which will be used to execute the sample code provided in JuneoJS.
After verifying the information above, please download the repository to your local machine. If you have installed on your system, please execute the following in your command line:
The required files will be found in the directory juneojs-examples
.
Next, please open juneojs-examples
in a command line and execute the following command:
After this, open juneojs-examples
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:
To perform the transactions required to deploy a Layer-1 Network, you will need to have funds on the P-chain. In this tutorial, we will first be crossing assets from the JUNE-chain to the JVM-chain, and then from the JVM-chain to the P-chain.
In a command line window open in the root of the JuneoJS library, execute the following:
This will cross 1.1 JUNE from the JUNE-chain to the JVM-chain. After this, we will cross 1 JUNE from the JVM-chain to the P-chain by executing the following command:
The next step is the L1 Network creation. Please execute the following in the command line:
This will produce an output to the terminal containing your supernetID. Example: ZxTjijy4iNthRzuFFzMH5RS2BgJemYxwgZbzqzEhZJWqSnwh.
This is the id of the transaction that has created your L1, and is the id of the Layer-1 Network as well. Please save it as we will needed in the following steps.
The next step is to perform the addSupernetValidator transaction.
Please open the file ./src/supernet/addSupernetValidator.ts
in your code editor, and update the following variables to contain the correct values. Example:
We will keep the durationInDays variable the same. However, you may update it to a diffent value.
Then, execute this file:
This will add our node as a validator for our Layer-1 Network. However, we need to perform an additional step before our node can begin validating our L1. First, please stop your node.
In your config.json
file, please include the configuration flag track-supernets,
specifying the L1s you want your node to track (in this case, the Layer-1 you have just created).
Example:
After saving the file, you may run your node again.
Your node is now tracking the Layer-1 Network you have just created.
For users following the guide for setting up juneogo: please create a file titled config.json
in the home directory.
For users following the guide for setting up juneogo: your config.json
can already be found in the home directory.
For users who are running juneogo using : your config file can be found in the juneogo-docker/juneogo/.juneogo/config.json
directory.
For users following the juneogo setup guide, please execute the following :
For users following the juneogo setup guide, please restart the juneogo service:
For users running juneogo using , please re-start your node using docker compose.
You may now proceed to the next step: .