Chain Connector plugin: Endpoint reference

This page summarizes all API endpoints specific to the Chain Connector Plugin.

All the aforementioned endpoints are invoked using the chainConnector prefix.

Endpoints can be invoked as explained in the Connecting via endpoints guide.

chainConnector_getSentCCUs

Whenever a CCU is successfully sent, it’s saved in the plugin store database. This endpoint returns all such sent CCUs.

  • Specification

  • Node CLI

  • cURL

No Parameters.

klayr-core endpoint:invoke chainConnector_getSentCCUs --pretty
curl --location 'http://127.0.0.1:7887/rpc' \
--header 'Content-Type: application/json' \
--data '{
    "jsonrpc": "2.0",
    "id": "1",
    "method": "chainConnector_getSentCCUs",
    "params": {}
}'
Response
Example output
{
    "list": [
        {
            "module": "interoperability",
            "command": "submitMainchainCrossChainUpdate",
            "params": {
                "activeValidatorsUpdate": {
                    "bftWeightsUpdate": [],
                    "bftWeightsUpdateBitmap": "",
                    "blsKeysUpdate": []
                },
                "certificate": {
                    "aggregationBits": "1f",
                    "blockID": "ba44da898916dee0f6a61ab6c19f92d4c6c2c3398dacffc9f3384028b79d5b45",
                    "height": 12,
                    "signature": "888e328ac1262b7e2a344738b0e55e6b881fcbacc47e9aa48c320146f1f2b1a6a442231d7de8aa684f36baa4fec7821d1883905721be982e0067934c5a57cdfb3055537b61fac2144763e111c9bab4c218c23c93e6c472ce08c63eaf1220e51a",
                    "stateRoot": "bf58c16f1c1eb9e845eeb81a0a07aaa32f1631897eda37fef2e075aaf780e7b4",
                    "timestamp": 1710934315,
                    "validatorsHash": "003fc70678d219f3d66c3054538801946ef2c0a4067136717a886ae57c7b0b34"
                },
                "inboxUpdate": {
                    "crossChainMessages": [],
                    "messageWitnessHashes": [],
                    "outboxRootWitness": {
                        "bitmap": "",
                        "siblingHashes": []
                    }
                },
                "certificateThreshold": "4",
                "sendingChainID": "04000002"
            },
            "nonce": "2",
            "fee": "500000",
            "senderPublicKey": "46b160b7a24b8813318eb753ef5be4c0a31fe1a3a2789d9253df1617ed4ae829",
            "signatures": [
                "b9fa7f8a25540a084efddc3e547299bac38d28f67a18b496ff8bb1c1002b9149e7a0465508b0263af02885d95270cf78375c5c298f75b7f0aebc3dfb8bbe2f0e"
            ],
            "id": "7660b9ee495890d89da7ba8db3e1484f74be3e271f58764bfd6ff31132b192d2"
        },
        {
            "module": "interoperability",
            "command": "submitMainchainCrossChainUpdate",
            "params": {
                "activeValidatorsUpdate": {
                    "bftWeightsUpdate": [],
                    "bftWeightsUpdateBitmap": "",
                    "blsKeysUpdate": []
                },
                "certificate": {
                    "aggregationBits": "1f",
                    "blockID": "d754843e8bbacba213de23b55cdb7acfd1648a00e846e1779df805b932dfeb53",
                    "height": 11,
                    "signature": "938331e82fa17963ce8a12d5152f34be6606e16afbc5a941bb2ad2309888382b140ffbe8544fa9348b823b80e4a1180008d58215131e7e677d3de1b59d95b899f9b25b4a41d04e13d4909c31a459e316c4096b849b24d36020270df023e0ffb4",
                    "stateRoot": "d6da18c593026a877fa1203686ec6c4440786bd45e82d6a81ed597ea09b85d42",
                    "timestamp": 1710934310,
                    "validatorsHash": "003fc70678d219f3d66c3054538801946ef2c0a4067136717a886ae57c7b0b34"
                },
                "inboxUpdate": {
                    "crossChainMessages": [],
                    "messageWitnessHashes": [],
                    "outboxRootWitness": {
                        "bitmap": "",
                        "siblingHashes": []
                    }
                },
                "certificateThreshold": "4",
                "sendingChainID": "04000002"
            },
            "nonce": "1",
            "fee": "500000",
            "senderPublicKey": "46b160b7a24b8813318eb753ef5be4c0a31fe1a3a2789d9253df1617ed4ae829",
            "signatures": [
                "b8a522cd01830903ebcbf072b90cb2eec96a2bc3183d7f6123a466c7ef2d5fb5da8e91289cc01f89ded553f05070f00432ede9bfa43ce616d84776e89d58ca0f"
            ],
            "id": "0315d6b8f30a2cb9afa1f7cb4fb952310fd072394cf41bddf59d12825598fe8b"
        },
        {
            "module": "interoperability",
            "command": "submitMainchainCrossChainUpdate",
            "params": {
                "activeValidatorsUpdate": {
                    "bftWeightsUpdate": [],
                    "bftWeightsUpdateBitmap": "",
                    "blsKeysUpdate": []
                },
                "certificate": {
                    "aggregationBits": "1f",
                    "blockID": "13f4ab0a0f39aefdaa98bbc403fb267126454a83727b40d5d70ccc83ae01b259",
                    "height": 10,
                    "signature": "a0f1db771bfd6ed46e3f25d85425eac0b4cec07762bb2c0b0d8fde423a776e998bbe238c1fceac33f8bd9e7858f8d6ce13cec2d44796583d0314819755d7c28b1d82a861bc9ae8fdd8b1a36daa394a3e4384b11ee93c9f31212696a64a1a3449",
                    "stateRoot": "e239c1114e42a63ae045faba15f641b2c1bc3f8c06fd8c1cbc3a5739f487ab06",
                    "timestamp": 1710934305,
                    "validatorsHash": "003fc70678d219f3d66c3054538801946ef2c0a4067136717a886ae57c7b0b34"
                },
                "inboxUpdate": {
                    "crossChainMessages": [],
                    "messageWitnessHashes": [],
                    "outboxRootWitness": {
                        "bitmap": "",
                        "siblingHashes": []
                    }
                },
                "certificateThreshold": "4",
                "sendingChainID": "04000002"
            },
            "nonce": "0",
            "fee": "500000",
            "senderPublicKey": "46b160b7a24b8813318eb753ef5be4c0a31fe1a3a2789d9253df1617ed4ae829",
            "signatures": [
                "13926b70b7d140c534dbdf1de5f8f464c87167f9277841ec66d8a0b6a51d94f975611e04680eed6b50ddcb7e9af2097089bae992c0933ac8dadb03af2946e40f"
            ],
            "id": "1f4deeffebc72e633c516f4ebb5c19a5e666b9024c13841c5d7ec3cfa9826a0f"
        }
    ],
    "total": 3
}

chainConnector_getAggregateCommits

Returns aggregate commits from the plugin’s database.

  • Specification

  • Node CLI

  • cURL

Table 1. Parameters
Name Type Description Sample

from

number

Lower limit of height from where the node should start looking for Cross Chain messages.

840

to

number

Upper limit of height until where the node should look for Cross Chain messages.

1000

klayr-core endpoint:invoke chainConnector_getAggregateCommits --pretty
curl --location 'http://127.0.0.1:7887/rpc' \
--header 'Content-Type: application/json' \
--data '{
    "jsonrpc": "2.0",
    "id": "1",
    "method": "chainConnector_getAggregateCommits",
    "params": {
        "from": 840,
        "to": 1000
    }
}'
Response
Example output
[
    {
        "height": 852,
        "aggregationBits": "01",
        "certificateSignature": "a84a1de5cad91b9c402999779644af51c768ff3767aefc92a491c77c4df8c403a4290b3148459a22fddb6bf3353af42d11b73ba8af467cf9d4abcb8529df085b91f7fbeb443c30985d8f84989a148116696dd8ee8f69b7ab47a89b6f77e21987"
    },
    {
        "height": 851,
        "aggregationBits": "01",
        "certificateSignature": "8468631bed40686bda8157556229ae0f43c26d529f5385fb9e2df8fce14ef0f4c013ba04a6c520cfd7cb425f1840f38b0ca3b86fb64721f7c233730523151c204a03aeb5691dc0e94ea551da10c4fe5df6a2d13572e4840328b796391602e4ec"
    }
]

chainConnector_getBlockHeaders

Returns block headers.

  • Specification

  • Node CLI

  • cURL

Table 2. Parameters
Name Type Description Sample

from

number

Lower limit of height from where the node should start looking for Cross Chain messages.

840

to

number

Upper limit of height until where the node should look for Cross Chain messages.

1000

klayr-core endpoint:invoke chainConnector_getBlockHeaders --pretty
curl --location 'http://127.0.0.1:7887/rpc' \
--header 'Content-Type: application/json' \
--data '{
    "jsonrpc": "2.0",
    "id": "1",
    "method": "chainConnector_getBlockHeaders",
    "params": {
        "from": 840,
        "to": 1000
    }
}'
Response
Example output
[
    {
        "version": 2,
        "timestamp": 1710938780,
        "height": 905,
        "previousBlockID": "2ea85245f1fe5079ed9a8718ebcf4b650a68c9b8ffd0c87c1ab83bad2ca1f46c",
        "stateRoot": "52dff6ee32117f9e091fd09b9d704094addddd7dc40e043de6ac19d930c34a82",
        "assetRoot": "35c6fa642f6068b4a6fdc15452dcda94362be992d79a81871301dea04ec0cda2",
        "eventRoot": "11ab2f40b42a4ed38c8a6a20f647d8b02c82131b8ddedb87ad1f1504667adcf9",
        "transactionRoot": "d79c774a6b487e4313543835f36f371ac1313a6d1cb6ec58d9ed436f21f4e058",
        "validatorsHash": "f626be7093592d81cde5bbae150a67db52619e0fd193ee61aebe847c45dd557e",
        "aggregateCommit": {
            "height": 903,
            "aggregationBits": "01",
            "certificateSignature": "90aaac7230c77fe5e27304c9e6a4c20054bbdd035751dd1842cd579acc3fd0a8ed5bbf77cd50d384b516673f654e852b0dc775222083178be34b7c16b7712f1e8e522bd9947a3bc9d514694cf4bc879bb6f9f16af341035f3cdf319f9b9f2b9b"
        },
        "generatorAddress": "klyz98oaohxaw6jcfvtgdxm9sprcqzstddoqusrns",
        "maxHeightPrevoted": 904,
        "maxHeightGenerated": 904,
        "impliesMaxPrevotes": true,
        "signature": "631dedcfcffe04ae4850107f1a1b8af76bed062259723ce82cb5a8921ec0f215b77b8ead7a89f2e5053119c78fa83f1dd825f4cb6c7d3ae98f25ef032da4480c",
        "id": "8933a8bfea33eccb12c4ba5b79be656eda376d5402f430c89743a3b0e1cedceb"
    },
    {
        "version": 2,
        "timestamp": 1710938775,
        "height": 904,
        "previousBlockID": "93387fae3eb187ef3e0212bd1350e8211973865d50b343891c53f848240ebceb",
        "stateRoot": "b80f27f36715a2c617bf362bdc3f259a37f3166c023d11275a3636c681a0b4e6",
        "assetRoot": "d10fdb11000184449e64963d39ceef5d82a70ada1298929419a04424939fa8d0",
        "eventRoot": "edd6e6231bcc0eafa931d534618a9660330142c90462d097ffcbdd584d656cfc",
        "transactionRoot": "2d5bf0304150c7e4fe7056b3e1a4e272b5c268d4e8d23440c4dc39b0d8e35010",
        "validatorsHash": "f626be7093592d81cde5bbae150a67db52619e0fd193ee61aebe847c45dd557e",
        "aggregateCommit": {
            "height": 902,
            "aggregationBits": "01",
            "certificateSignature": "8062f1ef0807f0bb1afa52b51f9cb105cf38627ba65f62a67895d734cda5f80e65d42d443b4b05f612afacfb2211612411d6770f807803c7addd87a203cc344ba9539aad604719dd192904ba69b367ed24c544c72adc33ebd662f5be21549d0d"
        },
        "generatorAddress": "klyz98oaohxaw6jcfvtgdxm9sprcqzstddoqusrns",
        "maxHeightPrevoted": 903,
        "maxHeightGenerated": 903,
        "impliesMaxPrevotes": true,
        "signature": "07c135ce623ed4a3dfe0aa2e07a45c7231136556d394bbf6255843fa8ed40e79388a5359d7f4d402b71cb60a5503a5be73ec356f29779a3cc1f05b6c8e82b80a",
        "id": "2ea85245f1fe5079ed9a8718ebcf4b650a68c9b8ffd0c87c1ab83bad2ca1f46c"
    },
    {
        "version": 2,
        "timestamp": 1710938770,
        "height": 903,
        "previousBlockID": "dac53d7ce5299ffe31195af611fc23e24d772f6bfdb4abed525efab397795ed7",
        "stateRoot": "8a262add795ad2da3d96fee2b761e9e5f5cb9d67d3058fc76c72fc308535ba4d",
        "assetRoot": "3637ecda054f6fe318560338d42f3051506898346ab09e011a246e49d71fb191",
        "eventRoot": "30a5b2cb9aa3c0b2d8801cd2efdd594cbc9d8096e10e2c2e5fb42f91613657db",
        "transactionRoot": "6e56984a65d98f34836373aea6319093f8eb0d5edc0b776b5b0d27df96a68fe1",
        "validatorsHash": "f626be7093592d81cde5bbae150a67db52619e0fd193ee61aebe847c45dd557e",
        "aggregateCommit": {
            "height": 901,
            "aggregationBits": "01",
            "certificateSignature": "a55cc53ba8bedc349b318f6af27a9cd6c1205b7179b74092f6bd2986c15dc0dbc09484fd71d0ee030d155e413e329d34118ee6fd584b3fe93d9423caaa6418486efaa9a87cd9996a52f0a3cfbef69b103bdd5a51c7b2c353224c6cff31c49102"
        },
        "generatorAddress": "klyz98oaohxaw6jcfvtgdxm9sprcqzstddoqusrns",
        "maxHeightPrevoted": 902,
        "maxHeightGenerated": 902,
        "impliesMaxPrevotes": true,
        "signature": "8b10787e06adc6c7efda99ba85dc853c6de54632067a6d83982fa2ba9b15b1f948fe8b57ecbca973045bbfb102a0e1bba3a6e37afa77aa0495b6eb68d2421207",
        "id": "93387fae3eb187ef3e0212bd1350e8211973865d50b343891c53f848240ebceb"
    },
    {
        "version": 2,
        "timestamp": 1710938765,
        "height": 902,
        "previousBlockID": "c124d2f3c26ff8840a722cdd3ef6ef228be3c062c494c4f2f590a059351391fd",
        "stateRoot": "33d84699ae73047b64ada93527a7095f195436ffa2ae2980ff702bbe2ac0b117",
        "assetRoot": "aa3c5f41f5f4428a2d32e80a17a896bd6893815ce480ee3ab7e4fd5a5bfb517f",
        "eventRoot": "90e0af8611aee0491cc4214c93605fc9050f7c54bcd9ffcc935d600dfddeeba0",
        "transactionRoot": "b82f831f0f97d63819fed7ecb301af4bd645650826989ba2f991016ad1a793e5",
        "validatorsHash": "f626be7093592d81cde5bbae150a67db52619e0fd193ee61aebe847c45dd557e",
        "aggregateCommit": {
            "height": 900,
            "aggregationBits": "01",
            "certificateSignature": "a8eaad357942e1c92567a9080e88c778737c9b1596f3cdc2d6fb35c9511f00c054513f89d05f23b5914c1520fa723def03678da0099684f4e23249243b6fd10aba1c16952a9a1c34f147d154a0db37d4a8d327fc2b3457fa8d0e9079ff38fbb9"
        },
        "generatorAddress": "klyz98oaohxaw6jcfvtgdxm9sprcqzstddoqusrns",
        "maxHeightPrevoted": 901,
        "maxHeightGenerated": 901,
        "impliesMaxPrevotes": true,
        "signature": "45b441ff6eae9bfa686a7a16b8406dab415d6998d28ff34864c66de7f1c29fadd4a178375c6ba7d3fb21f96313888a0380436bbc21644955c69e90469e483f02",
        "id": "dac53d7ce5299ffe31195af611fc23e24d772f6bfdb4abed525efab397795ed7"
    }
]

chainConnector_getCrossChainMessages

Returns the cross-chain messages sent across chains. This includes CCMs parsed from CrossChainMessageSentSuccess and CrossChainMessageProcessed events.

  • Specification

  • Node CLI

  • cURL

Table 3. Parameters
Name Type Description Sample

from

number

Lower limit of height from where the node should start looking for Cross Chain messages.

840

to

number

Upper limit of height until where the node should look for Cross Chain messages.

1000

klayr-core endpoint:invoke chainConnector_getCrossChainMessages '{"from":840, "to":1000}' --pretty
curl --location 'http://127.0.0.1:7887/rpc' \
--header 'Content-Type: application/json' \
--data '{
    "jsonrpc": "2.0",
    "id": "1",
    "method": "chainConnector_getCrossChainMessages",
    "params": {
        "from": 840,
        "to": 1000
    }
}'
Response
Example output
[
    {
        "module": "token",
        "crossChainCommand": "transferCrossChain",
        "nonce": "129",
        "fee": "10000000",
        "sendingChainID": "04000000",
        "receivingChainID": "04000001",
        "params": "0a0804000000000000001080c8afa0251a14d6a3789ad0ca09044cac3bead52f652d2d8fb4e62214081ebdc2588b318d146189ac86c05dc7beede2c02a136363207472616e736665722074657374696e67",
        "status": 0,
        "height": 949
    }
]

chainConnector_getLastSentCCM

Returns the last sent cross-chain message, if any, otherwise, it throws an error: "No CCM was sent so far".

  • Specification

  • Node CLI

  • cURL

No Parameters.

klayr-core endpoint:invoke chainConnector_getLastSentCCM --pretty
curl --location 'http://127.0.0.1:7887/rpc' \
--header 'Content-Type: application/json' \
--data '{
    "jsonrpc": "2.0",
    "id": "1",
    "method": "chainConnector_getLastSentCCM",
    "params": {}
}'
Response
Example output
{
    "module": "interoperability",
    "crossChainCommand": "registration",
    "nonce": "0",
    "fee": "0",
    "sendingChainID": "04000002",
    "receivingChainID": "04000000",
    "params": "0a0e6c69736b5f6d61696e636861696e1204040000001a08040000000000000020e807",
    "status": 0,
    "height": 13,
    "outboxSize": 1
}

chainConnector_getAllValidatorsData

Returns validator info from validatorsHashPreimage key-value store.

  • Specification

  • Node CLI

  • cURL

No Parameters.

klayr-core endpoint:invoke chainConnector_getAllValidatorsData --pretty
curl --location 'http://127.0.0.1:7887/rpc' \
--header 'Content-Type: application/json' \
--data '{
    "jsonrpc": "2.0",
    "id": "1",
    "method": "chainConnector_getAllValidatorsData",
    "params": {}
}'
Response
Example output
[
    {
        "certificateThreshold": "1",
        "validators": [
            {
                "address": "",
                "bftWeight": "1",
                "blsKey": "811e8df1a063f94ad7746350f50956f89397a60c070b80d8c12337c0fc4f40e34635ad55c552324911b0b14c9b07c725"
            }
        ],
        "validatorsHash": "f626be7093592d81cde5bbae150a67db52619e0fd193ee61aebe847c45dd557e",
        "height": 994
    },
    {
        "certificateThreshold": "3",
        "validators": [
            {
                "address": "",
                "bftWeight": "1",
                "blsKey": "aeabe96e853e777a6c127c77d83606d1310ef6558ccd461652771c651696bb65248bf790f5a9143ad488affaf5d81345"
            },
            {
                "address": "",
                "bftWeight": "1",
                "blsKey": "b0f0ea27a00cd7c193c7958fa72fcf04ce474807138006229f73b1ed3fa5ea1955e8b7e186ad00da8c79e3327c8dab9b"
            },
            {
                "address": "",
                "bftWeight": "1",
                "blsKey": "811e8df1a063f94ad7746350f50956f89397a60c070b80d8c12337c0fc4f40e34635ad55c552324911b0b14c9b07c725"
            }
        ],
        "validatorsHash": "be25a0ce5a1f030bec7968cede5e8ea3ec57d3c28220d15860908838e95f9b0d",
        "height": 63
    },
    {
        "certificateThreshold": "2",
        "validators": [
            {
                "address": "",
                "bftWeight": "1",
                "blsKey": "811e8df1a063f94ad7746350f50956f89397a60c070b80d8c12337c0fc4f40e34635ad55c552324911b0b14c9b07c725"
            },
            {
                "address": "",
                "bftWeight": "1",
                "blsKey": "b0f0ea27a00cd7c193c7958fa72fcf04ce474807138006229f73b1ed3fa5ea1955e8b7e186ad00da8c79e3327c8dab9b"
            }
        ],
        "validatorsHash": "bc3e1665d3859a13322f0a534dac9ad700f95db6eb6b30ace5b3593a69a4e102",
        "height": 72
    },
    {
        "certificateThreshold": "3",
        "validators": [
            {
                "address": "",
                "bftWeight": "1",
                "blsKey": "aeabe96e853e777a6c127c77d83606d1310ef6558ccd461652771c651696bb65248bf790f5a9143ad488affaf5d81345"
            },
            {
                "address": "",
                "bftWeight": "1",
                "blsKey": "811e8df1a063f94ad7746350f50956f89397a60c070b80d8c12337c0fc4f40e34635ad55c552324911b0b14c9b07c725"
            },
            {
                "address": "",
                "bftWeight": "1",
                "blsKey": "a1e9b454e298dc1994612e01114ceffb23c39ec6ef5fde19aa6b6f3ca71d02f776a82db86940f868d69f91918cf27dac"
            },
            {
                "address": "",
                "bftWeight": "1",
                "blsKey": "b0f0ea27a00cd7c193c7958fa72fcf04ce474807138006229f73b1ed3fa5ea1955e8b7e186ad00da8c79e3327c8dab9b"
            }
        ],
        "validatorsHash": "1f58369c6b9c4995781002a5a1d85ba03e2fe4cf3e80857c62784764ada1c9e8",
        "height": 54
    },
    {
        "certificateThreshold": "4",
        "validators": [
            {
                "address": "",
                "bftWeight": "1",
                "blsKey": "811e8df1a063f94ad7746350f50956f89397a60c070b80d8c12337c0fc4f40e34635ad55c552324911b0b14c9b07c725"
            },
            {
                "address": "",
                "bftWeight": "1",
                "blsKey": "a1e9b454e298dc1994612e01114ceffb23c39ec6ef5fde19aa6b6f3ca71d02f776a82db86940f868d69f91918cf27dac"
            },
            {
                "address": "",
                "bftWeight": "1",
                "blsKey": "888808e49bbef69b9dd3388611f3add320bf777674cd8478150ca1d5bacfdad5c1315fb982e9b8aa8c3c6ac51c7d8ea2"
            },
            {
                "address": "",
                "bftWeight": "1",
                "blsKey": "aeabe96e853e777a6c127c77d83606d1310ef6558ccd461652771c651696bb65248bf790f5a9143ad488affaf5d81345"
            },
            {
                "address": "",
                "bftWeight": "1",
                "blsKey": "b0f0ea27a00cd7c193c7958fa72fcf04ce474807138006229f73b1ed3fa5ea1955e8b7e186ad00da8c79e3327c8dab9b"
            }
        ],
        "validatorsHash": "003fc70678d219f3d66c3054538801946ef2c0a4067136717a886ae57c7b0b34",
        "height": 45
    }
]

chainConnector_authorize

Allows authorization of the Chain Connector plugin on a node.

  • Specification

  • Node CLI

  • cURL

Table 4. Parameters
Name Type Description Sample

password

string

Password used to create the encryptedPrivateKey mentioned in the Chain Connector plugin’s configuration.

klayr

enable

boolean

A Boolean flag that indicates whether or not to authorize the Chain Connector plugin.

true

klayr-core endpoint:invoke chainConnector_authorize '{"password": "klayr", "enable":true}' --pretty
curl --location 'http://127.0.0.1:7887/rpc' \
--header 'Content-Type: application/json' \
--data '{
    "jsonrpc": "2.0",
    "id": "1",
    "method": "chainConnector_authorize",
    "params": {
        "password": "klayr",
        "enable": true
    }
}'
Response
Example output
{
    "result": "Successfully enabled the chain connector plugin."
}