All Products
Search
Document Center

Blockchain as a Service:Data Written Compliance

Last Updated:Mar 31, 2026

When you upload data to a blockchain through a REST API, non-compliant or illegal content can be written on-chain before you have a chance to review it. Integrating Alibaba Cloud Blockchain as a Service (BaaS) with the Content Moderation service intercepts each transaction before it is committed, blocking flagged data automatically.

This topic uses Node.js as an example.

Prerequisites

Before you begin, ensure that you have:

  • The cloud service integration module installed in your BaaS instance, with Content Moderation integration enabled. This module intercepts chaincode invocations and calls the Content Moderation API before a transaction is committed.

  • The cloud service integration sample code downloaded to your local environment.

  • Node.js v8.17.0 or later installed.

Run the content compliance check

  1. Deploy the sample notary chaincode to your channel. See Chaincode deployment for instructions.

  2. Open invoke-with-content-check/main.js and update the required parameters. See Use REST APIs for the required fields.

  3. Go to the invoke-with-content-check directory and install the dependencies:

    npm install

    When the installation succeeds, npm prints a summary similar to added N packages in Xs.

  4. Start the demo:

    node main.js

Sample output

Data 1581905807512 pushed to blockchain with transaction 284d0b2b89db5bc5489127de863d0bb9b9d0a5f05bae67762567a3aff113822a
Content Moderation check failed: Send transaction failed: CONTENT_CHECK returned error VERIFY_FAILED: Content Moderation Check failed, suggestion block. key: 1581905807512, value: <Sensitive data for the test is omitted.>
Content Moderation check failed: Send transaction failed: CONTENT_CHECK returned error VERIFY_FAILED: Content Moderation Check failed, suggestion block. Key: 1581905807512, value: <Sensitive data for the test is omitted.>

The first line confirms a compliant entry was written to the blockchain. The subsequent lines show the content check blocking a transaction. Key fields in the error message:

FieldMeaning
CONTENT_CHECKError source — the cloud service integration module intercepted the transaction for content screening
VERIFY_FAILEDThe content check did not pass
suggestion blockThe Content Moderation service returned a block recommendation, meaning the data was flagged as non-compliant
keyThe data key that was submitted
valueThe data value that was flagged (omitted in this example to avoid reproducing sensitive test content)

If you see suggestion block in the error, the data was correctly intercepted by the content check policy — this is expected behavior, not a configuration error. If the error does not contain CONTENT_CHECK, check your network connectivity and verify that the cloud service integration module is properly installed.

Customize content check policies

If the default content check policies do not meet your needs, log in to the Content Moderation console and add check rules or adjust check behavior. See Custom text library for instructions.