When creating a smart contract project, add the NULS smart contract archetype to IDEA, and then select this archetype to generate the NULS smart contract project. The generated project has automatically completed the dependencies of the required jar package. The developer only needs to write the business code. After using smart package to package smart contracts, the smart contract debugging platform will be launched automatically, and developers can debug smart contracts on this platform.
- JDK1.8
- Maven 3.5 and above
git clone https://github.com/CCC-NULS/nuls-smartcontract-archetype.git
mvn clean install
After building maven successfully, the artifacts will be uploaded to your local maven repository.
In order to solve the problem of Intellij IDEA creating a Maven project through archetype slowly, increase the maven run parameters: -DarchetypeCatalog=internal,The operation steps are as follows:
-
Click on the menu of IntelliJ IDE:File->New Project->Maven,As shown below:
-
Check "Create From archetype" and click the "Add Archetype" button, as shown below, fill in the following information to generate "io.nuls:nuls-smartcontract-archetype"
GroupId:io.nuls ArtifactId: nuls-smartcontract-archetype Version: 1.1
- Select the generated "io.nuls:nuls-smartcontract-archetype" and click Next to create the NULS Smart Contract Project.
- The smart contract project is a maven project
- The smart contract project comes with a sample contract class and all required NULS smart contract dependencies are automatically added to the project.
- The smart contract project automatically relies on the offline smart contract debugging platform.
- When the contract is packaged via mvn clean pakcage, the offline smart contract is launched and the contract is deployed to the offline smart contract debugging platform.
- Simplify contract deployment and execution without uploading jar packages or generating contract hex code
- This smart contract project comes with some useful tools to facilitate the development of smart contracts.