I have a Bitcoin wallet developed in Java/Spring MVC and supports account setup, connect with the blockchain and keep tracks of the updates such as the balance, transactions etc. The sample code provided,

public class WalletModel {

    // keep tracks of the updates in the wallet
    private void update(Wallet wallet) {

          this.balance = wallet.getBalance();

    this.address = wallet.currentReceiveAddress();

    transactions.addAll(wallet.getRecentTransactions(100, false));

    // find to most recent transaction
    this.transaction = Objects.isNull(transactions) ||
            transactions.isEmpty() ? "No transaction" : String.valueOf(transactions.get(0));

public boolean setWallet(Wallet wallet) {

    try {

        wallet.addChangeEventListener(new WalletChangeEventListener() {
            public void onWalletChanged(Wallet wallet) {
        return true;
    } catch (Exception e) {
    return false;

The WalletManager code e.g,

public class WalletManager {

      public static WalletAppKit bitcoin;
      public static NetworkParameters networkParameters = 

public static WalletManager setupWallet(final String walletName) {

        logger.info("Setup Wallet");

        WalletManager walletManager = new WalletManager();

        try {
            if (walletManager.bitcoin.isChainFileLocked()) {
                return walletManager;
        } catch (IOException e) {
            return walletManager;

        return walletManager;

private void setupWalletKit(final String walletId) {

        File directory = getWalletDirectory(walletId);

        // if the seed is not null, that means we are restoring from the backup
        bitcoin = new WalletAppKit(networkParameters, directory, WALLET_FILE_NAME) {

            protected void onSetupCompleted() {

                // Don't make the user wait for confirmations
                // they're sending their own money anyway!!
                Wallet wallet = bitcoin.wallet();

                setupCompletedListeners.forEach(listener -> listener.onSetupCompleted(wallet));

        // Now configure and start the appkit. This will take a second or two - we could show a temporary splash screen
        // or progress widget to keep the user engaged whilst we initialise, but we don't.
        if (networkParameters == RegTestParams.get()) {
            bitcoin.connectToLocalHost();   // You should run a regtest mode bitcoind locally.
        } else if (networkParameters == TestNet3Params.get()) {

                .setUserAgent(APP_NAME, "1.0");

How to write similar operations in the Ethereum with Java?


I use maven for the development and use EthereumJ dependency e.g;


This seems fine as there is no error in the POM file. When I tried to import in the source file, I get the RED errors,

enter image description here

I have tried with other version of the dependencies as well. What os the issue here?

  • 1
    One place you can check is github.com/ethereum/ethereumj
    – eth
    Commented Aug 18, 2017 at 5:24
  • Does it provide all the supports as of BitcoinJ?
    – Arefe
    Commented Aug 18, 2017 at 5:32
  • If I were you, I would use web3j. I use it an I really like it. Commented Oct 30, 2017 at 21:43

2 Answers 2


I think it be easier to use an api to monitor account details. For instance Amberdata.io has a way to get the details about an account that you are looking for. You can try it out here!


In order to acquire dependency by maven you should add this to your pom:


because artifacts were not published on the central http://maven.org/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.