Questions tagged [web3j]

Lightweight Java and Android library for integration with Ethereum clients

Filter by
Sorted by
Tagged with
0
votes
1answer
24 views

While importing web3.py getting following error: TypeError: 'ellipsis' object is not iterable [closed]

Python version : 3.5.2. web3 version : 4.9.2. Ubuntu : 16.04. Also tried previous version of web3: 4.0.0
1
vote
0answers
26 views

Web3J - how to perform two identical transactions in a row?

I have a contract being an ERC-20 token. I want to perform two idendical transfers (sender, receiver and amounts are the same). I am using the contract objects from Web3j: MyToken token = MyToken....
0
votes
0answers
28 views

Send ERC-20 token using Web3j

What is the best way to get balance and send ERC-20 token using web3j?
1
vote
1answer
18 views

How to get events on android with infura?

I am developing an app on Android, but Web3j does not support events on infura ( Should I use Infura with Web3j for Event filter? ) . What are the options, I did not find any alternative library?
0
votes
0answers
110 views

how to integrate USDT erc20 token to make transfer and check balanceof?

I want to integrate USDT token to make transfer and check balance of USDT in my java with the use of web3j, how can i accomplish this? i able to create wallet and use of ethereum, but i dont know how ...
1
vote
0answers
39 views

How to achieve inheritance support using web3j wrapper?

I have two types of smart contracts. One parent contract to store the type and other child contracts which inherits the parent contract. The problem is, I can't generate java wrapper class (...
0
votes
0answers
29 views

How to use web3j to check the balance of an ERC20 custom Token and transfer the token to another wallet?

I'm studying to create wallets using infura, web3j, and android studio. I am using ropsten testnet. I have been able to check the amount of ethereum in my wallet and send ethereum to another account. ...
0
votes
0answers
28 views

Generated code using web3j contains errors

This is the smart contract pragma solidity ^0.5.0; pragma experimental ABIEncoderV2; import "./sharedLib.sol"; import "./clientSC.sol"; import "./projetSC.sol"; contract ...
0
votes
0answers
23 views

How to send Extra data with smart contact transaction on geth server which data I will get after mining?

I have created smart contract in solidity using Remix IDE. I am doing smart contract transaction using geth server and it is working fine. But I want to send some keys (data) on geth server with ...
1
vote
2answers
85 views

How to create a RawTransaction for contract interaction Web3j

I want to sign a transaction that calls a smart contract function and send it to the Rinkeby network. I found on Web3j documentation the RawTransaction class that supports the methods for the ...
0
votes
0answers
21 views

How does remix decode a contract response without the ABI?

Remix seems to be able to decode the output of a contract to a block of JSON without having the ABI (say I just specify the contract address). How is this achieved - I'm interested in doing something ...
0
votes
0answers
18 views

web3j - getter for array of addresses

I have a contract which has a field registry which is an array of addresses, Also have a getter for this field: function getRegistry() view public returns (address[] memory){ return ...
0
votes
0answers
56 views

getWeb3ClientVersion() returns null

I'm trying to create an android Dapp by using the web3j library. I'm using connection to a local private Ethereum blockchain. When I'm trying to display the Client version it returns null. This is the ...
1
vote
1answer
24 views

Using contract to create Child contracts (web3j Java wrapper)

I have a simple Parent contract that creates child contracts and stores their address. contract Parent { address[] public registry; function createChild () public { address newChild =...
0
votes
0answers
51 views

SocketTimeoutException timeout In Java Web3j

Im developing some test in a little project with Web3j. I have a little for that loop generating new accounts. Doing single request works fine. The issue appear when I try to make more than X ...
0
votes
0answers
15 views

Geth node from private network freezes and Web3j fails with timeout

I have a private network, and something very weird happens when I try to start the mining via RPC: the node just simply freezes. I attached using geth.ipc and even when I tried to start the miner via ...
0
votes
0answers
15 views

JVM waits for some timeout every time when I load a Smart Contract using Web3j In Java

Initially I had a problem with the Web3j object, but after explicitly calling its shutdown method everything works fine (JVM quits immediately, so my application closes). The problem occurs when I ...
0
votes
0answers
74 views

Why does the error Invalid response received: 403;?

Develop a java project to connect to ethereum blockchain and until now no error has been presented, but now this error appeared:   org.web3j.protocol.exceptions.ClientConnectionException: Invalid ...
1
vote
0answers
36 views

Using web3j with infura returns null

I've used web3.js to handle my contracts, and it worked very well. But web3j is pretty hard for me since the beginning. I'm using android studio, infura, web3j. Since I don't know very much about ...
0
votes
1answer
35 views

How do we communicate with contract functionality which is deployed in public test network using web3j [closed]

I would like to write a wepapp for security token contract which is deployed in public Ropsten Test Network using web3j. Need some idea. Thanks in Advance
0
votes
1answer
92 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 ...
1
vote
0answers
37 views

Extra mining fees added in etherbase account

1st scenario - I have set miner.setEtherbase(eth.accounts[1]) and gasPrize is 0. 1 coin Transaction - And done transaction from 0th account to one random account. I expect 0 mining fees will add ...
1
vote
1answer
43 views

Can I send data (e.g. text) in a Transaction with Web3J?

I need to send a transaction from an account to another one via Web3J that includes not only the value field but also the data field (in particular, I need to send text). Is it possible?
0
votes
1answer
63 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 ...
1
vote
0answers
28 views

Trouble with personalUnlockAccount,web3j

I am creating android dapp for votings I am trying to check if user's credentials are right,so i use object of PersonalUnlockAccount class and function accountUnlocked().So the problem is that when i ...
0
votes
1answer
47 views

org.web3j.protocol.exceptions.TransactionException: Transaction receipt was not generated after 600 seconds for transaction

I am sending a transaction through this code public String transferEthByPk(String amount, String toAddress, String privateKey, Web3j web3j) { BigDecimal value = new BigDecimal(amount); ...
0
votes
0answers
16 views

Java class generated with web3j has a “deploy” method wherein initialWeiValue, initialSupply have to be both specified. Isn't it the same amount?

Method in the java class generated by web3j is like this: public static RemoteCall<Crowdfunding> deploy(Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit, ...
0
votes
0answers
13 views

Read contract value from Android

I have deployed successfully a smartcontract onto Rinkeby at the address : 0x69cfa9009Bf2c7a9945a4f8b381db21b26b662d7 It is a tutorial smartcontract that enables an election between 2 candidate. I ...
0
votes
0answers
70 views

Get Array from a call in Web3j

I have a solidity function that returns an array. I'm trying to read the values inside this array from web3j but it gives me stage results. My solidity function function getAllSubTokenByTokenID(...
0
votes
2answers
27 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
0answers
35 views

How to set an array of struct in the function param

this is the function : function setListObjects(ContractObject[] memory ContractObjects)public{ delete objects; ContractObject memory newObject; for (uint i = 0; i < ContractObjects....
0
votes
1answer
51 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
0answers
102 views

Web3J Websocket Connection Closes

While using Web3j websocket connection faced connection closed issue. After some time the connection was established and served few requests abruptly the connection closes. Request you to share the ...
1
vote
1answer
104 views

Quorum deploy with Web3j timeout

SCENARIO: I have the following code: final String hostUrl = this.deployerProperties.getProperty("quorum.host.url"); final String hostPort = this.deployerProperties.getProperty("quorum.host.port"); ...
0
votes
1answer
40 views

Could someone explain to me the use of the FastRawTransactionManager class?

int pollingInterval = 3000; FastRawTransactionManager fastRawTxMgr = new FastRawTransactionManager(web3j, credentials, new PollingTransactionReceiptProcessor(web3j, pollingInterval, 40)); From what I ...
0
votes
0answers
139 views

Transaction receipt was not generated after 600 seconds for transaction:

I am sending a transaction through this code: txhash = careercertificate .createCertificate(id, fecha, nombre, rutalumno, instituto, rutinstituto, titulo, totalhash, ...
1
vote
1answer
48 views

Sending private key to server side

I am trying to build new Dapp application for our startup by using web3j , I am facing an issue with signing the transaction from server side , because i need to know the private key for the client (...
1
vote
1answer
241 views

Empty value (0x) returned from contract web3j

I'm trying to deploy a very simple contract on Windows 10, using Web3j 4.2.0. I've created an account using Mist. I've set up one local ethereum node (using geth) on my machine and I'm able to deploy ...
0
votes
1answer
113 views

Load smart contracts in Java application without having the java wrapper class for Web3j (only the address of the contract)

I use web3j to interact with my local Ethereum node (created with geth), and I was wondering how should I handle smart contracts created at runtime. I know that in order to deploy a smart contract ...
0
votes
0answers
24 views

Send ether from one wallet to another

I have two metamask accounts and what I want to do is send ether between those accounts. For the interaction between those accounts, use infura, I give the address of both accounts but in the end the ...
2
votes
2answers
299 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 ...
0
votes
0answers
49 views

Invalid OPCode on passing address parameter through Java wrapper on smart contract using Ganache

I have been facing this issue for some time and I realized there must be a problem with Ganache or maybe someone has any idea why it doesn't work. I have created a very simple contract as below, it ...
1
vote
2answers
163 views

Offline transaction signing with web3j?

I'd like to generate and sign a transaction offline and then send that transaction with a different account. I've found a few web3js sources and I've read the web3 documentation, but I haven't found ...
0
votes
2answers
180 views

What's problem about “gas required exceeds allowance or always failing transaction”

I translate smart contract into Java with solc and web3j, but I meet the probelm "gas required exceeds allowance or always failing transaction". This is my smart contract. It is work when I use ...
1
vote
1answer
30 views

Is it worthwhile to store my supply chain product data on the blockchain using a smart contract? [closed]

I'm currently developing an android app that uses the Web3j framework (Java) to interact with my private Ethereum blockchain (running on Ganache). The app is a supply chain tool that will let users ...
0
votes
2answers
113 views

Unable to make a transaction with Data using Java api ethSendRawTransaction

I am trying to make a transaction between two different accounts using Java. It works perfectly fine as long as I am not using "Data" parameter. My intent is not to call a smart contract but to make ...
0
votes
0answers
148 views

web3j.ethCall returns null when retrieven contract variable

Environment: Geth node Geth/v1.9.0-unstable/windows-amd64/go1.12 Commands used to start the node to mine: geth --datadir "." --networkid 101 -verbosity 6 --port 30301 --rpcport 8101 --nodiscover -...
0
votes
0answers
36 views

ERC-20 TransferFrom function exceeds GasLimit calling from other conract

I have the following error. Imagine that I have contract A, B(ERC20 implementation contract), C, D and E. They are inherit in that order. Testing the functionallity works fine in remix. But when I try ...
0
votes
0answers
18 views

Catching FilterException web3j

I'm using web3j to subscribe for transactions: Flowable<Transaction> observable = web3.replayPastAndFutureTransactionsFlowable(startBlockParameter); Scheduler ...
1
vote
2answers
146 views

Get function returned 2 values in Web3j

I wrapped a smart-contract generated in remix into a Java Project. Im trying to get the two values that return me this function. function getValues(address _a) external returns(bool, uint32) { ...