Skip to main content

Usage

You can get list of sub-commands supported by Drogon by running:

โฏ drogon -h
_ .-') _ _ .-') .-') _ ,---.
( ( OO) )( \( -O ) ( OO ) )| |
\ .'_ ,------. .-'),-----. ,----. .-'),-----. ,--./ ,--,' | |
,`'--..._)| /`. '( OO' .-. ' ' .-./-') ( OO' .-. '| \ | |\ | |
| | \ '| / | |/ | | | | | |_( O- )/ | | | || \| | )| |
| | ' || |_.' |\_) | |\| | | | .--, \\_) | |\| || . |/ | .'
| | / :| . '.' \ | | | |(| | '. (_/ \ | | | || |\ | `--'
| '--' /| |\ \ `' '-' ' | '--' | `' '-' '| | \ | .--.
`-------' `--' '--' `-----' `------' `-----' `--' `--' '--'
Usage: Drogon [options] [command]

Compile, Test and Deploy ICON Contracts with ease!

Options:
-V, --version output the version number
-h, --help display help for command

Commands:
install Installs required SCORE dependencies
init Initialize a new Drogon project
compile [options] Compile the Drogon contracts
test [options] Run the tests against the Drogon contracts
gradlew [options] Run gradlew commands against the Drogon project
optimize [options] Optmize contracts from the Drogon project
deploy [options] Deploy contracts from the Drogon project
keystore [options] Generate keystore
goloop [options] Run goloop commands against the Drogon project
sandbox Run a local network in the Drogon project
help [command] display help for command

Drogon keeps an asusmption that the user is already familiar with developing ICON SCORE smart contracts.

Drogon provides the option to install the SCORE dependencies as docker containers. This is done inorder to keep the local system clean.

โฏ drogon install -h
_ .-') _ _ .-') .-') _ ,---.
( ( OO) )( \( -O ) ( OO ) )| |
\ .'_ ,------. .-'),-----. ,----. .-'),-----. ,--./ ,--,' | |
,`'--..._)| /`. '( OO' .-. ' ' .-./-') ( OO' .-. '| \ | |\ | |
| | \ '| / | |/ | | | | | |_( O- )/ | | | || \| | )| |
| | ' || |_.' |\_) | |\| | | | .--, \\_) | |\| || . |/ | .'
| | / :| . '.' \ | | | |(| | '. (_/ \ | | | || |\ | `--'
| '--' /| |\ \ `' '-' ' | '--' | `' '-' '| | \ | .--.
`-------' `--' '--' `-----' `------' `-----' `--' `--' '--'
Usage: Drogon install [options]

Installs required SCORE dependencies

Options:
-h, --help display help for command

Please make sure Docker is running before running drogon install

โฏ drogon install
_ .-') _ _ .-') .-') _ ,---.
( ( OO) )( \( -O ) ( OO ) )| |
\ .'_ ,------. .-'),-----. ,----. .-'),-----. ,--./ ,--,' | |
,`'--..._)| /`. '( OO' .-. ' ' .-./-') ( OO' .-. '| \ | |\ | |
| | \ '| / | |/ | | | | | |_( O- )/ | | | || \| | )| |
| | ' || |_.' |\_) | |\| | | | .--, \\_) | |\| || . |/ | .'
| | / :| . '.' \ | | | |(| | '. (_/ \ | | | || |\ | `--'
| '--' /| |\ \ `' '-' ' | '--' | `' '-' '| | \ | .--.
`-------' `--' '--' `-----' `------' `-----' `--' `--' '--'
โ˜ pending Installing Drogon
โœจ Drogon ready for use.
โœ” success Drogon ready for use.

Drogon provides a sub-command to scaffold a initialize a project. This wizard-like process asks questions and bootstraps a new project with sample code for you.

โฏ drogon init
_ .-') _ _ .-') .-') _ ,---.
( ( OO) )( \( -O ) ( OO ) )| |
\ .'_ ,------. .-'),-----. ,----. .-'),-----. ,--./ ,--,' | |
,`'--..._)| /`. '( OO' .-. ' ' .-./-') ( OO' .-. '| \ | |\ | |
| | \ '| / | |/ | | | | | |_( O- )/ | | | || \| | )| |
| | ' || |_.' |\_) | |\| | | | .--, \\_) | |\| || . |/ | .'
| | / :| . '.' \ | | | |(| | '. (_/ \ | | | || |\ | `--'
| '--' /| |\ \ `' '-' ' | '--' | `' '-' '| | \ | .--.
`-------' `--' '--' `-----' `------' `-----' `--' `--' '--'
โœ” Name of the project โ€ฆ drogon-test
โœ” Do you want to initialize your Drogon project with samples? โ€ฆ no / yes
โœ” Do you want to generate a keystore for this project? โ€ฆ no / yes
โœ” Pick a boilerplate โ€บ - Use arrow-keys. Return to submit.
โฏ Hello World
IRC2 Token
IRC3 Token
IRC31 Token
Multisig Wallet
Sample Crowdsale
Sample Token

โœจ Scaffolding done ๐ŸŽ‰

This should create a new project folder called drogon-test in the current working directory.

โฏ tree drogon-test
drogon-test
โ”œโ”€โ”€ build.gradle
โ”œโ”€โ”€ drogon-config.json
โ”œโ”€โ”€ settings.gradle
โ””โ”€โ”€ src
โ””โ”€โ”€ hello-world
โ”œโ”€โ”€ build.gradle
โ””โ”€โ”€ src
โ”œโ”€โ”€ main
โ”‚ย ย  โ””โ”€โ”€ java
โ”‚ย ย  โ””โ”€โ”€ com
โ”‚ย ย  โ””โ”€โ”€ iconloop
โ”‚ย ย  โ””โ”€โ”€ score
โ”‚ย ย  โ””โ”€โ”€ example
โ”‚ย ย  โ””โ”€โ”€ HelloWorld.java
โ””โ”€โ”€ test
โ””โ”€โ”€ java
โ””โ”€โ”€ com
โ””โ”€โ”€ iconloop
โ””โ”€โ”€ score
โ””โ”€โ”€ example
โ””โ”€โ”€ AppTest.java

15 directories, 6 files

Project Structure overviewโ€‹

โฏ tree drogon-test
drogon-test
โ”œโ”€โ”€ build.gradle
โ”œโ”€โ”€ drogon-config.json
โ”œโ”€โ”€ settings.gradle
โ””โ”€โ”€ src
โ””โ”€โ”€ hello-world
โ”œโ”€โ”€ build.gradle
โ””โ”€โ”€ src
โ”œโ”€โ”€ main
โ”‚ย ย  โ””โ”€โ”€ java
โ”‚ย ย  โ””โ”€โ”€ com
โ”‚ย ย  โ””โ”€โ”€ iconloop
โ”‚ย ย  โ””โ”€โ”€ score
โ”‚ย ย  โ””โ”€โ”€ example
โ”‚ย ย  โ””โ”€โ”€ HelloWorld.java
โ””โ”€โ”€ test
โ””โ”€โ”€ java
โ””โ”€โ”€ com
โ””โ”€โ”€ iconloop
โ””โ”€โ”€ score
โ””โ”€โ”€ example
โ””โ”€โ”€ AppTest.java

15 directories, 6 files
  • src: the folder containing your smart contracts written in Java.
  • test: the folder containing Java tests
  • drogon-config.yaml: the configuration file which defines networks and accounts to be used for the deployment.

Currently the drogon-config is WIP. In future, we plan to make this as the one place deployment configuration file.