5.4.4.6 Invoke Smart Contract API Public Key Upload Mode

When the off-BSN system invokes the node gateway, it should follow the API descriptions to add the corresponding parameters. After invoking the node gateway, the node gateway returns the execution result of the smart contract. In the transaction of Public Key Upload mode, the private key of the transaction on the chain is generated and saved by the user. Then the client performs the assembly and signature of the data locally. The signed data is uploaded to the node gateway, which forwards the data to the corresponding blockchain node to initiate the transaction request. Data assembly in this pattern requires information such as the contract ABI, which is compiled when developing the contract, and the contract address, which is available on the application details page. In the SDK of the gateway, the assembly method of the data on the link has been implemented, which can be directly called.

1. Interface address:

https://PCNGatewayAddress/api/fiscobcos/v1/node/trans

Note: After a participant has successfully joined in a FISCO DApp service, the participant can view and download the DApp’s configuration parameters which are used for off-BSN systems to connect to this DApp’s smart contracts, including the PCN gateway address and Dapp access keys, as shown below:

5.4.4.6

2. Call Method: POST

3. Signature algorithm: required and refer to Section 5.4.4.1

4. Call parameters

No. Field name Field Type Required Remarks
1 Header header Map Y
2 Body body Map Y
3 Signature Value mac String Y
header
1 user unique ID userCode String Y
2 DApp unique ID appCode String Y
Body
1 Smart Contract Name contractName String Y
2 Transaction Data transData String Y
3 Contract address contractAddress String N
4 Contract ABI contractAbi String N

Example:

{"header":{"userCode":"USER0001202006042321579692440","appCode":"app0001202006042323057101002","tId":""},"mac":"MEUCIQCrjIeRVSt1uwFFGkr37bVM8pF0JgAWb40mKEBc5HbpjgIgEzXRIgG+Q7obwuD2MY4EHo9sIsI1W71M+aQKOfAN3wU=","body":{"contractName":"BsnBaseContractk1","transData":"0xf9016fa008d8ebcb4b1f8205fd7883aa3ce9b9c844424070e55a3af6a5da5d7ee97d287385051f4d5c0083419ce07794866aefc204b8f8fdc3e45b908fd43d76667d7f7680b8e4ebf3b24f0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000005733036303400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000026161000000000000000000000000000000000000000000000000000000000000018187801ba0324efc9e17f1d31d95535c5103083560560f836931945d03fb69acb6fd2046b5a05fa6f574f83b3b753c9fe40649a08c2a497af1cd804e08fed2b153af20267f23", "contractAddress":"0xe2d0d414d436d8be9d52e2f40e6dd24a63faa638","contractAbi":"Contract ABI"}}

5. Response parameters

No. Field name Field Type Required Remarks
1 Header header Map Y
2 Body body Map Y
3 Signature Value mac String Y
header
1 Response ID code int Y 0: authentication successful -1: authentication failed
2 Response Message msg String N if code=0 then can be null
Body
1 Invoke Type constant Bool N
2 Query information queryInfo String N If Constant is true, this field has value.
3 Transaction hash txId string N If Constant is false, this field has value and is valid.
4 Block HASH blockHash String N If Constant is false, this field has value and is valid.
5 Block Number blockNumber Int N If Constant is false, this field has value and is valid.
6 Gas Used gasUsed Int N If Constant is false, this field has value and is valid.
7 Transaction Status status String N If Constant is false, this field has value and is valid. 0x0 means transaction successful, status value refer to transaction receipt status in 7.3.9
8 From account from String N If Constant is false, this field has value and is valid.
9 To account To String N If Constant is false, this field has value and is valid.
10 Input input String N If Constant is false, this field has value and is valid.
11 Ouput output String N If Constant is false, this field has value and is valid.
© 2019-2024 Red Date (Hong Kong) Technology Limited. all right reserved,powered by GitbookFile Modify: 2023-02-16 12:22:02

results matching ""

    No results matching ""

    results matching ""

      No results matching ""