Practical overview
When it fits
Use it as a hands-on reference when building a Java project around Geth and Web3j, especially to understand the path from a Solidity source file to generated Java bindings and contract interactions.
Who it is for
- Java developers learning how Web3j connects to a Geth private chain.
- Developers seeking examples of Solidity wrapper generation, contract deployment and contract calls.
Documented uses
- Initialize and start a local Geth private chain with HTTP-RPC enabled.
- Create and query accounts and check an account balance from the Geth console.
- Generate Java wrappers from Solidity sources with the Web3j Maven plugin.
- Deploy or load a HelloWorld contract and explore account, transfer, transaction and filter examples.
Requirements & limits
The project is publicly visible on GitHub. Its README names Windows and Linux startup scripts and includes Geth build instructions for CentOS.
- The repository shows both a Remix-and-Geth deployment route and a Web3j Java route.
- Its Web3j dependency and Maven plugin examples specify version 4.5.11.
- The direct Geth command binds RPC to 0.0.0.0 and sets CORS to
*; treat these as example settings rather than recommended exposure.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Prepare a Geth private chain and expose JSON-RPC
Initialize a Geth data directory and start the example private chain with its HTTP-RPC interface.
Before you start
- Geth installed, or the documented CentOS build prerequisites: yum, Go and Git.
- A genesis.json file.
- Windows or Linux for the named startup scripts.
Steps
Initialize the chain with
geth init genesis.json.Start it with
startup.baton Windows orstartup.shon Linux; the README also provides a direct Geth command.The direct command uses HTTP-RPC on port 8545, a 0.0.0.0 bind address, CORS domain
*, selected RPC APIs and network ID 666666.
Expected outcome
A Geth private-chain setup with an HTTP-RPC endpoint for the documented account and Web3j examples.
Guide limitations
- The repository does not include the contents of genesis.json in the supplied instructions.
- The example RPC bind and CORS settings are reproduced as configuration details, not security guidance.
Generate Web3j bindings and follow the HelloWorld deployment flow
Use the documented Maven plugin and Java examples to generate a contract wrapper, deploy HelloWorld and load it by address.
Before you start
- A Geth JSON-RPC endpoint and Java project.
- Web3j core and web3j-maven-plugin dependencies, shown at version 4.5.11.
- A Solidity source file such as resources/HelloWorld.sol, plus credentials and a contract address for the Java examples.
Steps
Add the Web3j core dependency and Maven plugin configuration shown in the README.
Run the documented
web3j:generate-sourcesMaven plugin goal to generate a Java wrapper from the Solidity source.Use the HelloWorldDeploy example to deploy the contract and record its address in application.properties.
Use HelloWorldMain to load the contract at the configured address.
Expected outcome
A generated Java contract wrapper and example classes for deploying and loading the HelloWorld contract.
Guide limitations
- The README does not provide a complete project configuration or all endpoint and credentials values.
- Deployment requires a suitable running chain and configured credentials; the guide does not establish that a particular environment will compile or run the examples.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 17 October 2026
- Original website title
- zhangbincheng1997/Ethereum · Official homepage title · retained in its source language

