Saves string data protected by access control.

Internally calls http POST /data on the AltExecCnsAPI.

The difference from updateData is that an error is returned if data with the specified objectId already exists.

Please refer to the following page for detailed information.



Name Type Description
password string Account password
contractName string Target contract name
functionName string Target function name
objectId string DataObject ID
data string String to be saved in the data store
params array Parameters to pass to Contract function
abi JSONObject ABI of the contract to call
callback function callback


Name Type Description
err error Error
txHash string Transaction hash of executed transaction


contract.sendData('__PASSWORD__', 'Building', 'create', 'building-object1', 'building data', ['building1'], abi, function(err, txHash) {
  if (err) console.error(err);
  else console.log(txHash);

results matching ""

    No results matching ""