Skip to content

@gala-chain/chaincodeAPI


API > putChainObject

Function: putChainObject()

putChainObject(ctx, data): Promise\<void>

Parameters

ctx: GalaChainContext

data: ChainObject

Returns

Description

Validate the provided ChainObject, serialize it into an appropriate format for on-chain storage, and queue a putState call in the GalaChainStub. Will write the data to World State indexed by its composite key upon successful transaction completeion.

Throws ObjectValidationFailedError on validation failure.

Remarks

See also GalaChainStub for details on caching and transactional writes supported by this method.

Source

chaincode/src/utils/state.ts:69