Joget DX 8 Stable Released
The stable release for Joget DX 8 is now available, with a focus on UX and Governance.
...
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.
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.
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.
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:
Remember to save the datalist after editing it.
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.
Now in the Process Builder, change the process properties accordingly:
ID : generateAccountProcess
Name : Generate Account Process
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.
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
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.
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.
And upon viewing the record, we can see details about the particular account.
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.
...
Configure the Cardano Account Load Binder accordingly by selecting the Testnet network, and keying in your Blockfrost testnet project's API Key that you have generated earlier, along with the necessary configurations.
You can also refer to the plugin's documentation.
Configure Cardano Account Load Binder
Property | Value |
---|---|
Network Type | Testnet |
Blockfrost Project Key | (Your Blockfrost testnet project's API Key) |
Account Address | #form.cardano_accounts.id# (We can use Form Data Hash Variable to dynamically point to the Account Base Address of the current form record.) |
Map Value To Form Fields
Property | Value |
---|---|
Current Account Balance | (Key in the field ID for Account Balance field) |
Account Type | (Key in the field ID for Account Type field) |
Save the form section configuration.
...
Configure the Cardano Send Transaction Tool accordingly by selecting the Testnet network, and keying in your Blockfrost testnet project's API Key that you have generated earlier, along with the necessary configurations.
To demonstrate the ability to embed form data into the transaction metadata, we will also check the Enable Transaction Metadata property and add these fields from the Send Transaction form:
- id
- dateCreated
- createdBy
You can also refer to the plugin's documentation.
Configure Cardano Send Transaction Tool
Property | Value |
---|---|
Network Type | Testnet |
Blockfrost Project Key | (Your Blockfrost testnet project's API Key) |
Transaction Details
Property | Value |
---|---|
Sender Address | #form.cardano_send_test.sender_account# |
Sender Account Mnemonic Phrase | #form.cardano_accounts.mnemonic[{form.cardano_send_test.sender_account}]# (This uses Form Data Hash Variable with Nested Hash Variable to dynamically point to the sender's account mnemonic phrase in reference to the Sender Address of the current form record.) NOTE: Do not key in the plain-text mnemonic phrase here. |
Receiver Address | #form.cardano_send_test.receiver_account# |
Amount To Send (ADA) | #form.cardano_send_test.amount# |
Enable Transaction Metadata | Yes |
Form | Send Transaction |
Metadata |
|
Store Response to Workflow Variable
Property | Value |
---|---|
Is Transaction Validated | txValidated |
Transaction Explorer URL | txExplorerUrl |
Save the plugin configuration.
Click on Submit Send Transaction to start the process, and follow through the process flow.
Here, simply select the account that you have funded previously as the sender account, specify the amount of ADA coins to send, and select the latter account that was just generated just now as the receiver account.
After submitting this activity, the process will flow to the Approval activity. Navigate to the Inbox Menu, select the Status as Approved, and submit this approval activity.
Upon inspection of the completed process instance, we can see that the Transaction Validation Flag (represented by txValidated workflow variable) is false. This is perfectly normal in the initial time period as transactions performed on the Cardano Blockchain undergo confirmation in order for the transaction to be accepted into the chain and become immutable. Transaction confirmations are usually completed in about 20 seconds, depending on the network load.
NOTE: Transaction confirmations and chain confirmations (sometimes referred to as block confirmations) are different concepts. Transaction confirmation is the point in time when a transaction is accepted into the chain and becomes immutable, whereas chain confirmation is the point beyond which the chain is guaranteed by protocol not to alter any further and is usually considered complete after 15-30 blocks deep.