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.git
The following commit(s) were added to refs/heads/main by this push:
new 247cc1d36 add example for mainnet
new fd6954a27 Merge pull request #515 from atoulme/mainnet_example
247cc1d36 is described below
commit 247cc1d36646515f8a858f8002dd1689b440939a
Author: Antoine Toulme <[email protected]>
AuthorDate: Sat Feb 4 15:08:55 2023 -0800
add example for mainnet
---
examples/mainnet/.gitignore | 11 +++++++++++
examples/mainnet/README.md | 37 +++++++++++++++++++++++++++++++++++++
examples/mainnet/config.toml | 31 +++++++++++++++++++++++++++++++
examples/mainnet/run.sh | 14 ++++++++++++++
4 files changed, 93 insertions(+)
diff --git a/examples/mainnet/.gitignore b/examples/mainnet/.gitignore
new file mode 100644
index 000000000..e4db3d095
--- /dev/null
+++ b/examples/mainnet/.gitignore
@@ -0,0 +1,11 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE
+# file distributed with this work for additional information regarding
copyright ownership. The ASF licenses this file
+# to You under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance with the
+# License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on
+# an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
express or implied. See the License for the
+# specific language governing permissions and limitations under the License.
+save_pid.txt
\ No newline at end of file
diff --git a/examples/mainnet/README.md b/examples/mainnet/README.md
new file mode 100644
index 000000000..17d3b4bf6
--- /dev/null
+++ b/examples/mainnet/README.md
@@ -0,0 +1,37 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+# Mainnet client
+
+This example shows how to run Tuweni to connect to Ethereum mainnet.
+
+It uses DNS discovery to discover other clients:
+```toml
+[dns.default]
+enrLink="enrtree://aka3am6lpbyeudmvnu3bsvqj5ad45y7ypohjlef6w26qoe4vtu...@all.mainnet.ethdisco.net"
+dnsServer="8.8.8.8"
+repository="default"
+```
+
+It uses a simple synchronizer to connect and sync the first 100 blocks:
+
+```toml
+[synchronizer.default]
+type="status"
+from=0
+to=100
+fromRepository="default"
+```
\ No newline at end of file
diff --git a/examples/mainnet/config.toml b/examples/mainnet/config.toml
new file mode 100644
index 000000000..a3952f6c4
--- /dev/null
+++ b/examples/mainnet/config.toml
@@ -0,0 +1,31 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE
+# file distributed with this work for additional information regarding
copyright ownership. The ASF licenses this file
+# to You under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance with the
+# License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on
+# an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
express or implied. See the License for the
+# specific language governing permissions and limitations under the License.
+[storage.default]
+path="data"
+genesis="default"
+[genesis.default]
+path="classpath:/genesis/mainnet.json"
+[peerRepository.default]
+type="memory"
+[dns.default]
+enrLink="enrtree://aka3am6lpbyeudmvnu3bsvqj5ad45y7ypohjlef6w26qoe4vtu...@all.mainnet.ethdisco.net"
+dnsServer="8.8.8.8"
+repository="default"
+[rlpx.default]
+networkInterface="127.0.0.1"
+port=30303
+# Replace this with your own private key.
+key="0x914a84b10e91656ee45022af8358cb7609c8215f38cfd344d171e0d8446f6cad"
+[synchronizer.default]
+type="status"
+from=0
+to=100
+fromRepository="default"
\ No newline at end of file
diff --git a/examples/mainnet/run.sh b/examples/mainnet/run.sh
new file mode 100644
index 000000000..8c4a8a7b2
--- /dev/null
+++ b/examples/mainnet/run.sh
@@ -0,0 +1,14 @@
+#!/usr/bin/env bash
+# Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE
+# file distributed with this work for additional information regarding
copyright ownership. The ASF licenses this file
+# to You under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance with the
+# License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on
+# an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
express or implied. See the License for the
+# specific language governing permissions and limitations under the License.
+
+nohup tuweni -c config.toml -w localhost:8080 &
+echo $! > save_pid.txt
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]