The Ether Transfer connector is currently only available for the Rinkeby TestNet. Transactions with the Ethereum MainNet are not yet supported.

See the reference documentation for Custom Actions for guidance on how to use this configuration definition.

This sample connects a response from the Fragile Goods clause to the Clause Ether Transfer connector.

{
  "$class": "io.clause.outbound.physical.payments.crypto.ethereum.EthereumTransfer",
  "fromAccount": "0xd6a33a691c19169a9e8121d12cfc602fa29f3663",
  "toAccount": "0xf8ebf925868f897c1afc1d2ae5444f3e74677a05",
  "weiValue": response.amount.doubleValue * 2.5e2,
  "privateKey": "0x6afe5c024ae7c41983edc026f2122e0b24d934b1982b9d9d552fbb224286bfdc"
}

You are responsible for performing currency conversions. Currently, this requires the use of a static exchange rate.

Creating an Account and Getting the Private Key

To use this template you need an Ethereum account on the Rinky Test Net, the private key for the account, have some Ether in the source account, and have the address of a destination account.

Create Account

Install a local geth node. E.g. by following: https://github.com/ethereum/go-ethereum/wiki/Installation-Instructions-for-Mac

Launch the local geth node (connecting to the Rinkeby test network) in a terminal using:

geth --rinkeby --rpc --verbosity 2 console

You may need to wait for the node to synchronize with the network.

Then create your test account by using the geth REPL:

personal.newAccount()
eth.coinbase

Transfer Ether into Account

You will then have to request some Ether for your account using the faucet service at https://faucet.rinkeby.io by passing a URL to a Tweet containing the Ethereum address you created above.

You will also need to grab a random destination Ethereum account. You can use https://rinkeby.etherscan.io to check the status of your account or to find the address of a random destination Ethereum account you can use for testing.

Getting your Private Key

Your private key is stored (encrypted using the passphrase you used when you created your account) on local disk in a JSON keystore (wallet) file. The easiest way to extract the plain text private key is to use the MyEtherWallet service which allows you to upload the JSON file, unlock it using your passphrase and then displays the plain text private key.

On Mac OS X the JSON keystore files for your accounts are stored under ~/Library/Ethereum/rinkeby/keystore/ using a generated file name.

  1. Visit https://www.myetherwallet.com
  2. Press the "View Wallet Info" menu option
  3. Press the Keystore / JSON File radio button
  4. Press the "Select Wallet File" and browse to your JSON keystore file
  5. Enter your account passphrase to unlock your wallet
  6. Press the eye icon next to the "Private Key (unencrypted)" field
  7. Copy the plain text private key
  8. Use your source account address and your private key in your Smart Clause®.