Actions25
- Account Actions
- Token/Asset Actions
- Transaction Actions
- Utility Actions
Overview
The node enables creating, signing, and optionally broadcasting DecentralChain blockchain transactions, specifically supporting the "Invoke Smart Contract" operation under the "Transaction" resource. It allows users to call smart contract functions on the DecentralChain network by constructing the appropriate transaction, signing it with a seed phrase or private key (or creating an unsigned transaction), and optionally broadcasting it to the blockchain.
This node is beneficial in scenarios where automation of blockchain interactions is needed, such as:
- Triggering smart contract functions as part of a workflow.
- Integrating decentralized application logic into business processes.
- Testing or preparing transactions without immediately broadcasting them.
For example, a user can invoke a smart contract function to update a record on-chain whenever a new entry is added to a database, or automate token transfers triggered by external events.
Properties
| Name | Meaning |
|---|---|
| Base URL | The base URL of the DecentralChain node API to use if no credential base URL is provided. |
| Authentication Method | How to sign the transaction: Seed Phrase, Private Key, or Create Unsigned Transaction. |
| Seed Phrase | Secret seed phrase used for signing transactions (required if using Seed Phrase authentication). |
| Private Key | Private key used for signing transactions (required if using Private Key authentication). |
| Sender Public Key | Public key of the sender, required when creating unsigned transactions. |
| Chain ID | Network identifier to create the transaction for: Mainnet (?) or Testnet (!). |
| Auto Broadcast | Whether to automatically broadcast the transaction after signing (only applicable for signed tx). |
Note: For the "Invoke Smart Contract" operation specifically, the node expects parameters relevant to invoking a script, but these are not explicitly detailed in the provided properties snippet. The general transaction signing and broadcasting options apply.
Output
The node outputs a JSON object containing:
transaction: The created transaction object including its details such as type, version, proofs, signature presence, and transaction ID.broadcastResult(if auto-broadcast is enabled and successful): The response from the blockchain node after broadcasting the transaction.status: Indicates whether the transaction was just created (created) or successfully broadcasted (broadcasted).debug: Contains metadata about the operation, chain ID, authentication method, base URL, transaction ID, timestamp, and transaction details useful for troubleshooting.- In case of errors during creation or broadcasting, an
errorfield with message and debug info is included.
The node does not output binary data.
Dependencies
- Requires the
@decentralchain/waves-transactionslibrary (or compatible) for transaction creation and signing. - Needs access to a DecentralChain node API endpoint (configurable via Base URL or credentials).
- Requires either a seed phrase or private key for signing transactions unless creating unsigned transactions.
- Optional: Internet connectivity to broadcast transactions to the blockchain network.
Troubleshooting
- Library Loading Failure: If the underlying transaction library fails to load, the node falls back to mock functions and logs errors. This will prevent actual transaction creation and broadcasting. Ensure the library is installed correctly in the n8n environment.
- Missing Credentials: Errors occur if required signing credentials (seed phrase or private key) are missing when needed.
- Broadcast Failures: Network issues or invalid transactions may cause broadcasting to fail. The node captures and returns error messages with stack traces truncated for clarity.
- Unsigned Transactions: When creating unsigned transactions, the sender public key must be provided; otherwise, transaction creation will fail.
- Invalid Parameters: Providing incorrect or incomplete parameters for the transaction (e.g., wrong chain ID, missing recipient) will result in errors.
- To resolve errors, verify all required inputs, ensure correct authentication method usage, and confirm network connectivity to the specified Base URL.
Links and References
- DecentralChain Documentation (general blockchain and API reference)
- Waves Transactions Library (similar library used for transaction creation and signing)
- n8n Documentation on Creating Custom Nodes