Sample Counter Ethereum Smart Contract Web3j API
The purpose of this project is to enable a Java server side REST API to interact with Ethereum Transaction node.
The project demonstrates a Counter Smart Contract which has the following methods: increment, decrement and counts.
The REST API exposes the above Smart Contract methods and also the following methods: deployContract and loadContract.
Update the Wallet Private Key in CounterHandler.java class
In Case of Existing Smart Contract - Update the Contract Address in CounterHandler.java class
mvn clean
mvn package - this will start the embedded Apache Tomcat server.
Deploy Contract using: http://localhost:8080/network/deployContract
Load Existing Contract using: http://localhost:8080/network/loadContract
Interact with the Ethereum Smart Contract using:
http://localhost:8080/counter/increment
http://localhost:8080/counter/decrement
http://localhost:8080/counter/counts