Minka Ledger Docs
How To Guides

How to read a layout


CLI allows users to visualize layouts.

Reading a layout with CLI

Bellow is an example of how to read a layout with minka CLI.

Make sure you are connected to a server and have an active ledger set in context.

You will be asked about the layout to be read.

$ minka layout show
? Select Layout: (Use arrow keys)
  ----Policy----
  my_policy_layout
  ----Custom----
  my_custom_layout
  ----Built-in----
  RTP Bank Domain Update 
> Cross Ledger Payments 
  RTP Setup 
  RTP Studio 
  RTP Reporting 
  RTP Member 
  RTP Bank Domain 
  RTP Domain Owner 
  RTP Domain Member 
  RTP Bank Bridge

The list presented on the command line might be different, according to the built-in layouts added to the system, as well as the custom layouts available on your local machine and policy layouts created in the ledger

$ minka layout show
? Select Layout: Cross Ledger Payments
 
Cross Ledger Payments
---------------------------------------------------------------------------
 
Schemas
  - p2p
  - intent
  - tel-alias
  - bank-wallet
 
Wallets
  - ach
  - tesla
  - minka
 
Circles
  - bank
  - ach
 
Policies
  - default
  - p2p-intent
  - alias-directory
 
Symbols
  - usd
  - dop
 
Signers
  - tesla
  - minka
  - ach
 
Intents
  - issue_money_usd_ach
  - issue_money_dop_ach
  - issue_money_usd_tesla
  - issue_money_dop_tesla
  - issue_money_usd_minka
  - issue_money_dop_minka

If you want to visualize the layout in its JSON structure, you can pass the flag --verbose

$ minka layout show --verbose
? Select Layout: Cross Ledger Payments
 
{
  "custom": {
    "title": "Cross Ledger Payments"
  },
  "values": [
    {
      "record": "signer",
      "values": [
        ...
      ]
    },
    {
      "record": "circle",
      "values": [
        ...
      ]
    },
    {
      "record": "policy",
      "values": [
        {
          "data": {
            "access": [
              {
                "action": "any",
                "signer": {
                  "$record": "owner"
                }
              },
              {
                "action": "read",
                "bearer": {
                  "$signer": {
                    "$record": "owner"
                  }
                }
              }
            ],
            "handle": "default",
            "record": "any",
            "schema": "access",
            "values": [
              {
                "action": "any",
                "signer": {
                  "$record": "owner"
                }
              },
              {
                "action": "read",
                "bearer": {
                  "$signer": {
                    "$record": "owner"
                  }
                }
              },
              {
                "action": "read",
                "bearer": {
                  "$signer": {
                    "$ledger": "owner"
                  }
                }
              },
              {
                "action": "spend",
                "bearer": {
                  "$signer": {
                    "$ledger": "owner"
                  }
                },
                "record": "wallet"
              },
              {
                "action": "read",
                "bearer": {
                  "$signer": {
                    "$circle": "ach"
                  }
                }
              }
            ]
          }
        },
        ...
      ]
    },
    {
      "record": "schema",
      "values": [
        {
          "data": {
            "access": [
              {
                "action": "any",
                "signer": {
                  "$record": "owner"
                }
              },
              {
                "action": "read",
                "bearer": {
                  "$signer": {
                    "$record": "owner"
                  }
                }
              }
            ],
            "format": "json-schema",
            "handle": "p2p",
            "record": "intent",
            "schema": {
              "type": "object"
            }
          }
        },
        ...
      ]
    },
    {
      "record": "symbol",
      "values": [
        {
          "data": {
            "access": [
              {
                "policy": "default"
              }
            ],
            "factor": 100,
            "handle": "usd"
          },
          "exec": {
            "keyPair": "key@ach"
          }
        },
        ...
      ]
    },
    {
      "record": "wallet",
      "values": [
        {
          "data": {
            "access": [
              {
                "policy": "default"
              }
            ],
            "custom": {
              "name": "Primary ACH Wallet"
            },
            "handle": "ach",
            "schema": "bank-wallet"
          },
          "exec": {
            "keyPair": "key@ach"
          }
        },
        ...
      ]
    },
    {
      "record": "intent",
      "values": [
        {
          "data": {
            "access": [
              {
                "policy": "default"
              }
            ],
            "claims": [
              {
                "action": "issue",
                "amount": 1000000000000000,
                "symbol": {
                  "handle": "usd"
                },
                "target": {
                  "handle": "ach"
                }
              }
            ],
            "handle": "issue_money_usd_ach",
            "schema": "intent"
          },
          "exec": {
            "keyPair": "key@ach"
          }
        },
        ...
      ]
    }
  ]
}
 
Cross Ledger Payments
---------------------------------------------------------------------------
 
Schemas
  - p2p
  - intent
  - tel-alias
  - bank-wallet
 
Wallets
  - ach
  - tesla
  - minka
 
Circles
  - bank
  - ach
 
Policies
  - default
  - p2p-intent
  - alias-directory
 
Symbols
  - usd
  - dop
 
Signers
  - tesla
  - minka
  - ach
 
Intents
  - issue_money_usd_ach
  - issue_money_dop_ach
  - issue_money_usd_tesla
  - issue_money_dop_tesla
  - issue_money_usd_minka
  - issue_money_dop_minka

Reading a layout with inputs

Some layouts can have variables, and they are represented with {{ inputs.<variableName> }}. It allows the creation of generic models that may vary in minimal details.

We can see the layouts with their variables by using the flag --raw

$ minka layout show --raw
? Select Layout: RTP Bank Domain
 
RTP Bank Domain
---------------------------------------------------------------------------
 
Wallets
  - {{inputs.domainName}}
 
Circles
  - owner@{{inputs.domainName}}
  - admin@{{inputs.domainName}}
  - security@{{inputs.domainName}}
  - operation@{{inputs.domainName}}
  - support@{{inputs.domainName}}
  - bridge@{{inputs.domainName}}
 
Policies
  - studio-navigation@{{inputs.domainName}}
  - owner@{{inputs.domainName}}
  - admin@{{inputs.domainName}}
  - security@{{inputs.domainName}}
  - operation@{{inputs.domainName}}
  - support@{{inputs.domainName}}
  - bridge@{{inputs.domainName}}
  - reporting-bridge@{{inputs.domainName}}
  
Domains
  - {{inputs.domainName}}

It's also possible to simulate how the layout would look like with its variables fulfilled, you just need to read the layout without the option —raw

$ minka layout show
? Select Layout: RTP Bank Domain
? Domain name: example.io
? Bank name: Example Bank
? Bank BIC: EXAMPLE BANK
 
RTP Bank Domain
---------------------------------------------------------------------------
 
Wallets
  - example.io
 
Circles
  - owner@example.io
  - admin@example.io
  - security@example.io
  - operation@example.io
  - support@example.io
  - bridge@example.io
 
Policies
  - studio-navigation@example.io
  - owner@example.io
  - admin@example.io
  - security@example.io
  - operation@example.io
  - support@example.io
  - bridge@example.io
  - reporting-bridge@example.io
  
Domains
  - example.io

On this page