This CorDapp provides a simple example of how to send a transaction to Ethereum from Corda Flow. In this case, the flow sends a transaction that transfers 1 ether from an account to the other account.
Be aware that support of HTTP requests in flows is currently limited:
- The request must be executed in a BLOCKING way. Flows don't currently support suspending to await an HTTP call's response
- The request must be idempotent. If the flow fails and has to restart from a checkpoint, the request will also be replayed
Also, be aware that there is okhttp's dependency conflict between Corda Node v4 and web3j (later than 4.5.12).
See https://docs.corda.net/getting-set-up.html.
ganache-cli is a fast Ethereum RPC client for testing and development.
You can run ganache-cli by following Minimal Ethereum Environment.
See https://docs.corda.net/tutorial-cordapp.html#running-the-example-cordapp.
Use the deployNodes
task and ./build/nodes/runnodes
script.
You'll be interacting with the node via its interactive shell.
To have the node use a flow to send a transaction to ethereum, run the following command in the node's shell:
flow start jp.co.layerx.cordage.flowethereumtx.Flow
You can check the ether decrease/increase by looking at the ethereum wallet.