2015-11-25 13:27:07 +00:00
Getting set up
==============
2017-01-31 12:59:24 +00:00
Software requirements
---------------------
2017-06-05 12:37:23 +00:00
Corda uses industry-standard tools:
2016-11-14 18:12:39 +00:00
2017-06-05 12:37:23 +00:00
* **Oracle JDK 8 JVM** - supported version **8u131**
* **IntelliJ IDEA** - supported versions **2017.1** , **2017.2** and **2017.3**
* **Gradle** - supported version **3.4**
* **Kotlin** - supported version **1.1.2**
* **Git**
2015-11-25 13:27:07 +00:00
2017-06-05 12:37:23 +00:00
You do not need to install Gradle or Kotlin. A standalone Gradle wrapper is provided, and it will download the correct
version of Kotlin.
2016-11-29 15:53:35 +00:00
2017-06-05 12:37:23 +00:00
Please note:
2016-05-18 09:39:47 +00:00
2017-06-05 12:37:23 +00:00
* 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
2017-05-12 10:32:19 +00:00
2017-06-05 12:37:23 +00:00
* 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 <https://developer.android.com/kotlin/index.html> `_ , and you can read more about why
Kotlin is a strong successor to Java
`here <https://medium.com/@octskyward/why-kotlin-is-my-next-programming-language-c25c001e26e3> `_ . If you're
unfamiliar with Kotlin, there is an official
`getting started guide <https://kotlinlang.org/docs/tutorials/> `_ , and a series of
`Kotlin Koans <https://kotlinlang.org/docs/tutorials/koans.html> `_ .
2016-05-18 09:39:47 +00:00
2017-06-05 12:37:23 +00:00
* IntelliJ IDEA is recommended due to the strength of its Kotlin integration.
2017-01-31 12:59:24 +00:00
2017-06-05 12:37:23 +00:00
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.
2015-11-25 13:27:07 +00:00
2017-05-12 10:32:19 +00:00
Set-up instructions
-------------------
2017-06-05 12:37:23 +00:00
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 :doc: `troubleshooting` page, or reach out on
`Slack <http://slack.corda.net/> `_ or the `forums <https://discourse.corda.net/> `_ .
2017-05-12 10:32:19 +00:00
2017-05-15 10:18:26 +00:00
.. note :: The set-up instructions are also available in video form for both `Windows <https://vimeo.com/217462250> `_ and `Mac <https://vimeo.com/217462230> `_ .
2017-05-12 10:32:19 +00:00
Windows
2017-06-05 12:37:23 +00:00
^^^^^^^
2017-05-12 10:32:19 +00:00
Java
2017-06-05 12:37:23 +00:00
~~~~
2017-05-12 10:32:19 +00:00
1. Visit http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
2. Scroll down to "Java SE Development Kit 8uXXX" (where "XXX" is the latest minor version number)
3. Toggle "Accept License Agreement"
4. Click the download link for jdk-8uXXX-windows-x64.exe (where "XXX" is the latest minor version number)
5. Download and run the executable to install Java (use the default settings)
6. Open a new command prompt and run `` java -version `` to test that Java is installed correctly
Git
2017-06-05 12:37:23 +00:00
~~~
2017-05-12 10:32:19 +00:00
1. Visit https://git-scm.com/download/win
2. Click the "64-bit Git for Windows Setup" download link.
3. Download and run the executable to install Git (use the default settings)
4. Open a new command prompt and type `` git --version `` to test that git is installed correctly
IntelliJ
2017-06-05 12:37:23 +00:00
~~~~~~~~
2017-05-12 10:32:19 +00:00
1. Visit https://www.jetbrains.com/idea/download/download-thanks.html?code=IIC
2. Download and run the executable to install IntelliJ Community Edition (use the default settings)
Download a sample project
2017-06-05 12:37:23 +00:00
~~~~~~~~~~~~~~~~~~~~~~~~~
2017-05-12 10:32:19 +00:00
1. Open a command prompt
2. Clone the CorDapp tutorial repo by running `` git clone https://github.com/corda/cordapp-tutorial ``
3. Move into the cordapp-tutorial folder by running `` cd cordapp-tutorial ``
4. Retrieve a list of all the milestone (i.e. stable) releases by running `` git branch -a --list *release-M* ``
5. Check out the latest milestone release by running `` git checkout release-MX `` (where "X" is the latest milestone)
Run from the command prompt
2017-06-05 12:37:23 +00:00
~~~~~~~~~~~~~~~~~~~~~~~~~~~
2017-05-12 10:32:19 +00:00
1. From the cordapp-tutorial folder, deploy the nodes by running `` gradlew deployNodes ``
2. Start the nodes by running `` call kotlin-source/build/nodes/runnodes.bat ``
3. 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"
4. Test the CorDapp is running correctly by visiting the front end at http://localhost:10007/web/example/
Run from IntelliJ
2017-06-05 12:37:23 +00:00
~~~~~~~~~~~~~~~~~
2017-05-12 10:32:19 +00:00
1. Open IntelliJ Community Edition
2017-08-14 12:31:15 +00:00
2. On the splash screen, click "Open" (do NOT click "Import Project") and select the cordapp-tutorial folder
2017-05-12 10:32:19 +00:00
.. warning :: If you click "Import Project" instead of "Open", the project's run configurations will be erased!
3. 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 Files\Java\jdk1.8.0_XXX (where "XXX" is the latest minor version number). Click "OK".
4. 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
5. Wait for indexing to finish (a progress bar will display at the bottom-right of the IntelliJ window until indexing is complete)
6. 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.
7. Wait until the run windows displays the message "Webserver started up in XX.X sec"
8. Test the CorDapp is running correctly by visiting the front end at http://localhost:10007/web/example/
Mac
2017-06-05 12:37:23 +00:00
^^^
2017-05-12 10:32:19 +00:00
Java
2017-06-05 12:37:23 +00:00
~~~~
2017-05-12 10:32:19 +00:00
1. Open "System Preferences > Java"
2. In the Java Control Panel, if an update is available, click "Update Now"
3. In the "Software Update" window, click "Install Update". If required, enter your password and click "Install Helper" when prompted
4. Wait for a pop-up window indicating that you have successfully installed the update, and click "Close"
5. Open a new terminal and type `` java -version `` to test that Java is installed correctly
IntelliJ
2017-06-05 12:37:23 +00:00
~~~~~~~~
2017-05-12 10:32:19 +00:00
1. Visit https://www.jetbrains.com/idea/download/download-thanks.html?platform=mac&code=IIC
2. Download and run the executable to install IntelliJ Community Edition (use the default settings)
Download a sample project
2017-06-05 12:37:23 +00:00
~~~~~~~~~~~~~~~~~~~~~~~~~
2017-05-12 10:32:19 +00:00
1. Open a terminal
2. Clone the CorDapp tutorial repo by running `` git clone https://github.com/corda/cordapp-tutorial ``
3. Move into the cordapp-tutorial folder by running `` cd cordapp-tutorial ``
4. Retrieve a list of all the milestone (i.e. stable) releases by running `` git branch -a --list *release-M* ``
5. Check out the latest milestone release by running `` git checkout release-MX `` (where "X" is the latest milestone)
Run from the terminal
2017-06-05 12:37:23 +00:00
~~~~~~~~~~~~~~~~~~~~~
2017-05-12 10:32:19 +00:00
1. From the cordapp-tutorial folder, deploy the nodes by running `` ./gradlew deployNodes ``
2. Start the nodes by running `` kotlin-source/build/nodes/runnodes `` . Do not click while 8 additional terminal windows start up.
3. 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"
4. Test the CorDapp is running correctly by visiting the front end at http://localhost:10007/web/example/
Run from IntelliJ
2017-06-05 12:37:23 +00:00
~~~~~~~~~~~~~~~~~
2017-05-12 10:32:19 +00:00
1. Open IntelliJ Community Edition
2017-08-14 12:31:15 +00:00
2. On the splash screen, click "Open" (do NOT click "Import Project") and select the cordapp-tutorial folder
2017-05-12 10:32:19 +00:00
3. 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".
4. 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
5. Wait for indexing to finish (a progress bar will display at the bottom-right of the IntelliJ window until indexing is complete)
6. 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.
7. Wait until the run windows displays the message "Webserver started up in XX.X sec"
8. Test the CorDapp is running correctly by visiting the front end at http://localhost:10007/web/example/
2015-11-25 13:27:07 +00:00
2016-11-25 14:29:13 +00:00
Corda source code
2016-11-14 18:12:39 +00:00
-----------------
2015-12-08 15:47:45 +00:00
2017-01-31 12:59:24 +00:00
The Corda platform source code is available here:
2016-11-14 18:12:39 +00:00
2016-11-23 12:25:44 +00:00
https://github.com/corda/corda.git
2015-12-08 15:47:45 +00:00
2017-07-28 08:13:53 +00:00
A CorDapp template that you can use as the basis for your own CorDapps is available in both Java and Kotlin versions:
2016-11-23 12:25:44 +00:00
2017-07-28 08:13:53 +00:00
https://github.com/corda/cordapp-template-java.git
https://github.com/corda/cordapp-template-kotlin.git
2015-12-08 15:47:45 +00:00
2017-02-08 10:34:54 +00:00
And a simple example CorDapp for you to explore basic concepts is available here:
2017-01-31 12:59:24 +00:00
2017-02-08 10:34:54 +00:00
https://github.com/corda/cordapp-tutorial.git
You can clone these repos to your local machine by running the command `` git clone [repo URL] `` .
2017-06-05 12:37:23 +00:00
By default, these repos will be on the unstable `` master `` branch. You should check out the latest milestone release
2017-06-08 16:56:52 +00:00
instead by running `` git checkout release-M12 `` .
2015-12-08 15:47:45 +00:00
2017-01-31 12:59:24 +00:00
Next steps
----------
2017-07-21 11:33:31 +00:00
The best way to check that everything is working fine is by running the :doc: `tutorial CorDapp <tutorial-cordapp>` and
the :doc: `samples <running-the-demos>` .
2015-12-08 15:47:45 +00:00
2017-07-21 11:33:31 +00:00
Next, you should read through :doc: `Corda Key Concepts <key-concepts>` to understand how Corda works.
2015-12-08 15:47:45 +00:00
2017-07-21 11:33:31 +00:00
By then, you'll be ready to start writing your own CorDapps. Learn how to do this in the
:doc: `Hello, World tutorial <hello-world-index>` . You may want to refer to the :doc: `API docs <api-index>` along the
way.
2015-11-25 13:27:07 +00:00
2017-06-05 12:37:23 +00:00
If you encounter any issues, please see the :doc: `troubleshooting` page, or get in touch with us on the
2017-05-15 16:23:07 +00:00
`forums <https://discourse.corda.net/> `_ or via `slack <http://slack.corda.net/> `_ .