top of page
Search

How to create your own XYO Node

Got some exciting news to share about XYO and that is the XYO Node. As of today, I can say I have successfully built my own XYO Node without any errors. Yes, there are still a few features not available yet but as it stands you can create your own node today and be live on XYO Explore!!!


I'm going to walk you through a few necessary steps to get the XYO Node installed. Let's first make sure you have all the needed software to install the Node.


This setup will be done from a Windows PC. MacOS and Linux are also supported but today I'll be using a Windows PC to complete the setup of the node. You will need some technical experience as this will involve knowing your way around the Windows environment. Mostly PowerShell, Windows Explorer, and WSL.



Prep Work Required


1. We need to install WSL 2 on your PC. This will be needed to run the XYO Node. To install WSL 2 we need to open Windows PowerShell with Administrator permissions.

2. With PowerShell open, type "wsl.exe --install" and press the enter key to start the installation. As a note, your PC will need to have Windows 10 OS Build 2004 or later for this command to work.

3. As soon as you hit enter the process gets to work enabling WSL, and any optional features required, fetching the latest WSL Linux kernel version, and installing Ubuntu as the default distro.

4. Once done, reboot your computer. Log into Windows 10 and the command prompt will open again. This time you’ll be walked through setting up Ubuntu with a username and password (these don’t need to be the same as your Windows username and password).

5. Once done, you can launch the ‘Ubuntu’ app from the Start Menu to get started, or install the Microsoft Terminal app to start exploring your newly-installed Ubuntu install.

6. We are now ready to install Yarn and Node.JS for Linux.

7. Open PowerShell and complete the following to install Node.JS for Linux.

8. Type, "wsl" followed by enter key.

9. Type, "sudo apt-get update" followed by enter key.

10. Type, "sudo apt-get upgrade" followed by enter key.

11. Type, "curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - &&\" followed by enter key.. Type "sudo apt-get install -y nodejs" followed by enter key.

12. To make sure node.js is installed, type "node --version". If all goes well, it will give you a version number of the installed node.js.

13. Node.JS will also install yarn as well. Let's make sure that occurred. To do this, type "yarn --version" followed by enter key.

14. We are now ready to download and install XYO Node!!!


Installation of XYO Node


1. In WSL run the command, "git clone https://github.com/XYOracleNetwork/sdk-xyo-client-js.git" followed by enter key. This will download the latest version of the SDK package for the XYO JS Client.

2. Wait for the download to complete.

3. Once the download is complete, type "cd sdk-xyo-client-js" followed by enter key.

4. Now type "yarn install" followed by enter key. This will install all required packages for XYO Node to run on your PC.

5. Once install is complete type "yarn xy compile" followed by enter key. This will compile the XYO Node and get it ready for use.

6. Now we are ready to set up your node. We first need to make sure the node connects to your XYO Explore account. To do this we need to get the Seed Phrase on your account. Remember this is for your use only and should never be shared with anyone.

7. Navigate over to https://explore.xyo.network/settings?network=main and click on "Update" for Seed Phrase. You will be given your seed. Write this down as you will need it to configure the XYO Node connection.

8. Now we are ready to make a single adjustment in the config file. To do this we need to get the path where XYO Node downloaded to. You can get this from the PowerShell window. In the PowerShell window, you should see something similar to, "/mnt/c/XYO/sdk-xyo-client-js-main$". We want to focus on "/mnt/c/XYO" as this will tell you the exact location where XYO Node is downloaded to. In my case, we will ignore the /mnt/ in the path and look at c/XYO. What this is telling me there is a folder on the C: drive root called XYO. You most likely will have a different location than I as I customize the download location by navigating to the C drive and creating a folder called XYO. Afterward, I used the CD command in PowerShell to get into the XYO folder. From there I used the command in Step 1 above.

9. Now we know where the XYO Node folder is located. Let's use Windows Explorer and navigate to that folder.

10. Once you are in the XYO Node folder called, "sdk-xyo-client-js-main" then you will need to look for a file called "example.env" What we need to do is delete the example from the filename and only keep .env in the name of the file.

11. After you have renamed "example.env" to ".env" then we are ready to open the file using a text editor. I'm using Notepad++

12. Once you have the env file opened in a text editor we are then ready to make one change. What we will be focusing on is the line that starts out with "MNEMONIC=". Here we will overwrite the current Seed Phrase with your Seed Phrase.

13. After you have deleted the previously entered Seed Phrase and replaced it with yours we are ready to save the changes. In most cases it's simply clicking on File > Save.

14. That is all we need to do here so let's start the next step which will involve Docker Desktop. You will need to download and install Docker from https://www.docker.com/products/docker-desktop

15. After you have docker installed, you will need to restart the PC. Make note of the location where "sdk-xyo-client-js-main" is located.

16. Once you have rebooted your PC you will need to install XYO Node to Docker. To do this we need to install it from the "sdk-xyo-client-js-main" folder. What I find easier is to use Windows Explorer and navigate to the path where "sdk-xyo-client-js-main" is installed. Go into the "sdk-xyo-client-js-main" folder and in the empty space (white area) right click and select "Open in Terminal". The other method is to open PowerShell and use CD commands to get into your "sdk-xyo-client-js-main" folder.

17. Once you are in the "sdk-xyo-client-js-main" folder in PowerShell . This time we are NOT going to go into WSL as we need PowerShell to setup Docker with XYO Node.

18. Type, "Docker compose up" followed by enter key.

19. Wait for the download to complete.

20. After the download completes, the docker will automatically bring up the XYO Node. If you see anything similar to this then Docker is running XYO Node.

NOTE: After each restart of the PC, Docker will automatically startup and bring the XYO Mongo databases for you. All you will need to do is start the XYO Nodes manually. This will be the "Yarn Start" and "Yarn XYO" commands in WSL.

21. Open another PowerShell and navigate over to the "sdk-xyo-client-js-main" folder. Once you are in the "sdk-xyo-client-js-main" folder you can type, "WSL" followed by enter key.

22. Type, "Yarn Start" followed by enter key.

23. This could take a few to load but if all goes well, XYO Diviner should start for you and be hosted on http://localhost:8080

24. If you see this then you are ready to bring up the XYO Node (Sentinel). To do this, Open another PowerShell session and navigate over to the "sdk-xyo-client-js-main" folder. Once you are in the "sdk-xyo-client-js-main" folder you can type, "WSL" followed by enter key.

25. Type "Yarn XYO" followed by enter key.

26. After a few you should receive a Connected to Node and Bridge.

27. If you got this far, that means you have successfully built the XYO Client JS on your PC. From here you can start working on your development project to be used with the nodes on your PC.

28. Before I go, let's check out XYO Explore (https://explore.xyo.network/?network=main).

29. Change the connection type from Main to Local. What you should see is something similar to what you see in the below image. If you see this, then you will be able to start development on your project that can connect to XYO blockchain via Local Node. That means all Blocks, Payloads, and Schemas you use will be recorded on the blockchain under the local node you are using which is tied to the Seed Phase as we mentioned earlier. So it's very important for you to keep that key in a very safe place.





607 views0 comments

Recent Posts

See All
bottom of page