9.1 KiB
Getting set up
Software requirements
Corda uses industry-standard tools to make set-up as simple as possible. Following the software recommendations below will minimize the number of errors you encounter, and make it easier for others to provide support. However, if you do use other tools, we'd be interested to hear about any issues that arise.
JVM
Corda is written in Kotlin and runs in a JVM. We develop against Oracle JDK 8, and other JVM implementations are not actively supported.
Please ensure that you keep your Oracle JDK installation updated to the latest version while working with Corda. Even earlier versions of JDK 8 versions can cause cryptic errors.
If you do choose to use OpenJDK instead of Oracle's JDK, you will also need to install OpenJFX.
Kotlin
Applications on Corda (CorDapps) can be written in any JVM-targeting language. However, Corda itself and most of the samples are written in Kotlin. If you're unfamiliar with Kotlin, there is an official getting started guide.
See also our further-notes-on-kotlin
.
IDE
We strongly recommend the use of IntelliJ IDEA as an IDE, primarily due to the strength of its Kotlin integration.
Please make sure that you're running the latest version of IDEA, as older versions have been known to have problems integrating with Gradle, the build tool used by Corda.
Git
We use git to version-control Corda.
Gradle
We use Gradle as the build tool for Corda. However, you do not need to install Gradle itself, as a wrapper is provided.
Set-up instructions
The instructions below will allow you to set up a Corda development environment and run a basic CorDapp on a Windows or Mac machine. If you have any issues, please consult the getting-set-up-fault-finding
page, or reach out on Slack or the forums.
Windows
Java
- Visit http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
- Scroll down to "Java SE Development Kit 8uXXX" (where "XXX" is the latest minor version number)
- Toggle "Accept License Agreement"
- Click the download link for jdk-8uXXX-windows-x64.exe (where "XXX" is the latest minor version number)
- Download and run the executable to install Java (use the default settings)
- Open a new command prompt and run
java -version
to test that Java is installed correctly
Git
- Visit https://git-scm.com/download/win
- Click the "64-bit Git for Windows Setup" download link.
- Download and run the executable to install Git (use the default settings)
- Open a new command prompt and type
git --version
to test that git is installed correctly
IntelliJ
- Visit https://www.jetbrains.com/idea/download/download-thanks.html?code=IIC
- Download and run the executable to install IntelliJ Community Edition (use the default settings)
Download a sample project
- Open a command prompt
- Clone the CorDapp tutorial repo by running
git clone https://github.com/corda/cordapp-tutorial
- Move into the cordapp-tutorial folder by running
cd cordapp-tutorial
- Retrieve a list of all the milestone (i.e. stable) releases by running
git branch -a --list *release-M*
- Check out the latest milestone release by running
git checkout release-MX
(where "X" is the latest milestone)
Run from the command prompt
- From the cordapp-tutorial folder, deploy the nodes by running
gradlew deployNodes
- Start the nodes by running
call kotlin-source/build/nodes/runnodes.bat
- Wait until all the terminal windows display either "Webserver started up in XX.X sec" or "Node for "NodeC" started up and registered in XX.XX sec"
- Test the CorDapp is running correctly by visiting the front end at http://localhost:10007/web/example/
Run from IntelliJ
- Open IntelliJ Community Edition
- On the splash screen, click "Open" (do NOT click "Import Project") and select the cordapp-template folder
Warning
If you click "Import Project" instead of "Open", the project's run configurations will be erased!
- Once the project is open, click "File > Project Structure". Under "Project SDK:", set the project SDK by clicking "New...", clicking "JDK", and navigating to C:Program FilesJavajdk1.8.0_XXX (where "XXX" is the latest minor version number). Click "OK".
- Click "View > Tool Windows > Event Log", and click "Import Gradle project", then "OK". Wait, and click "OK" again when the "Gradle Project Data To Import" window appears
- Wait for indexing to finish (a progress bar will display at the bottom-right of the IntelliJ window until indexing is complete)
- At the top-right of the screen, to the left of the green "play" arrow, you should see a dropdown. In that dropdown, select "Run Example Cordapp - Kotlin" and click the green "play" arrow.
- Wait until the run windows displays the message "Webserver started up in XX.X sec"
- Test the CorDapp is running correctly by visiting the front end at http://localhost:10007/web/example/
Mac
Java
- Open "System Preferences > Java"
- In the Java Control Panel, if an update is available, click "Update Now"
- In the "Software Update" window, click "Install Update". If required, enter your password and click "Install Helper" when prompted
- Wait for a pop-up window indicating that you have successfully installed the update, and click "Close"
- Open a new terminal and type
java -version
to test that Java is installed correctly
IntelliJ
- Visit https://www.jetbrains.com/idea/download/download-thanks.html?platform=mac&code=IIC
- Download and run the executable to install IntelliJ Community Edition (use the default settings)
Download a sample project
- Open a terminal
- Clone the CorDapp tutorial repo by running
git clone https://github.com/corda/cordapp-tutorial
- Move into the cordapp-tutorial folder by running
cd cordapp-tutorial
- Retrieve a list of all the milestone (i.e. stable) releases by running
git branch -a --list *release-M*
- Check out the latest milestone release by running
git checkout release-MX
(where "X" is the latest milestone)
Run from the terminal
- From the cordapp-tutorial folder, deploy the nodes by running
./gradlew deployNodes
- Start the nodes by running
kotlin-source/build/nodes/runnodes
. Do not click while 8 additional terminal windows start up. - Wait until all the terminal windows display either "Webserver started up in XX.X sec" or "Node for "NodeC" started up and registered in XX.XX sec"
- Test the CorDapp is running correctly by visiting the front end at http://localhost:10007/web/example/
Run from IntelliJ
- Open IntelliJ Community Edition
- On the splash screen, click "Open" (do NOT click "Import Project") and select the cordapp-template folder
- Once the project is open, click "File > Project Structure". Under "Project SDK:", set the project SDK by clicking "New...", clicking "JDK", and navigating to /Library/Java/JavaVirtualMachines/jdk1.8.0_XXX (where "XXX" is the latest minor version number). Click "OK".
- Click "View > Tool Windows > Event Log", and click "Import Gradle project", then "OK". Wait, and click "OK" again when the "Gradle Project Data To Import" window appears
- Wait for indexing to finish (a progress bar will display at the bottom-right of the IntelliJ window until indexing is complete)
- At the top-right of the screen, to the left of the green "play" arrow, you should see a dropdown. In that dropdown, select "Run Example Cordapp - Kotlin" and click the green "play" arrow.
- Wait until the run windows displays the message "Webserver started up in XX.X sec"
- Test the CorDapp is running correctly by visiting the front end at http://localhost:10007/web/example/
Corda source code
The Corda platform source code is available here:
A CorDapp template that you can use as the basis for your own CorDapps is available here:
And a simple example CorDapp for you to explore basic concepts is available here:
You can clone these repos to your local machine by running the command git clone [repo URL]
.
By default, these repos will be on the unstable master
branch. You should check out the latest milestone release instead by running git checkout release-M11.1
.
Next steps
The best way to check that everything is working fine is by running-the-demos
.
Once you have these demos running, you may be interested in writing your own CorDapps, in which case you should refer to tutorial-cordapp
.
If you encounter any issues, please see the getting-set-up-fault-finding
page, or get in touch with us on the forums or via slack.