User guide
This topic describes how to use the Cross-chain Service console. It covers registering a blockchain, configuring cross-chain authorization for ledger data access and contract message pushes, viewing permissions, and checking contract messages.
Register a blockchain
Registering your blockchain is the first step in establishing a cross-chain connection. After you register a blockchain, the cross-chain data connection service accesses your blockchain and deploys a cross-chain contract to it. This contract is used for cross-chain information exchange.
This service currently supports Ant Blockchain and Hyperledger Fabric. To register other types of blockchains, contact the product team.
Register an Ant Blockchain
Log on to the Cross-chain Service console.
Click Register Blockchain to open the registration page.
Set Blockchain Type to Ant Blockchain, and then complete the registration steps.
Follow the on-screen instructions to provide the basic information, account information, and certificate information for the Ant Blockchain. The cross-chain service uses this information to access the blockchain, deploy the cross-chain system contract, and submit cross-chain transactions.

Register a Fabric blockchain
Log on to the Cross-chain Service console.
Click Register Blockchain to open the registration page.
Set Blockchain Type to Hyperledger Fabric, and then complete the registration steps.
Follow the on-screen instructions to register.

Download the cross-chain chaincode package, create a channel, and install the chaincode package.
Download the cross-chain chaincode package from the page.
On your Hyperledger Fabric blockchain, create a channel for the cross-chain service.
Install the chaincode package in the created channel.
Create an account or request a certificate to obtain the configuration file.
On your Hyperledger Fabric blockchain, register an account or request a certificate for the cross-chain service to use.
If you are an Alibaba Cloud Hyperledger Fabric user, download the software development kit (SDK) configuration file. After you decompress the file, obtain the
connection-profile-standard.yamlconfiguration file. If you are not an Alibaba Cloud Hyperledger Fabric user, contact Ant technical support to obtain the configuration file.
Register the blockchain, provide the account or certificate, and upload the configuration file.
On the page, create a blockchain domain name and upload the `connection-profile-standard.yaml` configuration file that you obtained in the previous step.
After the registration is successful, provide the blockchain anchoring information. This information includes the cross-chain channel name, selected validation nodes, and the username and password that you created in the previous step.

Alternatively, you can directly upload the certificate and private key.

After the registration is complete, you can view information about the registered chain in the console.
Cross-chain management
View cross-chain domain name details
Log on to the Cross-chain Service console.
Click the Details button next to the registered blockchain to open the details page.
On the Basic Information tab, you can view details about the cross-chain domain name.
On this tab, you can view the blockchain's basic information within the cross-chain system, the domain name certificate, and the UDSN certificate.
View cross-chain system contracts
Log on to the Cross-chain Service console.
Click the Details button next to the registered blockchain to open the details page.
On the Contract Information tab, you can view information about the cross-chain contracts that the cross-chain system has deployed to this blockchain.
Ant Blockchain cross-chain contract information
Fabric cross-chain contract information
Cross-chain authorization - Ledger data access
Log on to the Cross-chain Service console.
Click the Details button next to the registered blockchain to open the product page.
Click the Cross-chain Authorization tab to open the authorization page.
In the upper-right corner, click New Authorization.
In the dialog box that appears, you can authorize another registered blockchain to access the current blockchain's ledger data through the cross-chain service.

Cross-chain authorization - Contract message push
Log on to the Cross-chain Service console.
Click the Details button next to the registered blockchain to open the product page.
Click the Cross-chain Authorization tab to open the authorization page.
In the upper-right corner, click New Authorization.
In the dialog box that appears, you can authorize a specific contract on another registered blockchain to send messages to a specific contract on the current blockchain.

In the authorization example shown in the preceding figure, the blockchain
crosschain1.oracle.chainallows the contractsourceContracton the blockchaincrosschain2.oracle.chainto send messages to the contractdestContracton the local blockchain.ImportantIf you do not configure authorization settings, cross-chain ledger data access and message pushes through the cross-chain data connection service will fail.
View my permissions
If other blockchains have granted you permissions, you can view them in the My Permissions section.

Business contract development
Ledger data access development flow
The development flow for a user smart contract to use the ledger data access API operation is as follows:
On the BaaS platform, obtain the name of the ledger data contract.
Obtain the ledger data access API definition (ChainDataInterface.sol).
In the user contract, import the ledger data access API definition.
The user contract implements a callback interface to asynchronously receive ledger data.
The user contract builds a ledger data access request (ChainDataCmdHelper.sol).
The user contract sends a request to the ledger data contract. For a specific example, see the API usage examples.
The ledger data service returns data in JSON format. For details about the format, see the ledger data structure section.
For more information about contract development, see Developer guide.
Contract message push development flow
The development flow for a user smart contract to use the contract message push service API operation is as follows:
On the BaaS platform, obtain the name of the message contract.
Obtain the contract message push API definition.
In the user contract, import the contract message push API interface.
The user contract implements a message receiving interface to be called by the cross-chain message sending and receiving contract.
The user contract calls the message sending interface of the cross-chain message sending and receiving contract.
For more information about contract development, see Developer guide.
