Anchoring
As explained in the design section, Service Chain supports the data anchoring feature. This page shows how to enable the anchoring function. If it is enabled, SCN anchors periodically the child chain block data to the parent chain as proof of existence and immutability. This ensures the security and credibility of the service chain.
Enable Anchoring
Check Parent Operator of SCN
If you have installed and run an SCN successfully, the parent chain operator account should be generated. You can provide a keystore file that you want to use as a parent operator, or if not provided, the SCN will generate the key for you. You can check the parent operator address via RPC API, subbridge_parentOperator
.
This parent operator account address is derived from a keystore file in $dataDIR/parent_bridge_account
directory.
Add KLAY to Parent Operator account
When SCN anchors the block data, SCN makes an anchoring transaction as a parent operator. Therefore the account needs KLAY to pay the transaction fee. You should add enough KLAY to the parent operator account.
Enable Anchoring
After sending KLAY, you can check the balance like below.
Then you can enable anchoring via RPC API, subbridge.anchoring
, like below. You can refer to subbridge APIs for more details.
Check Anchoring Data
If the anchoring feature is enabled, SCN will periodically anchor the block data to the main chain. You can check the anchored data like below.
Sub-Bridge
In Sub-Bridge, You can check the latest anchored block number like below. You can refer to subbridge APIs for more details.
Also, you can find the anchoring transaction hash by the service chain block number like below.
Main-Bridge
In Main-Bridge, if chain indexing option is enabled, you can find the anchoring tx hash by a service chain block hash like below. You can refer to mainbridge APIs for more details.
You can get the decoded anchoring data by anchoring transaction hash like below.
Last updated