Questions tagged [web3j]

Lightweight Java and Android library for integration with Ethereum clients

Filter by
Sorted by
Tagged with
1
vote
1answer
109 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/...
1
vote
0answers
82 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 ...
1
vote
0answers
80 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 ...
1
vote
1answer
468 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
124 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. ...
1
vote
0answers
253 views

Getting ClassCastException while creating wallet

Always getting this exception when I am creating new wallet file java.lang.ClassCastException org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPrivateKey cannot be cast to org.bouncycastle.jcajce....
1
vote
0answers
381 views

How to subscribe to future incoming ERC-20 token events?

I'm using web3j to subscribe to my ERC-20 token transfer events with transferEventObservable: humanStandardToken.transferEventObservable(DefaultBlockParameterName.EARLIEST, DefaultBlockParameterName....
1
vote
0answers
138 views

Can deploy Smart contract from Main thread but not from a class

I have a contract: pragma solidity ^0.4.0; contract qualification { address owner; /* This function is executed at initialization and sets the owner of the contract */ function qualification() { ...
1
vote
0answers
302 views

Get and Set values of Contract remotely via Web3j returns 0 and null

I have my two Quorum nodes setup on two different machines A(X.X.X.1) and B(X.X.X.3) and I am trying to interact with the smart contract from a different machine C(X.X.X.4) via Web3j. Below is the ...
1
vote
0answers
282 views

String returned from mapping of struct array

I want to store some details from every transaction. These are the struct and the variable: struct MoneyTransfer{ address sender; string comment; uint creationTime; uint quantity; } ...
1
vote
1answer
901 views

iOS: Create Raw Transaction in swift

I'm working on a project related to blockchain and need to figure out, how raw transaction can be possible, I got no reference for this as of now. Can anyone help me? I have tried this lib: https://...
1
vote
0answers
696 views

How to create ethreum wallet using WEB3j [duplicate]

I want to create my own Ethereum wallet,how can I do that and is it necessary to run GETH or similar to use wallet.It will be helpful if any good reference can be provided as I am very much new to it
1
vote
0answers
95 views

Is there a thread leak in Ethereum Web3J

As part of our plans to integrate blockchain technology, I am looking at Ethereum and playing around with the java API (web3j). One obviously starts with the examples but I found that the VM does not ...
1
vote
0answers
213 views

WalletUtils.loadCredentials takes a while to answer,about 2 minutes

WalletUtils.loadCredentials takes a while to answer, about 2 minutes, running on the android devices, Credentials credentials = WalletUtils.loadCredentials("password","path to file"); just this method,...
1
vote
0answers
111 views

Huge amount of gas being used for small computation

I have just added one other part to my contracts addUser method (setting the isPermitted field) and it has blown up the amount of gas it uses to the point I keep getting out of gas exceptions. The ...
1
vote
1answer
251 views

Web3j client not exit after unsubscribe

I use web3j to fetch information from ethereum blockchain, public static void main(String[] args) throws InterruptedException { Web3j web = Web3j.build(new HttpService("http://10.9.59.138:18001")...
1
vote
0answers
102 views

Setting balance to an account

After i created a wallet for a user i want to modify his balance, how could i do that without setting the account address' balance in the genesis, I'm using quorum blockchain with web3j. Thank you!
1
vote
1answer
2k views

How to transacting with a smart contract using web3j in Android?

i used web3j to Transacting with a smart contract. this is my Contract function which i want to intertact with. function usersRegister(string _id, string _password){ Equipment e = equipments[msg....
1
vote
2answers
308 views

Pass specific address in Web3J send method

How to pass specific address in send method in Web3J? For example, using web3 javascript library, we can pass from address like below. contract.someMethod().send({ from: this.props.accounts[0] }) ...
1
vote
1answer
624 views

problem when deploy smart contract in Quorum using web3j

I'm using web3J when i try to deploy contract i get Error processing transaction request: Non-200 status code: &{Status:400 Bad Request StatusCode:400 Proto:HTTP/1.1 ProtoMajor:1 ProtoMinor:1 ...
1
vote
4answers
1k views

How to access ethereum smart contract(already deployed) in a Java application via its address using web3j?

I have an existing Smart contract address,abi,binary code. I need to access it from a Java application.Is it possible to do this without creating a java wrapper class?
0
votes
2answers
894 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. ...
0
votes
1answer
351 views

Where is the ethLogObservable method in Web3j?

I can´t find where is the Web3j ethLogObservable method. I can´t find in GitHub repo
0
votes
1answer
236 views

Recover solidity funcion event in web3j

EthFilter filter = new EthFilter(DefaultBlockParameterName.EARLIEST, DefaultBlockParameterName.LATEST, userContract.getContractAddress().substring(2)); I am trying to recover the event response that ...
0
votes
1answer
322 views

How to apply EthFilter to specific address?

In web3.js, we can apply event filter something like below: this.event = this.Contract.events.MyEvent({ filter: { address: "0xAccountAddress" }, }) In Web3J, it is translated to EthFilter ...
0
votes
2answers
83 views

How to prevent unwanted parties pushing data to a private chain?

For example, if a private chain genesis is distributed to a group of approved peers, however a peer makes this genesis block publicly available. How can one prevent unwanted users from joining the ...
0
votes
4answers
1k views

web3j-android error: static interface method calls are not supported at language level 1.7

I get this error static interface method calls are not supported at language level 1.7 when having Web3j web3j = Web3j.build(new HttpService(url)); documentation here says for Android you should ...
0
votes
1answer
372 views

How to use eth_newFilter to get pending incoming transactions to a contract?

I'm trying to get pending transactions to a certain contract using Infura. Is it possible to do that using eth_newFilter? Since apparently these filters only "trigger" from contract events, does that ...
0
votes
1answer
350 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 ...
0
votes
2answers
290 views

Does an ethereum address exist on all networks when created?

When you create a wallet file, can you use the same address on both main net and test net? I understand the same address will have different funds on each network, but does the address exist on both?...
0
votes
1answer
462 views

Getting exception while getting the ethBalance

web3 = Web3j.build(new HttpService()); EthGetBalance ethGetBalance = web3.ethGetBalance("0xb34a5b6a39bceafeb8e23c2cc526889d85bf664e", DefaultBlockParameterName.LATEST).send(); ...
0
votes
1answer
748 views

Interacting with an ethereum smart contract via Java

I am interested in interacting with a smart contract via a Java application. I found that there is a library called web3j (https://docs.web3j.io/) for which this should be possible, however there is ...
0
votes
2answers
651 views

web3j WalletUtils.loadCredentials() works in Java, throws java.lang.OutOfMemoryError on Android

I'm trying to use web3j + Infura to interact with the Rinkeby chain from an android app. I first wrote a simple test in Java and everything worked - transactions, interacting with contracts, you name ...
0
votes
3answers
636 views

How can I let TestRpc reveil the public key of a generated account

I suffer a steep learning curve at the beginning. My current goal is to set up a testing environment with TestRpc, Truffle and Web3j (wow). Web3j worked as expected and generated a Java wrapper for ...
0
votes
1answer
14 views

How to reliably send transaction via web3j while connection is poor?

I use Transfer.sendFunds(Web3j, Credentials, BigDecimal, Convert.Unit) to transfer money. Usually I convert it to flowable. Flowable/RemoteCall completes when transaction is included in block (...
0
votes
1answer
67 views

Not able to add 'replayPastTransactionsFlowable' transaction logs result into an collection List object using Web3j java?

I'm trying to create an api where i have to provide transaction logs in json objects but im unable to add result of replayPastTransactionsFlowable into an collection object @GetMapping("/test") ...
0
votes
1answer
48 views

How to use gas price for faster transaction in erc20 transafer event?

I'm trying to provide a customised gas price for faster transaction ,how can achieve that ? Web3j web3 = Web3j.build(new HttpService("http://")); ERC20 javaToken = ERC20.load(contractAddress,...
0
votes
1answer
99 views

Not able to generate java wrapper class from solidity smart contract using truffle

I'm trying to generate java wrapper class of solidity smart contract using truffle but not getting wrapperclass.java file Here is an command which i've used to generate abi/Json of that contract ...
0
votes
1answer
112 views

How to create a wallet file for existing account&

I found this way of creating a new ethereum account with web3j. But what if I want to create a wallet file for an already registered account? I need this because most of the web3j functions require a ...
0
votes
2answers
49 views

How to find out if a wallet (an address) contains a token from a contract using web3js?

Is this possible with and without knowing the private key of the wallet.
0
votes
1answer
91 views

Transaction no confirmed and JUnit test assert fail

I have some JUnit test that assert some values returned from the blockchain deployed smart-contract. But the assert return me a error because the assertEqual call is done when the transaction has not ...
0
votes
1answer
208 views

Error generating new account with Web3j

Im using the Web3j library to make transactions with my blockchain (Ganache). I have a method that instantiate a Web3j object and im trying to generate a new account with the given String url = "...
0
votes
1answer
400 views

ethLogFlowable: how to get event args?

I am using ethLogFlowable to subscribe to an event and read the args of the event, in my case an address and a uint256 value. I have followed this answer stackExchangeLink, but I am always getting ...
0
votes
2answers
167 views

transactionHash returned null sometimes when trying to transfer funds using web3j (random behaviour)

I am transferring funds using web3j. However, I was getting transactionHash as null. I checked various posts and found that this issue exist when gas price or gas is bad. I increased both the values, ...
0
votes
1answer
596 views

java.lang.ClassCastException: org.bouncycastle to error while creating wallet using web3j

I am using web3j to create account. String walletFileName = WalletUtils.generateFullNewWalletFile(" <password>",new File("some/path")); But getting this error: java.lang.ClassCastException: ...
0
votes
1answer
1k 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 ...
0
votes
1answer
284 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
500 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
1answer
672 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 2 3
4
5
7