addPeer 메소드는 새 원격 노드(remote node)를 피어 목록에 추가합니다. 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 kni URL.
Return Value
Type
Description
bool
true if the peer was accepted, false otherwise.
Example
Console
HTTP RPC
subbridge_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 kni URL.
Return Value
Type
Description
bool
true if the peer was removed, false otherwise.
Example
Console
HTTP RPC
subbridge_parentOperator
subbridge_parentOperator는 부모 오퍼레이터 계정 주소를 반환합니다.
Parameters
none
Return Value
Type
Description
Account
부모 체인 오퍼레이터 계정의 주소입니다.
Example
subbridge_childOperator
subbridge_childOperator는 자식 오퍼레이터 계정 주소를 반환합니다.
Parameters
none
Return Value
Type
Description
Account
자식 체인 오퍼레이터 계정의 주소입니다.
Example
subbridge_parentOperatorNonce
subbridge_parentOperatorNonce는 부모 오퍼레이터 계정 주소의 논스를 반환합니다.
Parameters
none
Return Value
Type
Description
QUANTITY
부모 오퍼레이터 계정에서 보낸 트랜잭션의 개수를 정수 형태로 반환합니다.
Example
subbridge_childOperatorNonce
The subbridge_childOperator returns the child operator account address.
Parameters
none
Return Value
Type
Description
QUANTITY
자식 오퍼레이터 계정에서 보낸 트랜잭션의 개수를 정수 형태로 반환합니다.
Example
subbridge_parentOperatorBalance
subbridge_parentOperatorBalance는 부모 오퍼레이터 계정의 잔액을 반환합니다.
subbridge_deregisterBridge는 부모/자식 체인에 있는 등록된 브리지 컨트랙트를 등록 해지합니다.
Parameters
Name
Type
Description
account
20-byte DATA
Address of bridge contract on child chain.
account
20-byte DATA
Address of bridge contract on parent chain.
Return Value
Name
Type
Description
error
Error
등록 해지에 성공하면 null, 그렇지 않으면 Error 객체.
Example
subbridge_subscribeBridge
subbridge_subscribeBridge는 부모/자식 체인에 등록된 브리지 컨트랙트를 구독합니다. 서브 브리지 노드가 브리지 컨트랙트 쌍을 구독하면, 서브 브리지는 체인 간 밸류 트랜스퍼 요청을 자동으로 처리합니다.
Parameters
Name
Type
Description
account
20-byte DATA
Address of bridge contract on child chain.
account
20-byte DATA
Address of bridge contract on parent chain.
Return Value
Name
Type
Description
error
Error
구독에 성공하면 null, 그렇지 않으면 Error 객체.
Example
subbridge_unsubscribeBridge
subbridge_unsubscribeBridge는 부모/자식 체인의 브리지 컨트랙트 구독을 해지합니다. 서브 브리지가 브리지 컨트랙트 쌍의 구독을 해지하면, 서브 브리지는 체인 간 밸류 트랜스퍼 요청을 더 이상 처리하지 못합니다.
Parameters
Name
Type
Description
account
20-byte DATA
Address of bridge contract on child chain.
account
20-byte DATA
Address of bridge contract on parent chain.
Return Value
Name
Type
Description
error
Error
구독 해지에 성공하면 null, 그렇지 않으면 Error 객체.
Example
subbridge_registerToken
subbridge_registerToken은 한 쌍의 ERC-20 또는 721 토큰을 브리지 컨트랙트에 등록합니다.
Parameters
Name
Type
Description
account
20-byte DATA
Address of bridge contract on child chain.
account
20-byte DATA
Address of bridge contract on parent chain.
account
20-byte DATA
자식 체인에 있는 토큰 컨트랙트의 주소.
account
20-byte DATA
부모 체인에 있는 토큰 컨트랙트의 주소.
Return Value
Name
Type
Description
error
Error
null if the registration succeeds, Error object otherwise.
Example
subbridge_deregisterToken
subbridge_deregisterBridge는 브리지 컨트랙트에 등록된 한 쌍의 토큰 컨트랙트를 등록 취소합니다.
Parameters
Name
Type
Description
account
20-byte DATA
Address of bridge contract on child chain.
account
20-byte DATA
Address of bridge contract on parent chain.
account
20-byte DATA
Address of token contract on child chain.
account
20-byte DATA
Address of token contract on parent chain.
Return Value
Name
Type
Description
error
Error
null if the deregistration succeeds, Error object otherwise.
Example
subbridge_convertRequestTxHashToHandleTxHash
subbridge_convertRequestTxHashToHandleTxHash는 주어진 "request value transfer transaction" 해시에 상응하는 반대편 체인에 있는 "handle value transfer transaction" 해시를 리턴합니다. "Request value transfer transaction"은 사용자가 체인 간 밸류 트랜스퍼를 요청하기 위해 생성한 트랜잭션입니다. "Handle value transfer transaction"은 서브 브리지가 사용자의 밸류 트랜스퍼 요청을 처리하기 위해 생성한 트랜잭션입니다.
Parameters
Name
Type
Description
Hash
32-byte DATA
"request value transfer" 트랜잭션의 해시.
Return Value
Name
Type
Description
Hash
32-byte DATA
"handle value transfer" 트랜잭션의 해시. 0 해시는 대응하는 "handle value transfer" 트랜잭션이 없음을 의미합니다.
Example
subbridge_listBridge
subbridge_listBridge는 서브 브리지에 등록(저장)되어 있는 모든 브리지 컨트랙트 쌍의 리스트를 반환합니다.
Parameters
nonce
Return Value
Name
Type
Description
localAddress
account
20-byte DATA
localAddress
account
20-byte DATA
subscribed
bool
브리지 컨트랙트 쌍이 구독 중이면 true, 아니면 false.
Example
subbridge_getBridgeInformation
subbridge_getBridgeInformation은 주어진 브리지 컨트랙트의 정보를 반환합니다.
Parameters
Name
Type
Description
account
20-byte DATA
브리지 컨트랙트의 주소
Return Value
Name
Type
Description
counterPart
20-byte DATA
상대방 브리지 컨트랙트의 주소. (아직 지원하지 않음)
isRunning
bool
브리지 컨트랙트가 실행 중이면 true, 아니면 false.
isSubscribed
bool
브리지 컨트랙트가 구독 중이면 true, 아니면 false.
onServiceChain
bool
브리지 컨트랙트가 자식 체인에 있으면 true, 아니면 false.
pendingEventSize
QUANTITY
브리지 컨트랙트가 생성한 "request value transfer" 이벤트 중 서브 브리지가 아직 처리하지 않아 pending 상태에 있는 것의 개수.
requestNonce
QUANTITY
브리지 컨트랙트의 request 논스.
handleNonce
QUANTITY
브리지 컨트랙트의 upper handle 논스.
lowerHandleNonce
QUANTITY
브리지 컨트랙트의 lower handle 논스.
Example
subbridge_txPendingCount
subbridge_txPendingCount는 브리지 트랜잭션 풀에 있는 pending 트랜잭션 개수를 반환합니다.
Parameters
None
Return Value
Type
Description
Uint64
브리지 트랜잭션 풀에 있는 pending 트랜잭션의 수.
Example
subbridge_txPending
subbridge_txPending은 브리지 트랜잭션 풀에 있는 pending 트랜잭션 목록을 반환합니다.