Running goloop 0.9.5+JavaEE natively (without Docker) ☕

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 :

{                                                                                                                                                              
"to": "cx0000000000000000000000000000000000000000",
"cumulativeStepUsed": "0x3d70a5c3",
"stepUsed": "0x3d70a5c3",
"stepPrice": "0x0",
"eventLogs": [],
"logsBloom": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000",
"status": "0x1",
"scoreAddress": "cx61cbb66ec604649e233d8432e1ecf2cbb56572f4",
"blockHash": "0x19be58d082d40e043888648852159e8dcf51cd7c5688e64b863cca43e7937e7a",
"blockHeight": "0x27",
"txIndex": "0x0",
"txHash": "0xd86df21e16c4b0ada685bef0629473987d68784edaa55a45700dff3bfe6cd61a"
}

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 :

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store