If you want to learn some internals about Goloop and its Java Execution Engine (JavaEE), you may be interested in runing goloop natively without relying on Docker.
You should have built goloop 0.9.5 successfully already. If you don’t have it compiled yet, you may refer to the previous article for doing so. Please be aware that the instructions from this article may not work for another goloop version.
TLDR ; if you want to build and run goloop locally with JavaEE, drop this script to your goloop root directory and run it: https://gist.github.com/ICONationTeam/c50e9d9a036b97fe7d0a7e9c04c3d918
I’ll detail the steps here from this script if you prefer installing goloop step by step :
1. Build the JavaEE Native Client
First step is to build a native client that will communicate with the JavaEE :
You may need to change the folder where you java11 openjdk is installed.
2. Build gstool
Next we need to build gstool by doing so :
3. Build execman
Then we need execman, a component from the JavaEE :
4. Install JavaEE
Now that we’ve build execman, we can prepare JavaEE :
5. Prepare goloop work directory
We’re going to create the directory where goloop will be executed, and add that path to the PATH environment variable :
6. Initialize goloop
Everything should be prepared at this point, now we need to configure goloop environment variables and point them to our goloop installation folder.
You may want to configure ports and the log filename if you need to. Please note that we’ll be working from the goloop directory after this point.
7. Initialize the genesis block
Before starting the chain, we need to configure the genesis block :
8. Preparing the chain
We’ll create a chain and write the network id (nid) to a “nid” file in the goloop working directory folder
9. Start the chain!
Finally, we can start the chain and create blocks :
At this point you should have a working goloop engine running locally. Check the log file if there’s any issue.
10. Deploy your Java SCORE locally
Now that we’ve built and run goloop locally, we can deploy Java SCOREs by using this goloop command (refer to the previous article if you need to build your Java SCORE)
You will need to fix the directory path in the previous to the path where you built goloop : key_store and nid needs to be changed.
That previous command should return a transaction hash ; Mine was 0xd86df21e16c4b0ada685bef0629473987d68784edaa55a45700dff3bfe6cd61a. Check for its result :
If the status is 0x1, well done, you successfully deployed your SCORE locally ! 🏆
📜 Entire script
Now you can put all the previous steps together and create a single or multiple scripts for doing these tasks. Here’s mine :