Skip to content

Commit

Permalink
Create Blockchain.java
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Jul 25, 2024
1 parent f831f3f commit c45813f
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.sidra;

import org.web3j.protocol.Web3j;
import org.web3j.protocol.core.methods.response.Web3ClientVersion;

public class Blockchain {
public static void main(String[] args) {
// Set up a Web3j instance
Web3j web3j = Web3j.build(new HttpService("https://mainnet.infura.io/v3/YOUR_PROJECT_ID"));

// Get the client version
Web3ClientVersion clientVersion = web3j.getClientVersion().send();
System.out.println(clientVersion.getWeb3ClientVersion());
}
}

0 comments on commit c45813f

Please sign in to comment.