CreateWitness

POST: http://172.104.51.182:16667/wallet/createwitness

Apply to become a witness. BODY PARAMS {

owner_address string

url string

permission_id int32 (Optional)

visible boolean (Optional)

}

Note:

  • owner address is transaction creator address, in hex string format.

  • contract address is the address of the contract to be modified, in hex string format.

  • visible: whether the address is in base58check format.

  • permission_id, whether the address is in base58 format.

Example:

curl --request POST --url http://172.104.51.182:16667/wallet/createwitness --header 'Accept: application/json' --header 'Content-Type: application/json' --data ' { "owner_address":"WFzFXoQCgUeoApjejKM9B46NgFGHXvUyKz", "url":"http://test_create_witness", "visible": true }

Input:

{

"owner_address":"WFzFXoQCgUeoApjejKM9B46NgFGHXvUyKz",

"url":"http://test_create_witness",

"visible": true

}

Response:

{

"visible": true, "txID": "0206159482aaf083aaa18cf4e5016f604a0bf906fca7dfa99a79960858f4cec1", "raw_data": { "contract": [ { "parameter": { "value": { "owner_address": "WFzFXoQCgUeoApjejKM9B46NgFGHXvUyKz", "url": "http://test_create_witness" }, "type_url": "type.googleapis.com/protocol.WitnessCreateContract" }, "type": "WitnessCreateContract" } ], "ref_block_bytes": "d86c", "ref_block_hash": "e12a4c5acd1f6d9e", "expiration": 1640060721000, "timestamp": 1640060663276 }, "raw_data_hex": "0a02d86c2208e12a4c5acd1f6d9e40e8aef2d9dd2f5a6d080512690a32747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5769746e657373437265617465436f6e747261637412330a15414203485a535a4072c9fbfaaddfe2a010ad0bcdb0121a687474703a2f2f746573745f6372656174655f7769746e65737370ecebeed9dd2f"

}

==> Continue you call gettransactionsign API then call broadcasttransaction API

We will the final result: The transaction created success on WEL network.

{

"result": true, "txid": "0206159482aaf083aaa18cf4e5016f604a0bf906fca7dfa99a79960858f4cec1"

}

Last updated