You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuweni.apache.org by to...@apache.org on 2021/08/02 21:45:10 UTC

[incubator-tuweni-website] branch main updated: Add tutorial for jsonrpc proxy app

This is an automated email from the ASF dual-hosted git repository.

toulmean pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-tuweni-website.git


The following commit(s) were added to refs/heads/main by this push:
     new dbc0d16  Add tutorial for jsonrpc proxy app
dbc0d16 is described below

commit dbc0d16e5e794ceaca4726a01051e1517d6e3868
Author: Antoine Toulme <an...@lunar-ocean.com>
AuthorDate: Mon Aug 2 14:44:59 2021 -0700

    Add tutorial for jsonrpc proxy app
---
 tutorials/apps/index.md   |  9 ++++++++-
 tutorials/apps/jsonrpc.md | 39 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 47 insertions(+), 1 deletion(-)

diff --git a/tutorials/apps/index.md b/tutorials/apps/index.md
index 42b210f..0e737bf 100644
--- a/tutorials/apps/index.md
+++ b/tutorials/apps/index.md
@@ -37,4 +37,11 @@ TODO
 
 The `eth-faucet` application is an Ethereum faucet that runs alongside an Ethereum client. The faucet allows to distribute funds.
 
-[More](/tutorials/apps/eth-faucet)
\ No newline at end of file
+[More](/tutorials/apps/eth-faucet)
+
+# jsonrpc
+
+The `jsonrpc` application is a JSON-RPC proxy that can cache, filter, throttle, meter and authenticate requests to a JSON-RPC endpoint.
+
+[More](/tutorials/apps/jsonrpc)
+
diff --git a/tutorials/apps/jsonrpc.md b/tutorials/apps/jsonrpc.md
new file mode 100644
index 0000000..7a71cb7
--- /dev/null
+++ b/tutorials/apps/jsonrpc.md
@@ -0,0 +1,39 @@
+---
+layout: tutorial
+title: JSON-RPC proxy
+description: JSON-RPC proxy
+group: nav-right
+previous: index.md
+categories: [applications]
+---
+
+The `jsonrpc` application is a JSON-RPC proxy that can cache, filter, throttle, meter and authenticate requests to a JSON-RPC endpoint.
+
+The application is configured via a toml file, described below:
+
+## Examples
+
+### Proxy a JSON-RPC endpoint publicly
+
+You set up a node and want to proxy. You expose all JSON-RPC methods on your node but only want to expose the `eth_` namespace publicly, with HTTP Basic authentication:
+
+```toml
+endpointUrl="http://192.168.1.2:8545" # IP of your node
+allowedMethods=["eth_"]
+cacheEnabled=true
+cachedMethods=["eth_"]
+cacheStoragePath="/var/jsonrpccache" # Cache location
+```
+
+### Local development
+
+You have a local development and you're using a service such as Infura or Alchemy, but you want to work without calling the service constantly.
+
+```toml
+endpointUrl="https://example.com:8545/?token=mytoken" # service URL
+cacheEnabled=true
+cachedMethods=[""] # All methods are cached
+cacheStoragePath="/var/jsonrpccache" # Cache location
+allowedMethods=[""] # All methods are enabled
+```
+

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@tuweni.apache.org
For additional commands, e-mail: commits-help@tuweni.apache.org