Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Before we can perform ADA transactions or read the relevant account data, first we need a form to store account data to.
    Now that we have a blank app design, create a new form with the following details:
    Form ID       : accountDetails
    Form Name : Account Details
    Table Name : cardano_accounts

  2. After creating the form, using the Joget Form Builder, let's add a few text fields to store details of a Cardano account:
    Account Base Address (with "id" as the field's ID)
    Account Mnemonic Phrase
    Account Owner
    Is Test Account
    Account Enterprise Address

    Image AddedAccount Details - Form DesignImage Removed

    The minimum basic required field to operate a Cardano account is actually just the account's mnemonic phrase, as it is possible to derive account data solely from the mnemonic phrase or private key just like most blockchain technologies out there. But for security and/or efficiency purposes, it is common to also locally store additional safe & immutable details of an account. 

    As a note, the Cardano Generate Account Tool plugin will store the account's base address as the record ID of a form record, and store the account's mnemonic phrase as an encrypted value in the database.

  3. As there is no need for end users to modify any values in this form, we can set this entire section as read-only. Go to Advanced ToolsPermission tab, and set the one-and-only section as "readonly".
    Set section permission as readonlyImage Removed
    Image Added

  4. Now save the form.

  5. Once the form is saved, click on the Generate App button to use the App Generator
    Check the option for Generate CRUD, then click Generate.
    App Generator - Generate CRUDImage Removed
    Image Added

    Do note that the App Generator is a Joget Enterprise Edition feature, but you can manually create the list, process, and UI in the Community Edition as well.

    Upon completing the generation, coming back to the app design page, we can see that a datalist and userview for the CRUD has been generated accordingly, and the app is now published.

    Image AddedResult of Generate CRUD via App GeneratorImage Removed

  6. In order for the generated Account Details datalist to show meaningful information, edit the datalist in the Datalist Builder and add/arrange/sort the columns according to your preference. 
    Example as below:
    Account Details Datalist DesignImage Removed
    Image Added

    Remember to save the datalist after editing it.

  7. At this point, now that we have the form, list, and UI to display account data, we are ready to incorporate the Cardano Generate Account Tool plugin into the app. On the app design page, go to the Processes tab, and click on Design Processes.
    Design New Process to Generate AccountsImage Removed
    Image Added

  8. Now in the Process Builder, change the process properties accordingly:
    ID       : generateAccountProcess
    Name : Generate Account Process
    Rename the Process Name accordinglyImage Removed
    Image Added

  9. Edit the one-and-only participant and give it a meaningful name (e.g.: Requester).
    Image Removed
    Image Added

  10. Now within the process design, simply drag in a process tool and use such design as below. Rename the process tool with a meaningful name (e.g.: Generate Account).



  11. We are done with the process design. Click on Deploy at the top right corner to deploy the process.

  12. Coming back to the app design page, go to Map Tools to Plugins tab, and add a plugin to the Generate Account tool.
    Select Cardano Generate Account Tool.



  13. Configure the Cardano Generate Account Tool accordingly by selecting the Testnet network and mapping the form fields of the Account Details form to store to.
    You can also refer to the plugin's documentation.

    Configure Cardano Generate Account Tool - Page 1

    Configure Cardano Generate Account Tool - Page 2

    Configure Cardano Generate Account Tool

    Property

    Value

    Network Type

    Testnet


    Store Account Data to Form

    Property

    Value

    Form

    Account Details

    Field Mapping

    Account Mnemonic Phrase (encrypted)

    (Point to Account Mnemonic Phrase field)

    Account Owner Field

    (Point to Account Owner field)

    Account Owner Value

    #currentUser.username#

    (Accepts a Hash Variable. Typically points to an actual user, e.g.: Joget username.)

    Is Test Account Flag

    (Point to Is Test Account field)

    Account Enterprise Address

    (Point to Account Enterprise Address field)


    Save the plugin configuration.

  14. And that's it! To quickly test Cardano account generation, click on Run Process.

    Run the Generate Account Process

    Upon doing so, a valid account should be generated successfully. To check this, simply launch the app and navigate to the CRUD menu that was generated earlier.

    We can see that there is now 1 record available.

    A valid Cardano account is generated as seen in the CRUD

    And upon viewing the record, we can see details about the particular account.

    Viewing account details via CRUD view form

    Optionally, if you wish to make this function available for end users in runtime, you can edit the userview in the Userview Builder and drag in a Run Process Menu. Configure the Run Process Menu by pointing it to the Generate Account Process that we have created.

    Remember to save the userview after editing it.

...