Skip to content

Document hash storing on Ethereum blockchain from Java

License

Notifications You must be signed in to change notification settings

Yann39/eth-hash-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ethereum logo

Document hashes on Ethereum blockchain from Java

Storing and reading document hashes on the Ethereum blockchain from Java.

Version Static Badge

Version Version Version Version Version


Table of Contents

About the Project

Java logo Spring logo H2 logo ZK logo Bootstrap logo H2 logo

This project demonstrate document hash storing on the Ethereum blockchain from Java.

This is a Java Spring Boot application with a ZK frontend, that use an embedded H2 database for demonstration purpose.

Getting Started

Prerequisites

To run this project in a local environment, you need :

  • A local Ethereum blockchain running on localhost on port 7545
  • A Diploma smart contract deployed to handle document hash read and write

See the eth-hash-chain project for setting up a local blockchain with all the required capabilities.

Installation

  1. Clone the repository :
    git clone https://github.com/Yann39/eth-hash-app
  2. Replace application.account-address and application.contract-address values in application.properties to match your account and smart contract addresses according to your running blockchain
  3. Build the JAR file using Maven :
    mvn package
  4. Start your local blockchain (Ganache)
  5. Execute application from Intellij or run the JAR file, with the right profile :
    java -Dspring.profiles.active=local -jar /target/eth-hash-app.jar
  6. Reach http://localhost:8080/

Usage

Simply reach the application home page at http://localhost:8080/ to display the home page.

Navigate to the Documents menu, or direct access : http://localhost:8080/diplomas

Connect to the Ethereum network (you should see a "connected" message) :

Application main page

Then simply add documents and try to save hashes to the Ethereum blockchain.

You can then view documents :

Application view document page

License

General Public License (GPL) v3

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Releases

No releases published

Packages

No packages published