10 KiB
Getting set up
Software requirements
Corda uses industry-standard tools:
- Oracle JDK 8 JVM - minimum supported version 8u171
- IntelliJ IDEA - supported versions 2017.x and 2018.x (with Kotlin plugin version )
- Git
We also use Gradle and Kotlin, but you do not need to install them. A standalone Gradle wrapper is provided, and it will download the correct version of Kotlin.
Please note:
- Corda runs in a JVM. JVM implementations other than Oracle JDK 8 are not actively supported. However, if you do choose to use OpenJDK, you will also need to install OpenJFX
- Applications on Corda (CorDapps) can be written in any language targeting the JVM. However, Corda itself and most of the samples are written in Kotlin. Kotlin is an official Android language, and you can read more about why Kotlin is a strong successor to Java here. If you're unfamiliar with Kotlin, there is an official getting started guide, and a series of Kotlin Koans.
- IntelliJ IDEA is recommended due to the strength of its Kotlin integration.
Following these software recommendations 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.
Set-up instructions
The instructions below will allow you to set up a Corda development environment and run a basic CorDapp. If you have any issues, please consult the troubleshooting
page, or reach out on Slack, Stack Overflow or the forums.
The set-up instructions are available for the following platforms:
windows-label
(or in video form)mac-label
(or in video form)
Windows
Warning
If you are using a Mac machine, please follow the mac-label
instructions instead.
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)
- Add Java to the PATH environment variable by following the instructions at https://docs.oracle.com/javase/7/docs/webnotes/install/windows/jdk-installation-windows.html#path
- 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)
- Ensure the Kotlin plugin in Intellij is updated to version
Download a sample project
- Open a command prompt
- Clone the CorDapp example repo by running
git clone https://github.com/corda/cordapp-example
- Move into the
cordapp-example
folder by runningcd cordapp-example
Run from the command prompt
- From the cordapp-example 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:10009/web/example/
Run from IntelliJ
- Open IntelliJ Community Edition
- On the splash screen, click
Open
(do not clickImport Project
) and select thecordapp-example
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
, thenProject Structure
. UnderProject SDK:
, set the project SDK by clickingNew...
, clickingJDK
, and navigating toC:\\Program Files\\Java\\jdk1.8.0_XXX
(whereXXX
is the latest minor version number). Click "OK" - Again under
File
thenProject Structure
, selectModules
. Click+
, thenImport Module
, then select thecordapp-example
folder and clickOpen
. Choose toImport module from external model
, selectGradle
, clickNext
thenFinish
(leaving the defaults) andOK
- Wait for the 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, selectRun Example Cordapp - Kotlin
and click the greenplay
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:10009/web/example/
Mac
Warning
If you are using a Windows machine, please follow the windows-label
instructions instead.
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-macosx-x64.dmg (where "XXX" is the latest minor version number)
- Download and run the executable to install Java (use the default settings)
- Open a new terminal window and run
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)
- Ensure the Kotlin plugin in Intellij is updated to version
Download a sample project
- Open a terminal
- Clone the CorDapp example repo by running
git clone https://github.com/corda/cordapp-example
- Move into the
cordapp-example
folder by runningcd cordapp-example
Run from the terminal
- From the cordapp-example 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:10009/web/example/
Run from IntelliJ
- Open IntelliJ Community Edition
- On the splash screen, click
Open
(do not clickImport Project
) and select thecordapp-example
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
, thenProject Structure
. UnderProject SDK:
, set the project SDK by clickingNew...
, clickingJDK
, and navigating toC:\\Program Files\\Java\\jdk1.8.0_XXX
(whereXXX
is the latest minor version number). Click "OK" - Again under
File
thenProject Structure
, selectModules
. Click+
, thenImport Module
, then select thecordapp-example
folder and clickOpen
. Choose toImport module from external model
, selectGradle
, clickNext
thenFinish
(leaving the defaults) andOK
- Wait for the 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, selectRun Example Cordapp - Kotlin
and click the greenplay
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:10009/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 in both Java and Kotlin versions:
And a list of simple sample CorDapps 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]
.
Next steps
The best way to check that everything is working fine is by taking a deeper look at the example CorDapp <tutorial-cordapp>
.
Next, you should read through Corda Key Concepts <key-concepts>
to understand how Corda works.
By then, you'll be ready to start writing your own CorDapps. Learn how to do this in the Hello, World tutorial <hello-world-introduction>
. You may want to refer to the API documentation, the flow cookbook <flow-cookbook>
and the samples along the way.
If you encounter any issues, please see the troubleshooting
page, or ask on Stack Overflow or via our Slack channels.