Skip to main content

Getting Started

This guide will take you step by step through the process of creating a Luna contract, via the management console.

All of these steps can also be executed via the API, and you can get started by looking at the Auth page

To understand more about the SDK, please check the Core Concepts section and SDK section

 Step One - Sign Up

First let's sign up to Luna and create your first organization.

  1. Navigate to the Luna app in your browser of choice.
  2. Enter your details to create an account. The Invitation Code will have been provided to you separately.
  3. Verify your account by clicking on the link sent to your Luna login email.
  4. Create your first organization.

 Step Two - Project Creation

Next comes project creation. Projects are isolated places where you can develop templates in the Luna contract language.

As a reminder, projects are powered by git so we'll need to clone our project locally to allow us to make updates.

  1. Navigate to the Project tab.
  2. Click New Project, then provide a name and description.
  3. Once created click the Clone Repo button and copy the URL. Note: repo is short for repository, these terms are interchangeable.
  4. (Optional) If you haven't installed git on your local machine do so now by following this guide.
  5. In a local terminal navigate to a place you wish to save your project. Once there, run git clone <URL from step 3> with the URL replaced with the one you copied on step 3.
  6. Git should prompt for your username. Use the email address you used to sign up to the platform in Step 1.2.
  7. Git will then prompt for your password. Do not use the password you signed up with. Instead we need to create an access token by navigating to the Settings tab.
  8. Once on the Settings tab, click Access Tokens, then Create Token. Use the Token value as the password to authenticate the git clone command.
  9. If successful the code should be downloaded to your local machine.

Step Three - Making Changes

At this point we can make changes to the Template to develop our financial product. See the Writing a Template for more details.

  1. Open the downloaded code in your editor of choice. The repo will include a simple Hello World Template. For now, let's simply rename this Template.
  2. Open the my_project/template.py file and change the name of the Template class from MyTemplate to MyAwesomeTemplate.
  3. To publish (or push) the changes we need to use git. Run git commit -am 'Rename Template' which saves your changes to git locally on your machine. Then, to save it remotely, run git push origin master. This "pushes" the changes to the remote git repository.
  4. Returning to the Project Overview tab in the UI, you should see the update in the Latest Updates widget.
  5. Once the update is analyzed you should see a summary of the changes in the UI, including the new Template name.

Step Four - Publishing the Template

Once we've pushed our updates we need to release them so we can create contracts.

  1. From the Project Summary view, click on the Updates tab in the top bar.
  2. You should see the details of the update we made in Step Three. Click on the Release button to release the update.
  3. If you click on the Releases tab you should be able to see the released Template.

Step Five - Creating Contracts

Finally we can create a contract from our Template.

  1. Click on the Contracts tab, then Create Contract
  2. Enter the name of the Template you created above and click Search.
  3. Click Create Contract then Run.
  4. Review the information of your new running contract.