Skip to content

How to load the aion project and debug the kernel on IntelliJ IDEA

AionJayT edited this page Mar 10, 2020 · 2 revisions

The aion Java kernel use gradle as the repo build system. You should be able to load the project with the IDE support the gradle build tool. For example, IntelliJ IDEA, Eclipse for java

Load the aion project on IntelliJ IDEA

After installed the IntelliJ IDEA and download the aion repo from the github(See Build Aion kernel from source). You can load the project by the following steps:

  • Click the File tab -> New -> Project from the existing sources
  • Select the aion repo folder -> Click OK
  • Select Import project from external model -> Select Gradle -> Click Finish
  • You might be asked to open new window or use existing window if you have other IntelliJ IDEA project
  • The IDE will run sync tasks for fetching all the project dependency

Running/Debugging the Java kernel at local on IDE

  • Click the Project tab -> Click the module modBoot under the module aion
  • Click src[main] -> Right Click the Aion under the package org.aion
  • Click Run Aion.main() or Debug Aion.main()

Note: you will need to set the argument input in the main method to clean up the gradle argument input, i.e. Add args = new String[0] in the first line of the main method.

Debugging the Java kernel with remote node on IDE

Before debugging the remote node, you need to run a Java node with the remote debugging enabled.

  • Find your remote Java node executing folder, use editor to open the aion.sh file
  • Add debug option after line 56 and then save the file

JAVA_OPTS+=" -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005"

  • Execute the remote node using

LD_LIBRARY_PATH=$JAVA_HOME/lib ./aion.sh -n <network name>

  • Setup the break-point you want to debug the aion kernel
  • Click Run tag on the IDE -> Select Attach to Process... -> Click the remote running aion proccess You should be able to debug the aion kernel
Clone this wiki locally