DecentralChain (DCC) icon

DecentralChain (DCC)

Create, sign and broadcast DecentralChain transactions, plus query blockchain data

Overview

This node enables users to create, sign, and optionally broadcast transactions on the DecentralChain (DCC) blockchain network. Specifically for the Transaction resource with the Invoke Smart Contract operation, it allows calling a smart contract function by constructing the appropriate transaction.

Common scenarios where this node is beneficial include:

  • Automating interactions with decentralized applications (dApps) running on the DCC blockchain.
  • Triggering smart contract functions as part of larger workflows, such as token transfers, voting, or executing business logic encoded in contracts.
  • Integrating blockchain-based logic into existing systems without manual intervention.

Practical example:

  • A user wants to invoke a function on a deployed smart contract that registers a new asset or updates a record on-chain. This node can prepare the transaction, sign it securely using a seed phrase or private key, and broadcast it to the network automatically.

Properties

Name Meaning
Base URL The base URL of the DCC node API to use if no credential is supplied.
Authentication Method How to sign the transaction: Seed Phrase, Private Key, or Create Unsigned Transaction.
Seed Phrase Secret seed phrase used to sign the transaction (required if "Seed Phrase" auth method selected).
Private Key Private key used to sign the transaction (required if "Private Key" auth method selected).
Sender Public Key Public key of the sender; required when creating an unsigned transaction.
Chain ID Network identifier to create the transaction for: Mainnet (?) or Testnet (!).
Auto Broadcast Whether to automatically broadcast the signed transaction after creation (only for signed txns).

Output

The node outputs JSON objects containing details about the created transaction and optionally the broadcast result:

  • transaction: The constructed transaction object including its type, version, ID, and proofs/signature if signed.
  • broadcastResult: The response from the blockchain node after broadcasting the transaction (if auto broadcast is enabled).
  • status: Indicates whether the transaction was just created (created), successfully broadcast (broadcasted), or if broadcasting failed (broadcast_failed).
  • debug: Contains metadata useful for troubleshooting, such as operation name, chain ID, authentication method, base URL, transaction ID, timestamps, and signature/proofs info.
  • error: If any error occurs during transaction creation or broadcasting, an error message is included here.

If the transaction is unsigned, the output contains the unsigned transaction data ready for external signing or further processing.

No binary data output is produced by this operation.

Dependencies

  • Requires access to a DecentralChain node API endpoint (specified by Base URL or credentials).
  • Uses an external library for transaction construction and signing (@decentralchain/waves-transactions or compatible).
  • Requires either a seed phrase or private key credential for signing transactions unless creating unsigned transactions.
  • Optional automatic broadcasting requires network connectivity to the specified node API.

Troubleshooting

  • Library Loading Failure: If the transaction library fails to load at runtime, the node falls back to mock functions which do not perform real blockchain operations. Ensure the environment has the required dependencies installed.
  • Invalid Attachment: Attachments must be valid base58 strings or UTF-8 text under 140 bytes. Errors will indicate invalid encoding or size issues.
  • Missing Credentials: Signing requires either a seed phrase or private key depending on the chosen authentication method. Missing these will cause errors.
  • Broadcast Failures: Network issues or node API errors during broadcasting will be reported with error messages. Check node URL, network connectivity, and API permissions.
  • JSON Parsing Errors: When providing raw JSON inputs (not typical for this operation), invalid JSON will cause errors.
  • Unsigned Transactions: When creating unsigned transactions, the sender public key must be provided explicitly.

To resolve common errors:

  • Verify all required input parameters are correctly set.
  • Confirm the Base URL points to a valid and accessible DCC node.
  • Use correct authentication method and provide necessary keys.
  • Validate attachment formats and sizes.
  • Enable detailed debug logging to inspect request and response data.

Links and References

Discussion