Questions tagged [web3j]

Lightweight Java and Android library for integration with Ethereum clients

Filter by
Sorted by
Tagged with
2
votes
1answer
257 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 ...
1
vote
2answers
212 views

web3j: EthSendTransaction.sendTransaction() is throwing “Error processing transaction request: Invalid params: invalid format”

I am trying to send a transaction to an address: 0xDD210......... using the EthSendTransaction.sendTransaction() method from the org.web3j.protocol.core.methods.response.EthSendTransaction library. ...
3
votes
2answers
751 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 ...
1
vote
1answer
131 views

web3j event listening on android project

I trying to listen events from smart contract but my code isn't working. what's the problem? Event event = droneChain.UPDATEMISSIONSTATE_EVENT; String encodedEventSignature = EventEncoder.encode(...
2
votes
1answer
271 views

How Can I call contract's function from Java?

There is BizzleTokenSale contract. pragma solidity ^0.4.2; import "./BizzleToken.sol"; contract BizzleTokenSale { address admin; BizzleToken public tokenContract; uint256 public tokenPrice; ...
0
votes
2answers
681 views

how to get latest block number using web3j java APIs

I ask the network for current balance of the address i want to keep track. after that i want to detect/listen incoming deposits starting at the latest block number at the start of my program/server. ...
1
vote
3answers
437 views

How can i read symbol and name of the token in transaction?

How can i read symbol and name of the token in transaction? I tried to decode input data from transaction, but it wasn't success. the latest Web3j does not have toAscii method in java. Should i use ...
1
vote
1answer
365 views

Creating wallets with Web3j

I generate a code to create wallets for a private chain made with ethereum. String password = unlockAccountParameter.getPass(); ECKeyPair keyPair = Keys.createEcKeyPair(); WalletFile ...
0
votes
2answers
709 views

Create account with web3j

Im trying to create a account using the web3j library. But i can´t find the method that create accounts. My idea is to make this judgment but not in the Geth console, but yes in the Java application ...
0
votes
1answer
349 views

web3j.ethSendRawTransaction wait until the transaction is successfully mined - Web3j

Im trying to send 0 ether to the same account with Web3j, however when i run this code it give me directly the transaction hash, even if the transaction has not been mined yet and still pending. I can'...
0
votes
1answer
683 views

retry mechanism for transactions in web3j

In my Java-web-application I have (with one click) to send about 120 transactions after each other from the same address to the same smartcontract. My question: is there any java libraries or ...
-5
votes
1answer
110 views

Need help integrating ERC20 on Exchange [closed]

Pardon my ignorance, as I have very less knowledge of ERC20 and Ethereum. I am part of an exchange development and we have successfully integrated coins but when it came to ERC20 tokens, we are ...
0
votes
1answer
232 views

Converting int to default block parameter

I am using Infura and web3j to query the Ethereum blockchain. My aim is to get information about certain blocks so i'm using the function web3.eth.getBlockByNumber, however it gives me incompatible ...
0
votes
1answer
293 views

Send function transaction to existing smart contract using web3j

I've been exploring web3j and got the credentials working so I'm able to send transactions from an ethereum address. Now I want to send a transaction to an already existing smart contract and use a ...
1
vote
0answers
250 views

How to encode tuple as input parameter to function using web3j

I am attempting to call a solidity function that looks something like the following: function fillOrder( Order memory order, uint256 takerAssetFillAmount, bytes memory signature ) Using ...
0
votes
1answer
405 views

Port number for connecting web3 to mainnet using Geth

I am trying to connect web3j object to the mainnet using geth. I can't use infura because i am working with replay transaction observable function which doesn't work with infura. To connect with the ...
1
vote
1answer
160 views

Input byte array must be in range 0 < M <= 32 and length must match type-web3j

I have created an api to addCandidates. But when i run the api i get error: Input byte array must be in range 0 < M <= 32 and length must match type My codesnippet for addCandidates is: @...
0
votes
1answer
67 views

java.lang.RuntimeException: Error processing transaction request: insufficient funds for gas * price + value when deploying smart contracts

I am trying to deploy smart contract using web3j. My code is as follows: @RequestMapping("/") public String index() throws Exception { Web3j web3j = Web3j.build(new HttpService("https://...
0
votes
1answer
91 views

LoadCredentials function returns file not found exception

I am using the following code to deploy my contract: @RequestMapping("/") public String index() throws Exception { Web3j web3j = Web3j.build(new HttpService("https://rinkeby.infura.io/v3/...
0
votes
1answer
283 views

Compatibility between Solidity language and Web3j library

What is the compatibility between solidity and web3j. I don't find any resource about it. Suppose if I generate my java wrapper class of smart contract written in Solidity ^0.4.17 version and taking ...
4
votes
1answer
2k 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 ...
2
votes
2answers
231 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 ...
4
votes
2answers
211 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 ...
1
vote
1answer
113 views

Value returned by a getter from smart contract instead of uint : org.web3j.protocol.core.RemoteCall@5104cf00 - spring boot - web3j

pragma solidity ^0.4.18; contract MyDeal { /// The seller's address address public owner; /// The buyer's address part on this contract address public buyerAddr; /// The Buyer struct ...
4
votes
1answer
540 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 ...
3
votes
2answers
782 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....
1
vote
0answers
78 views

Web3j no transaction pooling with REST

I have setup an application with jhisper gateway with one microservice in REST linked to Web3j. Idea is when you store an object in the database, you notarize it in a private ethereum blockchain. So, ...
1
vote
0answers
18 views

necessity of mining while doing transaction [duplicate]

While doing any transaction in private network, is it necessary for one node to keep on mining?. I was trying to implement to deploy smart contract and transact in ethereum private network with the ...
0
votes
1answer
466 views

Failed to connect to localhost/0:0:0:0:0:0:0:1:8545

When I am doing one transaction with the help of Java web3j library, it's not connecting to localhost(my private network). And giving this error. package com.kaushik.blockchain; import java.math....
1
vote
0answers
67 views

Web3J - Creation of Light Wallet takes too long

I am creating the wallet in my Android app, using the library Web3j: https://web3j.io/ See the code: String seed = UUID.randomUUID().toString(); ECKeyPair exKey = Keys.createEcKeyPair(); WalletFile ...
0
votes
1answer
381 views

How to generate ERC-20/xxx token addresses?

How to generate ERC-20/xxx token addresses, from which I can receive/send corresponding tokens? How can I do this using web3j?
1
vote
1answer
43 views

Contract NOT created when using “new” on testnet

I've got a contract which one of his functions creates a new contract in the following manner: (Solidity) function createCarrier() public { P2Carrier newCarrier = new P2Carrier(msg.sender); ...
4
votes
1answer
905 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 ...
0
votes
1answer
255 views

How to get contract creator using web3j?

How can I get the address of the creator of a contract using web3j? Is it possible to get the first transaction of a contract and assume that the "from" field is the contract creator? If so, how can I ...
3
votes
1answer
572 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 (!...
1
vote
1answer
264 views

web3j transactions with value

I'm using web3j to analyze transactions. How can I get transactions of a specific contract (assuming I got it's address) in some time frame (or blocks interval) and how can I know if ERC20 tokens were ...
1
vote
1answer
412 views

How to create wallet with web3j and web3swift like with web3js web3.eth.accounts.create(); function?

With web3js v1.0.0 you can create accounts with web3.eth.accounts.create(); and access the public address and private key with newWallet.address and newWallet.privateKey. How can you do this with ...
1
vote
0answers
112 views

Filtering blocks on basis of transaction logs in web3j

I want to filter blocks on the basis of a log present inside transactions. How can I do that? I don't have any contract address and want to filter all the blocks generated by all the contracts. ...
0
votes
1answer
295 views

java.lang.RuntimeException: Error processing transaction request: insufficient funds for gas * price + value when invoking smart contract function

using web3j for loading a contract which is deployed on the private network following this tutorial https://web3j.readthedocs.io/en/latest/smart_contracts.html#constant-methods smart contract ...
1
vote
1answer
615 views

How get Ethereum address using phrase only in Android

I want to get Etherum address and private key by adding Phrase (or Password) everytime. I tried by following many gihub code.It gives different private key everytime. In Web3j, I found it is based on ...
1
vote
1answer
630 views

how to know smart contract gas price and gas limit when deploying the contract using web3j

I am new to smart contracts and ethereum I am using web3j to deploy contracts on the private network Following this as a guide https://github.com/web3j/web3j In the below section of code, it asks ...
0
votes
1answer
398 views

Getting contract binary using web3j

I'm using web3J library in my java app. I got an address of a deployed contract and would like to get it's binary or abi from the blockchain using my java app, how can I do that?
0
votes
0answers
25 views

Storing generated accounts. Security

I originally built a system that had a front end where users simply entered some details and a password which then generated them a wallet and emailed it to them. My aim was that the user could then ...
0
votes
2answers
1k views

Getting “insufficient funds for gas * price + value” with geth on Ropsten no matter what

I'm having geth 1.7.3 (tried 1.8.x too) running in docker container: --verbosity 4 -rpc --nousb --ipcdisable --rpcaddr "0.0.0.0" --rpccorsdomain "*" --syncmode "fast" --rpcapi="db,personal,eth,net,...
0
votes
1answer
556 views

Web3j directly gets string from contract by eth_call

I just have a simple solidity contract: pragma solidity ^0.4.19; contract SampleContract { string value; function SampleContract() public { value = "hello world"; } ...
0
votes
1answer
527 views

Cannot send ERC20 tokens because user has no ethereum

I have 1 wallet server but have many account address for each user, so when user want to transfer erc-20 token say OMG to another address(user) in the same wallet server, the system said can not ...
1
vote
1answer
1k views

how to get the status of a transaction which is not mined and pending

I used the following code to send a transaction and get transaction status.However, sometimes the transaction is not minded at all. But the transactionReceipt get the same value "NULL" for both of the ...
0
votes
0answers
933 views

web3j Android, “E/JavaBinder: !!! FAILED BINDER TRANSACTION !!!” When try to get balance

My app tries to get the balance of an ethereum address, but when testing, it crashes. I get the error "E/JavaBinder: !!! FAILED BINDER TRANSACTION !!!" in logcat. Using web3 and android studio. Web3j ...
0
votes
0answers
110 views

Smart contracts work when deployed with Remix, but not Web3j

I have a web3j call to a smart contract ecrecover() function and I need to pass the V value. However I'm unsure as to how to convert the V value to a BigInteger. Web3j: aVerifier.verify("Kieran", "...
0
votes
0answers
384 views

How to automatically transfer ETH from my address to another

I want to format or configure my ETH wallet in a way that if any ETH comes into the address, it will automatically be sent to another address. I have the feeling that my private key is being ...