Skip to content

A sample Ethereum blockchain run on Ganache with client calls from Web3j Java

Notifications You must be signed in to change notification settings

Msrikrishna/ethereum-server-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ethereum-server-client

A sample Ethereum blockchain run on Ganache with client calls from Web3j Java

Image

Tech Stack

Client: Java Web3j

Server: Local Ethereum Node using Ganache

Image

Installation

Install Ganache

Download Ganache GUI tool at https://trufflesuite.com/ganache/

Ganach GUI sample image

Install Truffle (Development tool for Smart Contracts)

npm install -g truffle

Run Locally

Clone the project

  git clone https://github.com/Msrikrishna/ethereum-server-client.git

Go to the project directory

  cd ethereum-server-client

Run a local blockchain using Ganache GUI (Create a one click blockchain). This should run a blockchain at http://127.0.0.1:7545

Deploy smart contract to blockchain using truffle

  cd HelloWorldSolidity
  truffle compile
  truffle migrate --network development

Find and update the smart contract blockchain address to Java client

 On the Ganache GUI under Contracts, add HelloWorldSolidity/truffle-config.js. This will allow us to
 view the contract address on the blockchain

 Now update CONTRACT_ADDRESS under Web3jJavaClient/src/main/java/EthereumNodeCaller.java with the address 
 of the "Counter" contract

Running Tests

To run client side tests, run the following command

  cd Web3jJavaClient
  mvn test

About

A sample Ethereum blockchain run on Ganache with client calls from Web3j Java

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published