Questions tagged [web3j]

Lightweight Java and Android library for integration with Ethereum clients

Filter by
Sorted by
Tagged with
0
votes
2answers
515 views

Deploying and interacting contract with Azure consortium blockchain with their transaction receipt not returning from blockchain

I am using Web3j to deploy and interact with a contract on Azure consortium blockchain. Connecting to Azure consortium blockchain RPC endpoint Web3j web3 = Web3j.build(new HttpService("http://***....
0
votes
1answer
2k views

Transfer of Ether from one party to another

I'm trying to transfer ETH from one account to another using web3j and a java program using following code. public void transfer (String from, String to, BigInteger amount) throws ...
0
votes
0answers
11 views

Contract is not deploying properly on Geth private network using web3j SDK

I am new to Ethereum. I have created private blockchain using Geth on my local and trying to deploy my smart contract using java web3j SDK. I am able to deploy my contract using java and getting ...
0
votes
0answers
16 views

call array params in web3j

I want to call contract method like this: function airdrop(address source, address[] dests, uint[] values) how can i sendTransaction in web3j by java? i sign like this: Function function = new ...
0
votes
1answer
31 views

Unable to invoke smart contract function from Web3j contract wrapper

I've been learning about interacting with smart contracts through Android and the Web3j framework but have run into an issue. I'm trying to mint an ERC721 token and send it to an address but it doesn'...
0
votes
0answers
13 views

Web3J Java Android SendAsync Error

I am trying to interact with a method in my smart contract. The method is a simple method where you send a string value to a global variable. I end up using a SendAsync which appears to initially work,...
0
votes
1answer
50 views

Installing Web3 stuck on fetchMetadata: sill resolveWithNewModule http-https@1.0

I am trying to install web3 for ethereum but it keeps sticking on this fetchMetadata
0
votes
1answer
68 views

How estimate GAS from a contract call with Web3j

I'm trying to estimate gas cost of a contract call, i need to send a string to a contract, but i need to see if i overtook the GAS limit. I'm trying like this: Transaction t = Transaction....
0
votes
1answer
47 views

Listen to Ethereum transactions

I need to listen ethereum transactions for current count of addresses using web3j. I know that I can use subscribe to get transactions, but how can I add some filter to listen a certain number of ...
0
votes
0answers
51 views

Send ERC-20 token using Web3j

What is the best way to get balance and send ERC-20 token using web3j?
0
votes
0answers
242 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 ...
0
votes
1answer
70 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
47 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
28 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 ...
0
votes
0answers
26 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
34 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
1answer
65 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 ...
0
votes
0answers
150 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
22 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
23 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
184 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 ...
0
votes
1answer
39 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
72 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
19 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
20 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
126 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
0answers
45 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
0answers
173 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 ...
0
votes
1answer
61 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
237 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, ...
0
votes
1answer
245 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
36 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 ...
0
votes
0answers
62 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 ...
0
votes
2answers
268 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 ...
0
votes
2answers
162 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
65 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
44 views

Catching FilterException web3j

I'm using web3j to subscribe for transactions: Flowable<Transaction> observable = web3.replayPastAndFutureTransactionsFlowable(startBlockParameter); Scheduler ...
0
votes
1answer
117 views

how to find if a Tx hash is in pending state in ethereum mainnet after web3j fastTxMgr timeout

I am using QueuingTransactionReceiptProcessor() with callback accept(). DEFAULT_POLLING_ATTEMPTS_PER_TX_HASH is 10 and POLLING_FREQUENCY is 15000. That gives nearly 3 min wait for network to ...
0
votes
0answers
80 views

Build web3j to connect to blockchain [duplicate]

Can't connect to the Ethereum blockchain with web3j 4 for Android Kotlin. Worked in the previous version of web3j. fun web3(): Web3j = Web3jFactory.build(HttpService("http://192.168.38.148:7545")) ...
0
votes
1answer
254 views

Quorum node address

In the Node class of the Quorum Web3j. The String address what is? package org.web3j.quorum; import java.util.List; /** * Quorum node configuration class. */ public class Node { private final ...
0
votes
0answers
193 views

Error: replacement transaction underpriced web 3j

I am registering a batch of 500 transactions in a java application with web3j and after a while it gives me this error: java.lang.RuntimeException: Error processing transaction request: replacement ...
0
votes
1answer
174 views

Calling a contract's function with input parameters and passing ether from Geth/Web3

I have deployed a smart contract which basically splits the incoming funds to the specified addresses based on the entered ratio parameter. Please find the code below: pragma solidity ^0.4.23; ...
0
votes
0answers
393 views

Quorum & web3j: Transaction has failed with status: 0x0. Gas used: 0. (not-enough gas?)

I'm doing some play & test with Quorum. I'm using example 7nodes with docker. The network is up and my simple smart contract is deployed with a set and a get function. When I call the set function ...
0
votes
0answers
188 views

Can anyone help me to access my eth account in metamask using infura in android

My question is about accessing my eth account in metamask using infura in android
0
votes
1answer
285 views

How to Serialize/Deserialize array of bytes?

I'm writing a smart contract and inevitably need to have arrays of bytes as input and output of functions. In remix arrays work just fine but with web3j and web3js there are several issues with arrays ...
0
votes
0answers
39 views

How to do decoding with web3j?

I am looking for how to decode the input data of a transaction and what I have obtained up to now is in utf-8 and it gives me this data: "Ã;` Q ò  à                          ...
0
votes
1answer
99 views

How does Ethereum Smart Contract work on Mobile Client

I want to deploy a smart contract on server and interact with it using mobile client. I'm not familiar with how does that work but after some research, I found something like below: If we compare ...
0
votes
2answers
763 views

How to install web3j command line to generate smart contract wrapper

I am trying to generate a simple smart contract wrapper using solc and web3j in ubuntu. I have downloaded the source as defined in https://docs.web3j.io/command_line.html Release package can be ...
0
votes
1answer
507 views

how to deploy a smart contract in ethereum using web3j

i am following this tutorial tutorial under the section Working with smart contracts with Java smart contract wrappers i followed the same steps but i am getting RunTimeException here is the full ...
0
votes
3answers
63 views

Transfer ETH using third party

I want to transfer ETH from an individual address to another address. So is there any API provider who can send ETH from single Address to another address. Also If I setup Web3 in windows machine ...