-
Notifications
You must be signed in to change notification settings - Fork 3
Quick Start with embedded AVM
This document provides the quickest way to try development on embedded AVM. Some of the details are skipped to keep this document small. For detailed user guide, please refer to Aion4j Maven Plugin User Guide
- Java 10 and above
- Maven 3.5.4 and above
The fastest way to create a AVM project is using a maven archetype - avm-archetype.
Run the following maven command to create an AVM project.
$> mvn archetype:generate -DarchetypeGroupId=org.aion4j -DarchetypeArtifactId=avm-archetype -DarchetypeVersion=0.30
Follow the instruction to enter groupId, artifactId and package information.
Edit pom.xml file in the generated project and change <aion4j.maven.plugin> version to the latest release version. Please refer to aion4j maven plugin project page for the latest release version.
<properties>
...
<aion4j.plugin.version>x.x.x</aion4j.plugin.version>
...
</properties>
$> mvn initialize
$> mvn clean install
$> mvn aion4j:deploy
The archetype generated project comes with a sample java smart contract. To invoke "greet" method in the sample contract, run the aion4j:call maven goal.
$> mvn aion4j:call -Dmethod=greet -Dargs="-T AVM"
To get the balance of the default address.
$> mvn aion4j:get-balance