camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bibr...@apache.org
Subject [camel] branch master updated: CAMEL-12530 Update camel-web3j docs
Date Tue, 05 Jun 2018 14:03:10 GMT
This is an automated email from the ASF dual-hosted git repository.

bibryam pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
     new 84ec7e7  CAMEL-12530 Update camel-web3j docs
84ec7e7 is described below

commit 84ec7e75ae24dd1673ae6c955607819432742bf4
Author: Bilgin Ibryam <bibryam@gmail.com>
AuthorDate: Tue Jun 5 15:02:52 2018 +0100

    CAMEL-12530 Update camel-web3j docs
---
 .../camel-web3j/src/main/docs/web3j-component.adoc | 70 +++++++++++++++++++---
 1 file changed, 63 insertions(+), 7 deletions(-)

diff --git a/components/camel-web3j/src/main/docs/web3j-component.adoc b/components/camel-web3j/src/main/docs/web3j-component.adoc
index 846de62..bb46aa4 100644
--- a/components/camel-web3j/src/main/docs/web3j-component.adoc
+++ b/components/camel-web3j/src/main/docs/web3j-component.adoc
@@ -1,25 +1,36 @@
-[[web3j-component]]
 == Web3j client for Ethereum blockchain Component
 
 *Available as of Camel version 2.22*
+*Available as of Camel version 2.22*
 
 
-The web3j component uses the
+The *Ethereum* blockchain component uses the
 https://github.com/web3j/web3j[web3j] client
-API and allows you to read/write from geth/parity compatible Ethereum nodes.
+API and allows you to interact with Ethereum compatible nodes such as https://github.com/ethereum/go-ethereum/wiki/geth[Geth],
https://github.com/paritytech/parity[Parity], https://github.com/jpmorganchase/quorum/wiki[Quorum],
https://infura.io[Infura], etc.
+
+Maven users will need to add the following dependency to their `pom.xml`
+for this component:
+
+[source,xml]
+------------------------------------------------------------
+<dependency>
+    <groupId>org.apache.camel</groupId>
+    <artifactId>camel-web3j</artifactId>
+    <version>x.x.x</version>
+    <!-- use the same version as your Camel core version -->
+</dependency>
+------------------------------------------------------------
 
 === URI Format
 
 [source,text]
 ----
-web3j://ethereumServerUrl[?options]
+web3j://<local/remote host:port or local IPC path>[?options]
 ----
 
-You can append query options to the URI in the following format,
-?options=value&option2=value&...
-
 === Web3j Options
 
+
 // component options: START
 The Web3j client for Ethereum blockchain component supports 2 options which are listed below.
 
@@ -33,6 +44,7 @@ The Web3j client for Ethereum blockchain component supports 2 options which
are
 |===
 // component options: END
 
+
 // endpoint options: START
 The Web3j client for Ethereum blockchain endpoint is configured using URI syntax:
 
@@ -96,3 +108,47 @@ with the following path and query parameters:
 | *synchronous* (advanced) | Sets whether synchronous processing should be strictly used,
or Camel is allowed to use asynchronous processing (if supported). | false | boolean
 |===
 // endpoint options: END
+
+
+You can append query options to the URI in the following format,
+?options=value&option2=value&...
+
+
+### Message Headers
+
+[width="100%",cols="10%,90%",options="header",]
+|=======================================================================
+|Header |Description
+
+|`All URI options` |All URI options can also be set as exchange headers.
+
+|=======================================================================
+
+
+
+### Samples
+
+Listen for new mined blocks and send the block hash to a jms queue:
+
+[source,java]
+---------------------------------------------------------------------------------------------
+from("web3j://http://127.0.0.1:7545?operation=ETH_BLOCK_HASH_OBSERVABLE")
+    .to("jms:queue:blocks");
+---------------------------------------------------------------------------------------------
+
+Use the block hash code to retrieve the block and full transaction details:
+
+[source,java]
+---------------------------------------------------------
+from("jms:queue:blocks")
+    .setHeader(BLOCK_HASH, body())
+    .to("web3j://http://127.0.0.1:7545?operation=ETH_GET_BLOCK_BY_HASH&fullTransactionObjects=true");
+---------------------------------------------------------
+
+Read the balance of an address at a specific block number:
+
+[source,java]
+--------------------------------------------------------
+from("direct:start")
+    .to("web3j://http://127.0.0.1:7545?operation=ETH_GET_BALANCE&address=0xc8CDceCE5d006dAB638029EBCf6Dd666efF5A952&atBlock=10");
+--------------------------------------------------------

-- 
To stop receiving notification emails like this one, please contact
bibryam@apache.org.

Mime
View raw message