Skip to main content
Updated the contract. This was taken from an example
Source Link

I am writing a Java program to deploy a smart contract. I have created the Java Wrapper class. This is the essence of the code.

static final BigInteger GAS_PRICE = BigInteger.valueOf(20_000_000_000L);
static final BigInteger GAS_LIMIT = BigInteger.valueOf(4_300_000);
Credentials creds = WalletUtils.loadCredentials(password,
            pathtowalletfile);
Greeter contract = Greeter.deploy(web3j, creds, GAS_PRICE, GAS_LIMIT, BigInteger.ZERO, new Utf8String("Hello")).get();

When I run my program I am getting this error

Error processing transaction request: Insufficient funds for gas * price + value

I must say that I am quite new to ethereum and web3j. My geth version is 1.6.0-stable-facc47cb

Any help would be much appreciated.

Updated with Contract

contract mortal {
    address owner;

    function mortal()  { owner = msg.sender; }
    function kill() { if(msg.sender == owner) suicide(owner); }
}

contract greeter is mortal {
    string greeting;

    function greeter(string _greeting) public {
        greeting = _greeting;
    }

    function greet() constant returns (string) {
        return greeting;
    }
}

I am writing a Java program to deploy a smart contract. I have created the Java Wrapper class. This is the essence of the code.

static final BigInteger GAS_PRICE = BigInteger.valueOf(20_000_000_000L);
static final BigInteger GAS_LIMIT = BigInteger.valueOf(4_300_000);
Credentials creds = WalletUtils.loadCredentials(password,
            pathtowalletfile);
Greeter contract = Greeter.deploy(web3j, creds, GAS_PRICE, GAS_LIMIT, BigInteger.ZERO, new Utf8String("Hello")).get();

When I run my program I am getting this error

Error processing transaction request: Insufficient funds for gas * price + value

I must say that I am quite new to ethereum and web3j. My geth version is 1.6.0-stable-facc47cb

Any help would be much appreciated.

I am writing a Java program to deploy a smart contract. I have created the Java Wrapper class. This is the essence of the code.

static final BigInteger GAS_PRICE = BigInteger.valueOf(20_000_000_000L);
static final BigInteger GAS_LIMIT = BigInteger.valueOf(4_300_000);
Credentials creds = WalletUtils.loadCredentials(password,
            pathtowalletfile);
Greeter contract = Greeter.deploy(web3j, creds, GAS_PRICE, GAS_LIMIT, BigInteger.ZERO, new Utf8String("Hello")).get();

When I run my program I am getting this error

Error processing transaction request: Insufficient funds for gas * price + value

I must say that I am quite new to ethereum and web3j. My geth version is 1.6.0-stable-facc47cb

Any help would be much appreciated.

Updated with Contract

contract mortal {
    address owner;

    function mortal()  { owner = msg.sender; }
    function kill() { if(msg.sender == owner) suicide(owner); }
}

contract greeter is mortal {
    string greeting;

    function greeter(string _greeting) public {
        greeting = _greeting;
    }

    function greet() constant returns (string) {
        return greeting;
    }
}
Source Link

Insufficient funds error on deploying smart contract

I am writing a Java program to deploy a smart contract. I have created the Java Wrapper class. This is the essence of the code.

static final BigInteger GAS_PRICE = BigInteger.valueOf(20_000_000_000L);
static final BigInteger GAS_LIMIT = BigInteger.valueOf(4_300_000);
Credentials creds = WalletUtils.loadCredentials(password,
            pathtowalletfile);
Greeter contract = Greeter.deploy(web3j, creds, GAS_PRICE, GAS_LIMIT, BigInteger.ZERO, new Utf8String("Hello")).get();

When I run my program I am getting this error

Error processing transaction request: Insufficient funds for gas * price + value

I must say that I am quite new to ethereum and web3j. My geth version is 1.6.0-stable-facc47cb

Any help would be much appreciated.