mainbridge
APIs related to main chain ENs connected with a service chain.
The namespace mainbridge
provides functions related to Service Chain. To use functions in this namespace, the option mainbridge
should be enabled in the EN connected to the main chain (Mainnet or Baobab testnet).
mainbridge_nodeInfo
Returns bridge node information including the KNI (Klaytn Network Identifier) of the node. A mainbridge node can connect to a subbrige node via the KNI.
Parameters
None
Return Value
Type | Description |
---|---|
JSON string | the bridge node information. |
Example
mainbridge_addPeer
Returns true
if adding a subbridge peer is done successfully.
It Adds a new remote node to the peer list. The node will try to maintain connectivity to these nodes at all times, reconnecting every once in a while if the remote connection goes down. The method accepts a single argument, the kni
URL of the remote peer to start tracking and returns a BOOL
indicating whether the peer was accepted for tracking or some error occurred.
Parameters
Name | Type | Description |
---|---|---|
url | string | Peer's |
Return Value
Type | Description |
---|---|
bool |
|
Example
Console
HTTP RPC
mainbridge_removePeer
Returns true
if removing the peer is done successfully.
The removePeer
method disconnects and removes the remote node in the list of tracked static nodes. The method accepts a single argument, the kni
URL of the remote peer to start tracking and returns a BOOL
indicating whether the peer was accepted for tracking or some error occurred.
Parameters
Name | Type | Description |
---|---|---|
url | string | Peer's |
Return Value
Type | Description |
---|---|
bool |
|
Example
Console
HTTP RPC
mainbridge_getChildChainIndexingEnabled
mainbridge_getChildChainIndexingEnabled
returns if indexing anchoring transaction is enabled or not.
Parameters
none
Return Value
Type | Description |
---|---|
bool |
|
Example
mainbridge_convertChildChainBlockHashToParentChainTxHash
Returns the anchoring transaction hash of the given child chain block hash.
Parameters
Type | Description |
---|---|
32-byte DATA | The child chain block hash. |
Return Value
Type | Description |
---|---|
32-byte DATA | The anchoring transaction hash that includes the child chain block information. |
Example
Console
HTTP RPC
Last updated