Skip to main content
69 votes
Accepted

Truffle Migrate doesn't work: Error: No network specified. Cannot determine current network

Make sure that you have configured your network in truffle.js. It should look something like this for the setup mentioned above: module.exports = { networks: { development: { ...
user1491307's user avatar
  • 1,221
29 votes

'authentication needed: password or unlock' Error when trying to call smart contract method via web3

First, make sure you have an account. web3.personal.listAccounts If you get [] ... web3.personal.newAccount() Try again. Then ... web3.personal.unlockAccount(web3.personal.listAccounts[0],"&...
Rob Hitchens's user avatar
  • 55.4k
16 votes
Accepted

LevelDB in Geth, key and values

Let's start with having a look at what we get in geth console for block number 40. Now let's consider a Go program. I Explained everything in code comments about how it is constructing keys and ...
Vishal Sharma's user avatar
13 votes

Truffle Migrate doesn't work: Error: No network specified. Cannot determine current network

I had the same problem with truffle 4.0.1. After some investigation and advise from the truffle team I figured out that truffle 4.0.x has a new option. If you run truffle develop you don't need ...
Bumblebee's user avatar
  • 1,761
12 votes

Event on Mining of a new block

Using e.g. the web3 JS API, you could setup a filter and watch block changes: var filter = web3.eth.filter('latest'); filter.watch(function(error, result){ var block = web3.eth.getBlock(result, ...
tomconte's user avatar
  • 221
11 votes

How to get values returned by non constant transaction functions?

You need to use an Event, see example: contract answer{ // ... event VoteEvent(string ID, bool returnValue); function vote(string ID, uint qNum, uint ans) returns (bool) { // ... ...
eth's user avatar
  • 86k
9 votes
Accepted

How to get address from private key in java

Summary The code in the question theoretically should not run, as the private key is in hex format and the call to new BigInteger(senderPrivKey) to parse the hex string without the 16 radix specified ...
BokkyPooBah's user avatar
  • 40.3k
8 votes
Accepted

Convert String to Bytes32 in web3j?

SOLVED!!! LONG/Detailed METHOD!!! (Shorter Version at bottom) The main problem was Bytes32(byte[]) only supports 32 length byte[]. Also keep in mind Numeric.hexStringToByteArray(strValueInHex) ...
wannamit's user avatar
  • 151
7 votes
Accepted

how to call "selfdestruct" if not written in contract, as documentation says its possible

If your contract has a function to run delegatecall with some way to provide the function to call, you can in make it run a function in another contract, which calls selfdestruct. Since functions ran ...
Morten's user avatar
  • 6,027
6 votes
Accepted

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

Currently EthereumJ has no JSON-RPC support, however we are planning to implement this in a nearest future as a separate project which also will include Web3 JS console
Anton Nashatyrev's user avatar
6 votes
Accepted

How to get public key from private key in Web3j

Yes, you can do it using following code import org.web3j.crypto.Credentials; import org.web3j.crypto.ECKeyPair; public static String getPublicKeyInHex(String privateKeyInHex) { BigInteger ...
pyang's user avatar
  • 381
5 votes
Accepted

How to create an Ethereum mining pool.

Full instructions and software is available at https://github.com/sammy007/open-ethereum-pool
BokkyPooBah's user avatar
  • 40.3k
5 votes
Accepted

How to get all ethereum address list which have my token?

Do it using your Transfer event in your contract. var myEvent = contract.Transfer({},{fromBlock: 0, toBlock: 'latest'}); myEvent.get((error, result) => { console.log(result);...
Crissi Mariam Robert's user avatar
5 votes

How to get public key from private key in Web3j

I posted my own answer here in case someone else has the question. Web3j provides a ECKeyPair as util to process key and address conversion. Please see codes below: String privateKey = "{your ...
Frank Kong's user avatar
4 votes
Accepted

How to create an account in ethereumj

Firstly you will need the following Maven pom.xml dependency: <dependency> <groupId>org.ethereum</groupId> <artifactId>ethereumj-core</artifactId> ...
BokkyPooBah's user avatar
  • 40.3k
4 votes

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

02/04/2016 I had a better look and no, there is no JSON-RPC API service. 07/04/2016 - The new changes to be merged that was referred to by @Oscar Guindzberg at https://github.com/ethereum/ethereumj/...
BokkyPooBah's user avatar
  • 40.3k
4 votes

How to initialized struct with member variable type mapping

Because s2 is a struct being instantiated in the function rather than the contract, solidity will make it a storage member of the contract itself. This is unlike other primitive types which default ...
o0ragman0o's user avatar
  • 4,330
4 votes
Accepted

How to find out the value using call() method in truffle and testrpc?

You've got the right idea with checking balances for one address at a time and using promises. The square brackets are weird here. Looks like you're adapting array style but this is a function call ...
Rob Hitchens's user avatar
  • 55.4k
4 votes

Why downloading the Blockchain with GETH --fast is still very slow

Try geth --light Light Sync: Gets only the current state. To verify elements, needs to ask to full (archive) nodes for the corresponding tree leave. You may take a look at this
Federico Capello's user avatar
4 votes
Accepted

Is there a way to know the contract creation Address from a the transaction?

Ok, I actually found the answer my self sadly things are not updated in the documentation at least so far, however, there is a creates field in every transaction. So when you, for example, do ...
Moe Elsharif's user avatar
4 votes

Is there a way to know the contract creation Address from a the transaction?

@Nulik has the answer that is the clearest. The only caveat is the actual command is eth.getTransactionReceipt(hash).contractAddress If you are using Web3, use web3.eth.getTransactionReceipt(hash)....
Daniel Connelly's user avatar
4 votes
Accepted

How to generate deterministic keypairs using ed25519

you can use function: nacl.sign.keyPair.fromSeed(seed) For generating random seed, use npm package bip39 https://github.com/bitcoinjs/bip39 Usage: // Generate a random mnemonic (12 words) (uses ...
kherwa's user avatar
  • 724
4 votes
Accepted

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

That worked for me: while (true) { EthGetTransactionReceipt transactionReceipt = web3j .ethGetTransactionReceipt(transactionHash) .send(); if (transactionReceipt.getResult() ...
Majd TL's user avatar
  • 3,237
4 votes

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

Web3j have two implementations of org.web3j.tx.response.TransactionReceiptProcessor: PollingTransactionReceiptProcessor and QueuingTransactionReceiptProcessor Example: TransactionReceiptProcessor ...
Mike Shauneu's user avatar
3 votes

how to connect ethereumj with private node

Here is some sample code to connect ethereumj to a testnet from github - ethereumj-core/.../samples/TestNetSample.java: private final String config = // network has no discovery, ...
BokkyPooBah's user avatar
  • 40.3k
3 votes

Possible to create Dapp using EthereumJ?

You could probably do this, but it's unlikely to be the best approach. All three main clients expose a set of APIs via JSON-RPC; this is what web3 apps call. Instead of integrating directly with a ...
Nick Johnson's user avatar
  • 8,174
3 votes

Using eth_newFilter

The topic is used for filtering on indexed parameters in events/logs. If you have looked at Solidity (the most popular language for writing smart contracts in Ethereum), you can write events with the ...
bozzle's user avatar
  • 896
3 votes

How to transfer ether from one account to another using EthereumJ

Check any sample from samples source directory how to deal with Transactions, for example, this one: CreateContractSample.java, Your transaction call should be something like this: // Amount in ...
Dmitry's user avatar
  • 31
3 votes

Event tracking and decoding from ethereumj

In order to parse the information in the LogInfo you will need the contract ABI. Once you have the ABI it's easy to parse : @Override public void onTransactionExecuted(TransactionExecutionSummary ...
ohad serfaty's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible