Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [java]

Java is a general-purpose computer programming language that is concurrent, class-based, object-oriented, and specifically designed to have as few implementation dependencies as possible.

13
votes
3answers
3k views

How to experiment with Ethereum without downloading the entire blockchain?

I want to experiment with Ethereum without having to download the entire blockchain. My ISP limits my bandwidth to 50GB and downloading the ETH chain would consume a lot of that, not to mention the ...
10
votes
5answers
8k views

Can I write and deploy smart contracts in Java language?

I am a Java developer. I want to write a smart contract using Java and deploy it to a private blockchain network. Does Ethereum provide the facility to write smart contracts using Java language? If ...
6
votes
1answer
203 views

Is the EVM operand stack size (at any instruction) independent of the execution path?

I'm trying to analyze some EVM bytecode, comparing it with Java bytecode. The Java specification states the following in the JVM specification §4.9.2. Structural Constraints: If an instruction can ...
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 ...
4
votes
3answers
1k views

Does EthereumJ (Java implementation of Ethereum) support JSON RPC API?

Looking at their github repository and searching through the source code, I could not find JSON RPC API, except the one for Whisper. Perhaps I did not look hard enough?
4
votes
2answers
81 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
359 views

Deploying a contract on private Ethereum network Harmony

I just started on ethereum and I created a private ethereum network on harmony and we were able to syn up to other peers using the same router . Question would like to ask is how do u deploy the ...
4
votes
2answers
2k views

Generating Ethereum Private Key,Public Key On Mobile (Android/Java)

I'm looking for a way to generate Ethereum private keys and public keys inside an Android app. I've scavenged the web and ultimately decided to tear apart the code to myetherwallet and import the same ...
4
votes
1answer
679 views

How to sign transaction for calling sendRawTransaction JSON RPC method?

I have a private ethereum network and a java process with communicates with a ethereum node with JSON RPC. I need to add a transaction from java process by calling the sendRawTransaction RPC method. ...
3
votes
1answer
2k 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....
3
votes
1answer
1k 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
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&...
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
1answer
632 views

Java Client for Ethereum Contract [closed]

I am trying to create an Ethereum Contract, through my java application, has anyone done this before? how do you pass the JASONRPC command via java method I am using TESTRPC
3
votes
1answer
239 views

Iterating through the ethereum blockchain using Java

I am trying to iterate through the LevelDB in ethereum to see what data is stored in the blockchain. I have loaded the database and created in itr using Dain's LevelDB api, but I am having trouble ...
3
votes
2answers
1k 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
0answers
244 views

How to do batch transaction in Ethereum using web3j

I want to do batch transaction using the web3j,So how can I do it? Is there any way or feature web3J provides
2
votes
1answer
581 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
2k 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
2answers
40 views

How to get biggest holders for specific token?

I am trying to get a descending list of biggest token holders like is displayed on etherscan. I could not locate an api to do this. I looked at EtherScan and EthPlorers api but did not see anything ...
2
votes
1answer
2k views

How to decode input data with ABI using java?

There is a tool on npm ethereum-input-data-decoder. And yes, i can read input data as hex byte[] bytes = Hex.decodeHex(transactionReceipt.getInput().substring(2).toCharArray()); System.out.println(...
2
votes
1answer
44 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; ...
2
votes
2answers
644 views

Out Of Memory exception when using web3j in Android

I'm trying to integrate web3j in an android application. But the library gives an Out Of Memory exception when loading the wallet file: Credentials credentials = WalletUtils.loadCredentials("password"...
2
votes
0answers
168 views

JsonParseException while generating java wrapper object with web3j

so a few weeks ago I created a java wrapper object with web3j for a smart contract and was able to work with it with no problems. following exactly what I did a few weeks ago I keep getting a ...
2
votes
2answers
965 views

Ethereum HD wallet library for Java

Is there any Ethereum HD wallet java library? I find a popular java library on Github, web3j, which doesn't support HD wallet yet.
1
vote
5answers
700 views

How to invoke functions of Smart Contract from Android phone?

I deployed a smart contract with solidity along with a GUI by Javascript and HTML. This project works well on my computer. Now I want to invoke functions of Smart Contract from Android phone. Is ...
1
vote
1answer
3k views

Generate private key and address using web3j

How can i generate private key and address using web3j instead of creating keystore json file
1
vote
2answers
546 views

Get input data from specific transaction

I have a contract. I store data in ethereum using contract. Is it possible, to work with contract in git-like way. For example, i have a list of previous transaction hashes. Can i fetch data from any ...
1
vote
1answer
431 views

is there a java library to access or respond to an ethereum contract events?

We are building a java backend that is expected to interact with an ethereum node. So far I have only seen and tried web3.js api but it seems difficult to run it from java code. Is there a way to ...
1
vote
1answer
35 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....
1
vote
2answers
390 views

Deriving the v value from an ECDSA signature without web3j

I am currently signing with a the ECDSASignature spec in java however I noticed that getting a v value from the signature is a custom spec for ethereum. My code: public static void main(String[] ...
1
vote
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 ...
1
vote
1answer
13 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 ...
1
vote
1answer
26 views

Get the input data of a transaction with web3j

How can I retrieve transaction details (including the input data) from a txHash using Web3j? I tried the following method: public void buscarHhash(Web3j web3, String txHash) throws IOException { ...
1
vote
1answer
21 views

How to get the txHash of a transaction?

I have this method where I make a transaction to the network rinkeby, but to know how I can get the hash of the transaction made. I am using java with web3j, in addition to using infura to connect to ...
1
vote
1answer
31 views

Web3j and Transaction with null receiver

I am trying to get the list of all transactions using the method web3j.catchUpToLatestAndSubscribeToNewTransactionsObservable but a lot of them have a null receiver (Transaction.to). Using etherscan....
1
vote
2answers
1k views

How to make transaction using private key and address using web3j

I have a private key and address . Is it possible to make transaction with these parameter using web3j.
1
vote
1answer
424 views

Error when calling a function of a smart contract with web3j

I am trying to use a function which returns a value of the smart contract (pakoin). contract Pacoin { /* This creates an array with all balances */ mapping (address => uint256) public ...
1
vote
1answer
427 views

how to represent “\x19Ethereum Signed Message:\n32” as java string?

How can I represent the this string "\x19Ethereum Signed Message:\n32" in java? The first character seems the length of 'Ethereum Signed Message:\n' string but it is escaped. What I'm trying to do is ...
1
vote
1answer
640 views

Web3j client is not detecting any transaction or blockchain from geth

I am using web3j to listen to transactions and blockchains through geth. It seems that none of the subscriptions that I have created to the blockchain or transaction are detecting changes. I start ...
1
vote
0answers
44 views

[RuntimeException: java.lang.NoSuchMethodException: SmartContract using web3j

I am following this tutorial for deployment of contract https://www.youtube.com/watch?v=ibAh04Csp0M&index=33&list=PL16WqdAj66SCOdL6XIFbke-XQg2GW_Avg but i am getting [RuntimeException: java....
1
vote
0answers
21 views

How to write a mock method for getting ether balance using Web3j Api. I am trying to mock Web3j and callig EthGetBalance method but I am getting Null

public static BigInteger OriginalMethod(){ // connect to node Web3j web3 = Web3j.build(new HttpService()); // defaults to http://localhost:8545/ // send asynchronous requests to get balance ...
1
vote
1answer
61 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: @...
1
vote
0answers
17 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
110 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
1answer
188 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
1answer
274 views

IPFS Android Cant add file

I am using the java-ipfs-api - https://www.npmjs.com/package/geth-private for my android DApp. I have managed to connect to the ipfs daemon and have tested it using the ipfs.refs.local(); command as ...
1
vote
0answers
163 views

How to convert Ethereumj byte arrays to Strings?

Ethereumj gives a lot of byte arrays, when the equivalent would be a string in Bitcoin. A few examples (in Scala) ECKey.getAddress // returns Array[Byte], need String Transaction.getHash // returns ...
1
vote
0answers
217 views

How to create an account from a Spring MVC project

I am working on Ethereum blockchian. I have create a login page using Spring MVC 4 and it is connected to MySQL DB. Now I want to assign coinbase to the successful registration of the user. My Idea ::...
1
vote
2answers
41 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] }) ...