Skip to content

Upload NPL code

This section explains how to deploy your first NPL application code to the NOUMENA Cloud. You can choose between uploading through the web portal or directly from IntelliJ IDE.

Uploading NPL Sources

Option 1: Upload NPL from the NOUMENA Cloud Portal

  1. Navigate to the main tab of your application

  2. Download the example IOU package by clicking Download package

This zip file contains:

- `npl-1.0.0` folder containing `iou.npl` - The protocol definition for a simple IOU (I Owe You) application
- `yaml` folder containing `migration.yaml` - Configuration specifying how to deploy the NPL package

What is an IOU? The example implements a simple debt tracking protocol where one party (issuer) acknowledges owing money to another party (payee), with permissions to create and settle these obligations.

  1. Unzip the downloaded package and modify the code as desired in your preferred editor. Zip the folder again.

  2. Upload the package by clicking Upload package Uploading the NPL package

  3. Wait for deployment to complete (indicated by a success message)

Option 2: Upload NPL from IntelliJ

For developers working in IntelliJ IDE, direct deployment is supported.

  1. Open your project in IntelliJ (e.g., npl-app). New projects can be setup following the developing NPL on your own machine.

  2. Under npl/src/main, ensure that the npl folder is versioned, like npl-1.0.0. Rename it to npl-1.0.0 otherwise.

    The version suffix is required for the NOUMENA Runtime to identify the source code folder

  3. Ensure there's a yaml folder under npl/src/main containing a migration.yml file with the following content:

    systemUnderAudit: npl-app
    
    changesets:
     - name: 1.0.0
       changes:
         - reset: true
         - npl-load:
           dir-list: npl
    This configuration specifies:
    • The system name (npl-app)
    • The version name (1.0.0) matching the folder ending
    • The directory containing NPL code (npl) matching the folder name beginning
    • Reset flag to clear any previous deployments
  4. In the top-right corner of IntelliJ, select Current File > Edit Configurations Edit configurations in IntelliJ

  5. Choose Add new configuration > Deploy to PaaS Deploy to PaaS configuration

  6. Configure the deployment with:

    • Name: "Deploy"
    • Server base URL: https://portal.noumena.cloud
    • Application ID: Found on the settings tab of your app in the NOUMENA Cloud Portal
    • Username: Your NOUMENA Cloud email address
    • Password: Your NOUMENA Cloud password
    • Source path: The absolute path to the main directory containing npl and yaml folders
    • Delete existing application and data before deployment: Check this option to remove any previous deployments and protocol instance
  7. Click Ok to save the configuration

  8. In the top-right corner of IntelliJ, click Run Deploy Run deployment

  9. Return to the NOUMENA Cloud portal to verify deployment status

Verification

Once deployment completes, you'll see the status change in the portal. You can also navigate to the Services tab to check that all components have deployed successfully.

Next Steps

Now that your NPL application is deployed, continue to create users in Keycloak to set up authentication for your application.