Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

Questions tagged [web3j]

Lightweight Java and Android library for integration with Ethereum clients

Filter by
Sorted by
Tagged with
9
votes
3answers
3k views

Deploy contract on EthereumJS TestRPC

Following https://medium.com/@mvmurthy/full-stack-hello-world-voting-ethereum-dapp-tutorial-part-1-40d2d0d807c2 I've tried to create an instance of a contract using: VotingContract = web3.eth....
8
votes
5answers
15k views

why did it returned null after call miner.start()

> miner.start() > null before it , I had created a account like this . user1 = eth.accounts[0] "0xb62f0bae52d153365661c4e23ab1d594484e9bef"
8
votes
2answers
3k views

Web3j listening to events

I'm tinkering with web3j and most of the things that I want to do succeed, however I seem to not be able to listen to events. I've extended the ballot.sol contract you get with remix by adding an ...
7
votes
2answers
8k views

How to create accounts and also retrieving the ether balance with web3j in a java file?

I do not see anything in creating accounts and retrieving ether balance in web3j's documentation, I wonder if it is possible.
7
votes
1answer
783 views

Deploy contract in web3j quorum problem

I'm trying to deploy a smart contract (7 nodes sample from Quorum) using web3j. It fails at get() to get the contract wrapper object. If I check the logs, a new transaction will show up, but if I call ...
6
votes
2answers
2k views

Unable to deploy contract to private blockchain using Web3j (Java client) because of TransactionTimeoutException

I am using Web3j for interacting with my private blockchain network created in Azure. I have created contracts using Remix and Metamask and was able to view that Contract from Java. However I was ...
5
votes
1answer
3k views

Convert String to Bytes32 in web3j?

public String solFunction(String str) { byte[] byteValue = DatatypeConverter.parseHexBinary(str); Bytes32 strInBytes = new Bytes32(byteValue); try { Uint256 value = contract....
5
votes
1answer
2k views

Solidity ecrecover and web3j Sign.signMessage() are not compatible, is it?

Using Web3j to sign and verify a message is fine but when I use the signature generated by Web3j to verify using ecrecover in solidity it doesnot seem to work correctly. The signer address is ...
5
votes
1answer
588 views

How do I connect Parity and TestRpc

My very much appreciated and valued Conor Svensson -who creates web3j- gave me a very simple task so that we can reproduce the issue https://github.com/web3j/web3j/issues/105#issuecomment-309186331. "...
5
votes
3answers
2k views

A problem with filters and events (web3j/TestRPC). SOS! ;)

Help me, please, with this little simple task! I cannot solve this problem for several days. SOS! ;) I'm trying to write a program for filtering events via web3j. I copied to start (for the test) from ...
4
votes
1answer
1k views

send() or sendAsync() while using Web3j to call functions

I built a java web application which connects using Web3j with my smart contract deployed on Ropsten Network. My web application provides a control panel to allow the user to send transactions to the ...
4
votes
2answers
852 views

Ethereum remix web3 connection problem

I tried to connect to an ethereum node by using remix. It means that I am using http and not https. However, I receive same error message: Not possible to connect to the Web3 provider. Make sure the ...
4
votes
1answer
853 views

How do I get the raw private key from a WalletFile object?

How can I get the raw private key from a WalletFile object? Here is how I am creating the wallet. String seed = UUID.randomUUID().toString(); ECKeyPair exKey = Keys.createEcKeyPair(); BigInteger ...
4
votes
2answers
181 views

personalUnlockAccount.accountUnlocked() giving NullPointerException even if correct passphrase has been inserted

When I trying to unlock the account with personalUnlockAccount.accountUnlocked() method of PersonalUnlockAccount class of web3j library, it's giving NullPointerException even if I am entering right ...
4
votes
1answer
1k views

how to use Web3j library for android

hi guys i am confuse about the web3j library for android i search about this but i did not get any materiel about this (https://github.com/web3j/web3j). this is lib for using ether node on java and ...
4
votes
1answer
499 views

I am using web3j and geth. How to create default accounts with some ether allocation to it?

I need a default account with huge ether allocation. This I need to set up manually in genesis.json Hereafter,all accounts need to be created dynamically in java, and they should also be given some ...
4
votes
1answer
362 views

Why is web3j java not generating correct return types for my contract

Here is my contract: pragma solidity ^0.4.17; contract SignVerify { function recoverAddr(bytes32 msgHash, uint8 v, bytes32 r, bytes32 s) returns (address) { return ecrecover(msgHash, v, r,...
3
votes
2answers
3k views

Convert ethereum balance getting in biginteger to ether

public BigInteger getBalance(String address) { /*Web3j web3j */ createEthreumConnection(); EthGetBalance ethGetBalance = null; try { ethGetBalance = web.ethGetBalance(address, ...
3
votes
1answer
3k views

web3.eth.getBalance returns me the strange values ?

i am trying to get the balance of a wallet, the method is working but the returned result is a json object - { c:(2) [484895,26495000000000],e:19, s: 1}. In which the value - 484895 corresponds to ...
3
votes
1answer
2k views

How to Query the state of a smart contract using web3j in Android?

I found this documentationQuerying the state of a smart contract. but i can't get resault,this is my code. Web3j web3j = Web3jFactory.build(new HttpService(url)); List&...
3
votes
1answer
2k views

Decoding transaction input data with web3j (Java)

My use case is the following: I would like to have a daemon monitoring how users are interacting with my smart contract. The way I see it is to look at incoming blocks and try to decode input data ...
3
votes
2answers
5k views

Send Custom ERC20 Tokens from one Address to another

How to send custom ERC20 tokens from one wallet to another, if i want to send EBTC/ECASH custom ERC20 tokens. I wrote a method that can send the ether from one account to another, how could i do the ...
3
votes
2answers
1k views

Compiling Smart Contract in Java

I want to compile a smart contract (solidity code) in Java. Currently I am using the web3j library. When I run the method web3j.ethCompileSolidity(contract) I'm getting the following error: The method ...
3
votes
2answers
646 views

How to catch solidity contract revert message using web3j

Is there any way to catch solidity revert message like Remix Javascript VM in web3j Revert message(remix) transact to Erecruitment.issueNewAdmitCard errored: VM error: revert. revert The ...
3
votes
1answer
566 views

How to use web3j to observe transaction of ERC20 token

Leverage Web3j TransactionObservable together with filter, i can monitor ETH/ETC transactions as following code snippet illustrates. web3j.transactionObservable().filter(tx -> isWantedTransaction(...
3
votes
2answers
4k views

What is the wallet path for credentials in web3j?

I am using the readme guide https://github.com/web3j/web3j. What I am interested is developing smart contracts from my host with java + web3j to private ethereum network which runs on my virtual ...
3
votes
2answers
264 views

Smart contract listeners

I want to develop a method in a smart contract that act as a listener, what i mean is when i use eth.sendTransaction(from:, to:@ of smart contract) it will be executed, without calling any smart ...
3
votes
2answers
2k views

How to convert Java String to Bytes32 in Java ? I am using web3j solidity wrapper to interact with Smart contract. I am getting following error:

java.lang.UnsupportedOperationException: Input byte array must be in range 0 < M <= 32 and length must match type I am trying to do as given below. I wanted to add the people but wrapper ...
3
votes
1answer
247 views

how to use web3j over infura to find exact gas price used for a successful transaction

my goal is to compute the cost of gas for a successful tx. I get a callback when a transaction succeeds and i retrieve gasUsed with transactionReceipt.getGasUsed(). Now I need to know the exact gas ...
3
votes
2answers
735 views

How to use mnemonic to recovery my ethereum wallet

I use web3j to create my ethereum wallet.the Code just like down import org.web3j.crypto.Bip39Wallet; import org.web3j.crypto.Credentials; import org.web3j.crypto.ECKeyPair; import org.web3j.crypto....
3
votes
1answer
526 views

Recover address from signature using web3j

I have signed a data string using the following code snippet in web3js var data = "hello world"; web3.personal.sign(web3.fromUtf8(data), web3.eth.accounts[0], function(error, result) { if (!...
3
votes
2answers
2k views

Web3j - sending erc20 token

I would like to ask how to correctly send ERC20 Token from a wallet to another wallet , followings are my codes : public static void main(String[] args) throws Exception { Web3j web3 = Web3j....
3
votes
1answer
367 views

Passing Web3 & Contracts Between Components - React Redux & MetaMask

Curious what's the best way to access and pass a web3 contract instance provided by MetaMask between components when using react-redux. At this point, I'm tempted to do the following for both web3 ...
3
votes
1answer
412 views

Ethereum - how to get merkle proof

I'm trying to figure out the check of existence and the immutability of the transaction in the Ethereum block, but I do not know how to get mercle branch. With the help of web3j I can get the block ...
2
votes
2answers
5k views

Generate private key and address using web3j

How can i generate private key and address using web3j instead of creating keystore json file
2
votes
3answers
6k views

How to view custom token balance in ether wallet using web3

Hello I am newbie to cryptocurrency. I have created my erc20 custom token. Now, I want to create an API to view the balance(in my token as well as in ethers) using web3 and node js.Can someone please ...
2
votes
1answer
803 views

How could I send transactions continuously by Web3j generated wrapper

I wrote a smart contract and deployed on my private Quorum. I use Web3j to generate java wrapper to call ABIs. For example, // here is a smart contract function function getMoney() external payable ...
2
votes
1answer
524 views

How can I get the TxReceipt of a transaction with web3j?

How can I get the status of a transaction through the TxHash with web3j. I tried it like this: public int getEstado(String trx) { try { JSONObject json = readJsonFromUrl("https://api....
2
votes
1answer
310 views

Not able to decode the input data from transaction using web3j

I am creating transactions using web3j and passing some private data in that transaction. The transaction is also getting mined . I have subscribed to the mined blocks, where I am fetching the ...
2
votes
1answer
3k views

How fetch transaction history for account quickly using Web3j?

Intro We use Web3j java library to work with Ethereum network. I use Rinkeby test network wit Geth client at the moment. I got familiar with blockchains only a week ago, so terms I use can be ...
2
votes
1answer
2k views

Create ethereum wallet inside android dapp

I am creating a DApp for android and want to be able to create a wallet for each user when they register. I am using web3j, can see how to make wallets in the command line but can't see how to do it ...
2
votes
1answer
2k views

Web3j: “Intrinsic gas too low” error when deploying contract in Ethereum from Java

I am a new to Ethereum and Blockchain, I have been trying execution of Contracts using Metamask and Remix using Chrome browser for sometime. I am trying to deploy the same contract from Java using ...
2
votes
2answers
358 views

invalid opcode “0x1c” during smart contract method execution

I have written a smart contract to test event from java project using web3j I have prepared the web3j wrapper java class using solc compiler version "0.5.7+commit.6da8b019.Linux.g++" I am using a ...
2
votes
1answer
238 views

What does the get Status () method return with a pending state transaction?

If a transaction has a successful state it returns 0x1 but if the transaction has a failed state it returns 0x0. My questions is, what to return when the transaction has a pending status? public ...
2
votes
2answers
181 views

How do I update data for project using blockchain (Ethereum)?

I am very new to creating blockchain dapps, so some guidance would be appreciated. I am conceptualizing how to approach creating a private blockchain so that users can communicate about the status of ...
2
votes
1answer
895 views

Should I use Infura with Web3j for Event filter?

I'm using Web3j with Infura for smart contract deployment, calling contract method and transactions. Now I want to use Filter contract event from log. Should I use Infura for this? Is Web3j filter ...
2
votes
1answer
1k views

Is it possible to call payable functions of smart contract using web3j’s smart contract wrappers?

How do we call payable functions of smart contract using web3j? UPDATE: I'm going to change generated smart contract wrapper class manually. Now I have: public Future<TransactionReceipt&...
2
votes
1answer
1k views

Function of smart contract returns 0 from Web3j

please help me in this problem. I am successful to compile and deploy my smart contract using web3j on testrpc. But When I call the function that returns uint in this contract from web3j, I always ...
2
votes
2answers
121 views

Too low nonce error with web3j and rinkeby

All of sudden my application on testnet has stopped working due to low nonce error. No change in source code. My app connects to the network via infura. Any ideas what could be wrong here. java.lang....
2
votes
1answer
234 views

How to call geth mining through java code manually ?

I am using web3j and Geth and created a private network. However, I want to do the mining manually whenever required, since don't want to jam the server when I am in the development phase. For that, I ...