Child Chain Permissions

From ArdorDocs
Jump to: navigation, search
Other languages:
  • English

Add Account Permission

Grants a permission to an account. For extended information refer to Child Chain Control.

Request: Refer to Create Transaction Request for common parameters.

  • requestType is addAccountPermission
  • chain (N) the chain that will be used for the operation
  • recipient is the recipient account ID
  • permission is one of the following: CHAIN_USER, CHAIN_ADMIN, CHAIN_ADMIN_BLOCKED or CHAIN_USER_BLOCKED. Refer to Permission Types for more information
  • publicKey is the public key of the recipient account (optional, enhances security of a new account)

Response: Refer to Create Transaction Response.

Add Account Permission Example

http://localhost:27876/nxt?
  requestType=addAccountPermission&
  chain=6&
  recipient=ARDOR-GHKP-XWB5-XMZB-CTUE3&
  &permission=CHAIN_USER&
  secretPhrase=IWontTellYou&
  feeNQT= 500000000&
  deadline=60
{
    "minimumFeeFQT": "1000000",
    "signatureHash": "465c1834e6b970db22392633685d7e5925fd80da4db995e09eb6b239c79eff8a",
    "transactionJSON": {
        "senderPublicKey": "028798b60eb4bbf7ebc974245164fdba476296a7ca6fc29d911c25b34cc8c508",
        "chain": 6,
        "signature": "59826b518355653f9da3e9f9aaa510ae77ffe80bbbf7697e8c074d656ba22408889c046de917b9103d1093acbd0e859c3fa1058e91969299331050f1a3e155ba",
        "feeNQT": "5000000",
        "type": 13,
        "fullHash": "27ad916646077c0b2ebe39b9b3507ed6994ba6290f6b384998952add017e474f",
        "version": 1,
        "fxtTransaction": "0",
        "phased": false,
        "ecBlockId": "7081362564929041377",
        "signatureHash": "465c1834e6b970db22392633685d7e5925fd80da4db995e09eb6b239c79eff8a",
        "attachment": {
            "version.AddPermission": 1,
            "permission": 2
        },
        "senderRS": "ARDOR-GHKP-XWB5-XMZB-CTUE3",
        "subtype": 0,
        "amountNQT": "0",
        "sender": "11579697950237343285",
        "recipientRS": "ARDOR-GHKP-XWB5-XMZB-CTUE3",
        "recipient": "11579697950237343285",
        "ecBlockHeight": 4822380,
        "deadline": 15,
        "timestamp": 76849388,
        "height": 2147483647
    },
    "unsignedTransactionBytes": "050000000d0001eca094040f00028798b60eb4bbf7ebc974245164fdba476296a7ca6fc29d911c25b34cc8c508353e3712ef59b3a00000000000000000404b4c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006c954900e13358f0bb0d4662000000000102000000000000000000000000000000000000000000000000000000000000000000000000",
    "broadcasted": true,
    "requestProcessingTime": 1847,
    "transactionBytes": "050000000d0001eca094040f00028798b60eb4bbf7ebc974245164fdba476296a7ca6fc29d911c25b34cc8c508353e3712ef59b3a00000000000000000404b4c000000000059826b518355653f9da3e9f9aaa510ae77ffe80bbbf7697e8c074d656ba22408889c046de917b9103d1093acbd0e859c3fa1058e91969299331050f1a3e155ba6c954900e13358f0bb0d4662000000000102000000000000000000000000000000000000000000000000000000000000000000000000",
    "fullHash": "27ad916646077c0b2ebe39b9b3507ed6994ba6290f6b384998952add017e474f"
}


Get Account Permissions

Queries the permissions of an account. For extended information refer to Child Chain Control.

Request:

  • requestType is getAccountPermissions
  • chain (N) the chain that will be used for the operation
  • account is the account in Reed-Solomon or numeric format
  • requireBlock is the block ID of a block that must be present in the blockchain during execution (optional)
  • requireLastBlock is the block ID of a block that must be last in the blockchain during execution (optional)

Response:

  • hasPermissions (A) is an array with permission objects as follows:
    • accountRS (S) is the Reed-Solomon address of the account
    • granterRS (S) is the Reed-Solomon address of the granter account
    • permission (S) is one of the following: MASTER_ADMIN, CHAIN_USER, CHAIN_ADMIN, CHAIN_ADMIN_BLOCKED or CHAIN_USER_BLOCKED. Refer to Permission Types for more information
    • granter (N) is the granter account ID
    • account (N) is the account ID
    • height (N) is the blockchain height when the permission was confirmed
  • hasEffectivePermissions (A) is an array with the effective permission objects(sum of the permissions, e.g., the sum of CHAIN_ADMIN + CHAIN_ADMIN_BLOCK permissions makes effective permission to be none) as follows:
    • accountRS (S) is the Reed-Solomon address of the account
    • granterRS (S) is the Reed-Solomon address of the granter account
    • permission (S) is one of the following: MASTER_ADMIN, CHAIN_USER, CHAIN_ADMIN, CHAIN_ADMIN_BLOCKED or CHAIN_USER_BLOCKED. Refer to Permission Types for more information
    • granter (N) is the granter account ID
    • account (N) is the account ID
    • height (N) is the blockchain height when the permission was confirmed
  • canGrantPermissions (A) is an array containing the permissions that the account can grant to other accounts
  • requestProcessingTime (N) is the API request processing time (in millisec)

Get Account Permissions Example

http://localhost:27876/nxt?
  requestType=getAccountPermissions&chain=2&
  account=ARDOR-W3LP-38DN-DCGZ-D46VG
{
    "hasPermissions": [
        {
            "accountRS": "ARDOR-W3LP-38DN-DCGZ-D46VG",
            "granterRS": "ARDOR-XUH6-ZNJZ-QCAB-G6VTJ",
            "permission": "CHAIN_USER",
            "granter": "16746464777760336356",
            "account": "13217081984130352725",
            "height": 616
        }
    ],
    "hasEffectivePermissions": [
        {
            "accountRS": "ARDOR-W3LP-38DN-DCGZ-D46VG",
            "granterRS": "ARDOR-XUH6-ZNJZ-QCAB-G6VTJ",
            "permission": "CHAIN_USER",
            "granter": "16746464777760336356",
            "account": "13217081984130352725",
            "height": 616
        }
    ],
    "canGrantPermissions": [],
    "requestProcessingTime": 3
}


Get Chain Permissions

Queries the permissions of a chain. For extended information refer to Child Chain Control.

Request:

  • requestType is getChainPermissions
  • chain (N) the chain that will be queried
  • permission (S) is for filtering with one of the following permissions: MASTER_ADMIN, CHAIN_USER, CHAIN_ADMIN, CHAIN_ADMIN_BLOCKED or CHAIN_USER_BLOCKED. Refer to Permission Types for more information
  • granter is for filtering with the granter account ID (optional)
  • firstIndex is a zero-based index to the first permission data to retrieve (optional)
  • lastIndex is a zero-based index to the last permission data to retrieve (optional)
  • adminPassword (S) is the configured admin password in case the API is being invoked remotely (optional)
  • requireBlock is the block ID of a block that must be present in the blockchain during execution (optional)
  • requireLastBlock is the block ID of a block that must be last in the blockchain during execution (optional)

Response:

  • permissions (A) is an array with permission objects as follows:
    • accountRS (S) is the Reed-Solomon address of the account
    • granterRS (S) is the Reed-Solomon address of the granter account
    • permission (S) is one of the following: MASTER_ADMIN, CHAIN_USER, CHAIN_ADMIN, CHAIN_ADMIN_BLOCKED or CHAIN_USER_BLOCKED. Refer to Permission Types for more information
    • granter (N) is the granter account ID
    • account (N) is the account ID
    • height (N) is the block when the permission was issued

Get Chain Permissions Example

http://localhost:27876/nxt?
  requestType=getChainPermissions&chain=6&
  permission=MASTER_ADMIN
{
    "permissions": [
        {
            "accountRS": "ARDOR-XUH6-ZNJZ-QCAB-G6VTJ",
            "granterRS": "ARDOR-2222-2222-2222-22222",
            "permission": "MASTER_ADMIN",
            "granter": "0",
            "account": "16746464777760336356",
            "height": -1
        },
        {
            "accountRS": "ARDOR-Z4T9-P9PG-WMHW-DZL2G",
            "granterRS": "ARDOR-2222-2222-2222-22222",
            "permission": "MASTER_ADMIN",
            "granter": "0",
            "account": "13187207842289912615",
            "height": -1
        },
        {
            "accountRS": "ARDOR-5C4Q-ZNFC-66M7-C676M",
            "granterRS": "ARDOR-2222-2222-2222-22222",
            "permission": "MASTER_ADMIN",
            "granter": "0",
            "account": "12218447196036638806",
            "height": -1
        },
        {
            "accountRS": "ARDOR-56LK-M7US-U7U3-C27BL",
            "granterRS": "ARDOR-2222-2222-2222-22222",
            "permission": "MASTER_ADMIN",
            "granter": "0",
            "account": "12188043072533271121",
            "height": -1
        },
        {
            "accountRS": "ARDOR-LBVD-DWTF-JP9R-7V2PP",
            "granterRS": "ARDOR-2222-2222-2222-22222",
            "permission": "MASTER_ADMIN",
            "granter": "0",
            "account": "6544886254165108587",
            "height": -1
        }
    ],
    "requestProcessingTime": 0
}


Remove Account Permission

Revokes a permission to an account. For extended information refer to Child Chain Control.

Request: Refer to Create Transaction Request for common parameters.

  • requestType is removeAccountPermission
  • chain (N) the chain that will be used for the operation
  • recipient is the recipient account ID
  • permission is one of the following: CHAIN_USER, CHAIN_ADMIN, CHAIN_ADMIN_BLOCKED or CHAIN_USER_BLOCKED. Refer to Permission Types for more information
  • publicKey is the public key of the recipient account (optional, enhances security of a new account)

Response: Refer to Create Transaction Response.

Remove Account Permission Example

http://localhost:27876/nxt?
  requestType=removeAccountPermission&
  chain=6&
  recipient=ARDOR-GHKP-XWB5-XMZB-CTUE3&
  permission=CHAIN_USER&
  secretPhrase=IWontTellYou&
  feeNQT=1000000&
  deadline=60
{
    "minimumFeeFQT": "1000000",
    "signatureHash": "21832398d8e44df848182716faea73bc915c477a941d20b86639b43e52edff4f",
    "transactionJSON": {
        "senderPublicKey": "028798b60eb4bbf7ebc974245164fdba476296a7ca6fc29d911c25b34cc8c508",
        "chain": 6,
        "signature": "8e571b25ea82d1a03396c507a42c7b82fa1aa4fd3f77ccd5543ca69169752a07de2a16385e7fa996eba5b1497a4bec06b68737332b0796f21292826ffefba3c1",
        "feeNQT": "5000000",
        "type": 13,
        "fullHash": "1ec2e926d90e83a21bc5d2c6cd4ac05aa347d8ffd9af07deff96ee0e048475ef",
        "version": 1,
        "fxtTransaction": "0",
        "phased": false,
        "ecBlockId": "5829720331734290044",
        "signatureHash": "21832398d8e44df848182716faea73bc915c477a941d20b86639b43e52edff4f",
        "attachment": {
            "version.RemovePermission": 1,
            "permission": 2,
            "height": -1
        },
        "senderRS": "ARDOR-GHKP-XWB5-XMZB-CTUE3",
        "subtype": 1,
        "amountNQT": "0",
        "sender": "11579697950237343285",
        "recipientRS": "ARDOR-GHKP-XWB5-XMZB-CTUE3",
        "recipient": "11579697950237343285",
        "ecBlockHeight": 4826679,
        "deadline": 15,
        "timestamp": 76849583,
        "height": 2147483647
    },
    "unsignedTransactionBytes": "050000000d0101afa194040f00028798b60eb4bbf7ebc974245164fdba476296a7ca6fc29d911c25b34cc8c508353e3712ef59b3a00000000000000000404b4c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000037a649007c0ee528c153e750000000000102ffffffff000000000000000000000000000000000000000000000000000000000000000000000000",
    "broadcasted": true,
    "requestProcessingTime": 9,
    "transactionBytes": "050000000d0101afa194040f00028798b60eb4bbf7ebc974245164fdba476296a7ca6fc29d911c25b34cc8c508353e3712ef59b3a00000000000000000404b4c00000000008e571b25ea82d1a03396c507a42c7b82fa1aa4fd3f77ccd5543ca69169752a07de2a16385e7fa996eba5b1497a4bec06b68737332b0796f21292826ffefba3c137a649007c0ee528c153e750000000000102ffffffff000000000000000000000000000000000000000000000000000000000000000000000000",
    "fullHash": "1ec2e926d90e83a21bc5d2c6cd4ac05aa347d8ffd9af07deff96ee0e048475ef"
}