This repository implements deploying a smart contract,connecting a smart contract with web3j
,hashing files with sha256,creating a Spring MVC
webapp with a smart contract and creating a Spring REST
handler to hash Strings in sha256
For Hashing and Recovering files explore com.blockchainInit.encodingFiles package
For Creating a Rest handler and implementing a simple blockchain explore com.blockchainInit.webservice package
For Uploading a file to IPFS via Infura see com.blockchainInit.IPFS to store a simple text file to IPFS
For Creating a webapp with a smartcontract explore com.blockchainInit.MVC after:
-
Compile the solidity file with
solcjs
commandsolcjs HelloWorld.sol --bin --abi --optimize -o ./
-
Create a java wrapper with web3j CLI command
web3j solidity generate --binFile=HelloWorld_sol_HelloWorld.bin --abiFile=HelloWorld_sol_HelloWorld.abi -o . -p org.your.package.name
-
Use this java wrapper to interact with your smart contract ,I have used ganache for my testing.
Ethereum
Solidity
Web3j
Ganache
Spring MVC
Spring Rest