Developing Ardor Java Add-on at the NFEA Ardor/Ignis Workshop 22.3.18

The Ardor Workshop

On Thursday (March 22, 2018) I delivered what probably was the first ever developers workshop for the Ardor and Nxt blockchain platforms.

The workshop took place in Kristiansand, Norway and was attended by interested business representatives and local university students.

The time allocated for the workshop was between 8:30 and 16:00 and I wanted to squeeze as much substance as possible to this rare event.

Given that most of the attendees did not have much Java or Javascript knowledge and never developed decentralized applications (let alone knew what they were), I was faced with the challenge of making this day useful.

I therefore decided to dedicate the first morning session to non-technical general blockchain background lecture. In addition, I prepared a simplified environment setup to make sure users are up and running quickly with as little configuration issues as possible.

The steps I took to prepare the development environment are listed here in case someone wants to reuse them

  • git clone https://bitbucket.org/Jelurida/ardor/src/ into your working folder. All relative paths in the next steps are relative to the generated folder. You can rename the folder but make sure this folder has full permissions
  • Create the file conf/nxt.properties
  • Add the lines nxt.isTestnet=true and nxt.testnetNumberOfForkConfirmations=0 to nxt.properties to setup testnet and ensure smooth blockchain download
  • Download the Ardor testnet database from the Jelurida web site if necessary. From the downloaded zip, copy the nxt_test_db folder into your working folder
  • Copy the .idea folder and .iml file (IntelliJ project files) from ./ide/intellij/project to .
  • From the ./html/www/js folder invoke the command npm -i to download the node module dependencies
  • Zip the working folder and deliver it to your students

The students will then need to:

  • Install Oracle Java SDK 1.8.0 latest
  • Install JetBrains IntelliJ Community Edition
  • Install Node.js
  • Unzip the zipped working folder you provided
  • Start IntelliJ and open the Ardor working folder as an existing project in IntelliJ
  • Build the Project after pointing IntelliJ to the Java SDK
  • Edit the NXT Desktop runtime configuration and remove the -Dnxt.runtime.mode=desktop -Djava.security.policy=nxtdesktop.policy vm argument. In my view, for development it is more convenient not to use the desktop wallet and run the wallet in the browser instead using localhost:26786
  • Run the project and wait for it to download the remaining testnet blocks. Expect some node connection issues at least initially

Whoever is interested to setup the development environment on his own laptop, can also follow these steps without the need to zip and unzip the working folder. Install all the required software upfront.

Using this setup, all students were able to get the Ardor development environment up and running in less than 30 minutes.

Lesson for next time is to ask students to install the required software upfront, to save time.

The next challenge was to fund user accounts with testnet tokens. Here I wanted users to create their own account to understand the process. But then they had to fund it manually which took some time. Also need to make sure bundlers are available on the testnet since this is not guaranteed.

Lesson for next time, setup a shared folder or upload site for all students so that they can quickly send each other account addresses.

Once we completed this setup, students who never used Java and Javascript before, were able to follow my examples like coding gurus.

We run some Node JS samples, looked into the APIs, DBShell, Bundlers and even created a simple Add-on class. Overall this turned out to be a useful workshop and I definitely intend to perform more of these workshops in the future.