{"id":18607743,"url":"https://github.com/julius278/eth-web3j-java","last_synced_at":"2026-05-06T17:34:43.186Z","repository":{"id":221171478,"uuid":"753212747","full_name":"Julius278/eth-web3j-java","owner":"Julius278","description":"spring boot application, which uses the web3j library to communicate with the ethereum (testnet) blockchain. The README also includes some challenges, where you can play around with web3j. Feel free to fork or clone the code.","archived":false,"fork":false,"pushed_at":"2025-02-26T12:23:15.000Z","size":208,"stargazers_count":0,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-21T12:52:30.202Z","etag":null,"topics":["ethereum","java","smartcontracts","spring-boot","web3j"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Julius278.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-02-05T17:26:44.000Z","updated_at":"2025-02-26T12:23:18.000Z","dependencies_parsed_at":"2024-03-29T00:21:09.242Z","dependency_job_id":"42c8d547-ce15-4d17-9a1f-304f1557227c","html_url":"https://github.com/Julius278/eth-web3j-java","commit_stats":null,"previous_names":["julius278/eth-web3j","julius278/eth-web3j-java"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Julius278/eth-web3j-java","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Julius278%2Feth-web3j-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Julius278%2Feth-web3j-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Julius278%2Feth-web3j-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Julius278%2Feth-web3j-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Julius278","download_url":"https://codeload.github.com/Julius278/eth-web3j-java/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Julius278%2Feth-web3j-java/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32704555,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-06T08:33:17.875Z","status":"ssl_error","status_checked_at":"2026-05-06T08:33:17.221Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ethereum","java","smartcontracts","spring-boot","web3j"],"created_at":"2024-11-07T02:31:06.698Z","updated_at":"2026-05-06T17:34:43.168Z","avatar_url":"https://github.com/Julius278.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"On the [bottom of the README](#web3j-challenges) there are some challenges to get into the topic. Have fun!\n\n# General Web3J information\nThe application takes advantage of the [Web3J library](https://github.com/web3j/web3j) to communicate with the ethereum blockchain.\nTo be correct, you connect to an ethereum (main or test net) node via [JSON-RPC](https://www.jsonrpc.org/) connection and retrieve the information this specific node/chain provides.\n``` XML\n    \u003cdependency\u003e\n\t\u003cgroupId\u003eorg.web3j\u003c/groupId\u003e\n\t\u003cartifactId\u003ecore\u003c/artifactId\u003e\n\t\u003cversion\u003e4.10.3\u003c/version\u003e\n    \u003c/dependency\u003e\n```\n\nTo also work with Solidity SmartContracts and interact with them within your code, you will have to add two build plugins.\nThe `web3j-maven-plugin is needed` to generate the Java wrapper classes for your Solidity contracts. \nThe `build-helper-maven-plugin` is needed to include the generated classes into your /target/ folder.\nMore details in the pom.xml\n\n``` XML\n    \u003cbuild\u003e\n        \u003cplugins\u003e\n            \u003cplugin\u003e\n                \u003cgroupId\u003eorg.web3j\u003c/groupId\u003e\n                \u003cartifactId\u003eweb3j-maven-plugin\u003c/artifactId\u003e\n                \u003cversion\u003e${web3j-maven-plugin.version}\u003c/version\u003e\n                \u003cexecutions\u003e\n                    \u003cexecution\u003e\n                        ...\n                    \u003c/execution\u003e\n                \u003c/executions\u003e\n            \u003c/plugin\u003e\n            \n            \u003cplugin\u003e\n                \u003cgroupId\u003eorg.codehaus.mojo\u003c/groupId\u003e\n                \u003cartifactId\u003ebuild-helper-maven-plugin\u003c/artifactId\u003e\n                \u003cexecutions\u003e\n                    \u003cexecution\u003e\n                        ...\n                    \u003c/execution\u003e\n                \u003c/executions\u003e\n            \u003c/plugin\u003e\n        \u003c/plugins\u003e\n    \u003c/build\u003e\n```\n\n# Usage\n## keyfile\nthe given keyfile.json (/src/main/resources/) is a newly generated wallet with some SEPOLIA or Holesky testnet eth.\nIf you test with this application, you can test with this wallet or create / include your own.\n\n## api development / testing software\ntools like Postman or Insomnia are great for testing REST endpoints.\nPros use cURL ;)\n\n### Postman\nexample for postman or other testing tools:\n\n![postman_test](docs/postman_test.png)\n\n### cURL\nexample for the blockNumber endpoint:\n``` bash\ncurl --location 'http://localhost:8080/api/eth/blockNumber'\n```\n\n## different ETH node\nIt is also possible to use every other node by simply replace the _eth.node.address_ variable in application.properties.\n\nYou can also override the node by defining it via environment variables (`ETH_NODE_ADDRESS=http....`)\n\n\nAs this is just a showcase / fun project / poc / whatever, there are no special profiles for main or test net.\n\n\n# Web3j challenges\nHey, glad you're ready to learn about Web3j.\u003c/br\u003e\nFeel free to fork (or just clone) and play around.\n\nIf you want to track your transactions, you can observe them on the testnet block explorer:\u003c/br\u003e\nhttps://holesky.etherscan.io/address/0x9f162b41fa8e44f885bedae410418145a4e8ed06\n\n## Challenge 1\n* Git clone project (https://github.com/Julius278/eth-web3j-java)\n``` bash\ngit clone https://github.com/Julius278/eth-web3j-java.git\n```\n* (if you have a GitHub account and are familiar with the platform, you can also fork and clone your own repository)\n* you're on the \"main\" branch now\n* Build the Java project on the project root directory\n``` bash\nmvn clean install\n```\n* alternatively you can use the maven plugin of your IDE, here is an example for Intellij \u003c/br\u003e\n\u003cimg src=\"docs/intellij_maven_plugin.png\" alt=\"intellij_maven_plugin\" width=\"400\"/\u003e\n\n* it should show a \u003ci\u003eBUILD SUCCESS\u003c/i\u003e message \u003c/br\u003e\n\u003cimg src=\"docs/maven_build_success.png\" alt=\"maven_build_success\" width=\"250\"/\u003e\n\n* To play around with the existing functionality you can start the spring boot service\n``` bash\nmvn spring-boot:run\n```\nor use the [PlayAroundDemo](https://github.com/Julius278/eth-web3j-java/blob/main/src/main/java/com/julius/spring/boot/ethweb3/demo/PlayAroundDemo.java)\n* Everything is prepared\n  * you can just start by choosing your PropertyName and ID (uniqueness is checked on the PropertySafe)\n  * you don't have to worry about setting up a node, wallet, funding of your account, transaction fees or the connection\n\n## Challenge 2\n* Adjust a given solidity contract (Property.sol, e.g. a new getter function)\n``` Solidity\nfunction getTest() external view returns (string memory){....}\n```\n* Build the Java maven project again \n``` bash\nmvn clean install\n```\n* Use the new getter function in your Java code\n* A possible solution is shown in branch: challenge-3-solution, in short you can see it [here](https://github.com/Julius278/eth-web3j-java/pull/1)\n\n## Challenge 3\nLet's do a calculation on-chain\n* Add a new solidity function which takes two numbers (int) and returns an int (like sum or multiply it)\n* one hint to Integers\n  * Solidity supports 64 different integer types\n  * int results in Solidity to int256\n  * int in Solidity is way bigger than the normal int in Java, so in Java you will have to use BigInteger\n* Build the Java maven project again\n* Use the new function in your Java code\n* A possible solution is shown in branch: challenge-3-solution, in short you can see it [here](https://github.com/Julius278/eth-web3j-java/pull/2)\n\n\n## Challenge 99\nWrite some units tests for your new code ;)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjulius278%2Feth-web3j-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjulius278%2Feth-web3j-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjulius278%2Feth-web3j-java/lists"}