All Questions
Tagged with cpp-ethereum or go-ethereum
789 questions
96
votes
12
answers
51k
views
Common useful JavaScript snippets for geth
In Geth you can loadscript any javascript file.
I discovered this one on the wiki which I like a lot:
function checkAllBalances() {
var i =0;
eth.accounts.forEach( function(e){
console.log(&...
24
votes
2
answers
8k
views
Why is my ether balance 0 in geth, even though the sync is nearly complete?
My geth --fast sync is nearly complete, and the balance shows correctly on Etherscan.
I was running geth on linux and haven't synced in a while, so I deleted the chaindata and updated the wallet and ...
64
votes
7
answers
214k
views
How to import a plain private key into geth or Mist?
This is such a basic question, but I can not figure out how to import a plain, unencrypted private key into geth or mist?
I tried geth account import 7[......]bla but it seems this command is always ...
62
votes
5
answers
94k
views
How can I get a geth node to download the blockchain quickly?
I'm running a geth node on slow hardware. At the current rate of progress it could be several days before I can download all the blockchain. Is there a way to get it to synchronise more quickly?
18
votes
3
answers
3k
views
How to get values returned by non constant transaction functions?
As per my understanding when I invoke a constant function without a transaction in a contract and if the function returns some result I am able to get it in EthereumJ or Go-Ethereum, But when a ...
111
votes
4
answers
111k
views
What is Geth's "fast" sync, and why is it faster?
One of the answers to this question suggested using Geth's --fast flag to help quickly synchronise the block data.
How does the flag work, and how does using it speed up the synchronisation? Are we ...
28
votes
2
answers
56k
views
Why is my node synchronization stuck/extremely slow at block 2,306,843?
Using macOS 10.12.1 with Ethereum Wallet 0.8.7, nodes are connected but Sync doesn't even start. Stuck at block 2,306,843.
What can I do? Please keep in mind, I am neither a coder nor a tech geek.
20
votes
2
answers
7k
views
Deploying the Greeter contract via the geth CLI is not registering in my private blockchain
I am running a local private Ethereum blockchain using:
geth --networkid 60098 --genesis CustomGenesis.json --nodiscover --maxpeers 0 --rpc --rpccorsdomain "http://localhost:3000" --datadir "./data" ...
60
votes
1
answer
63k
views
What is Geth's "light" sync, and why is it so fast?
This question is in a similar vein to the past questions about geth --fast and parity --warp.
There was a recent question where the OP wanted to do as little syncing as possible, and one of the ...
29
votes
3
answers
22k
views
How can I make new account by JSON-RPC?
I'd like to make new account by JSON-RPC.I've checked the wiki of Ethereum, however I could not find out how to do that.
I've found call existed accounts, but it isn't what I want.
eth_accounts
...
57
votes
4
answers
56k
views
How to call a contract method using the eth_call JSON-RPC API
Ok, so I'm trying to call a contract method using the methods provided by the Ethereum JSON RPC interface. The JSON RPC is running on an Ubuntu machine. Unfortunately, I can't really get a result back ...
59
votes
5
answers
49k
views
How to select a network id or is there a list of network ids?
We're starting a new open network based on the Ethereum protocol. The question is how to allocate a network id for the new network. In Ethereum we have main net, four test networks, classic with test ...
76
votes
2
answers
40k
views
What does each genesis.json parameter mean?
I'm trying to setup genesis.json for my private network. What does each parameter mean and what value can I set in genesis.json?
nonce: any data?
timestamp: any time?
parentHash: any hash?
extraData: ...
56
votes
3
answers
25k
views
How to reduce the chances of your Ethereum wallet getting hacked?
Summary
The hack that occurred on May 12 2016 to steal 7,218 ethers from Patrick only affects miners where:
Incoming RPC connections from the Internet on TCP port 8545 are forwarded to the machine ...
34
votes
6
answers
28k
views
ecrecover from Geth and web3.eth.sign
I have tried to use ecrecover() to verify the signature of a message.
I have looked at lots of references here and elsewhere, like:
https://lab-blog.ey.com/2016/12/19/ecrecover/
How does one ...
12
votes
1
answer
6k
views
Peer discovery not working on private network
I'm running 3 nodes with the following command:
geth --verbosity 4 --autodag --nat any --genesis /opt/blockchain/genesis.json \
--datadir /opt/blockchain/data --networkid 4828 --port 30303 --rpc ...
30
votes
6
answers
13k
views
How to make miner to mine only when there are Pending Transactions?
As of now the geth miner running on my system mines even empty blocks.
All i wanted is miner should mine only when there are Transactions to mine, after mining the miner should immediately sleep.
...
15
votes
2
answers
6k
views
How to conditionally send ethers to another account post-hard-fork to protect yourself from replay attacks
The DAO contract was attacked on 17th June 2016 where the attacker drained about USD 50 million worth of ethers using a recursive call vulnerability in The DAO contract code.
The attacker drained ...
10
votes
2
answers
2k
views
Unable to define greeterContract in the Greeter tutorial. Breaking change in Solidity 0.4.9!
I was following the Greeter tutorial on Go Ethereum wiki and got stuck on the "var greeterContract = web3.eth.contract(greeterCompiled.greeter.info.abiDefinition)" phase returning TypeError: Cannot ...
43
votes
3
answers
78k
views
how to unlock the account with geth?
when I use the web3 interface to sign on msgs, it tell me that the account should be unlocked, how can I manage this with geth and what exactly does unlocking mean?
13
votes
2
answers
5k
views
How to load Solidity source file into geth
Is it possible to load Solidity source file .sol file to go-ethereum.
I am using the 'loadScript' method by saving a .js file like the following and loads it.
source = "contract test {\n" +
" /// ...
38
votes
5
answers
35k
views
How to explore all transactions for a given account?
After beeing able to check account balances, I am looking for a method to list all transactions for a given Ethereum account through json-rpc protocol. I haven't found any method suitable for that on ...
21
votes
5
answers
13k
views
How do I import my presale wallet?
I purchased ether during the presale. Is there an easy way to import those ether and start using them?
5
votes
1
answer
2k
views
How to setup constantinople fork for private ethereum chain
I am trying to add the constantinople fork to my private net with is running on geth. I have updated to latest geth, geth 1.8.23.
I have stopped my current geth node running and have chnged the ...
37
votes
4
answers
48k
views
What is a chainID in Ethereum, how is it different than NetworkID, and how is it used?
Here it's described in Ethereum's go implementation.
type ChainConfig struct {
ChainId *big.Int `json:"chainId"` // Chain id identifies the current chain and is used for replay protection
A few ...
23
votes
4
answers
17k
views
How can I empty the blockchain?
I am trying to do a fast sync using geth --fast but I am getting this message:
blockchain not empty, fast sync disabled
How can I empty the blockchain to allow for fast sync?
18
votes
1
answer
11k
views
Are pending transactions "dropped" and "reinstated"?
I tried a simple transfer of ether between two accounts using geth, but set quite a low gas price (2 gwei). After two hours the transaction was still showing in geth under eth.pendingTransactions - I ...
11
votes
1
answer
3k
views
Can I unlock an account using JSON-RPC?
The only way I can work with ETH is through --rpc mode. Normally I would prefer to use the Python interface.
But I found myself in a situation where the RPC is very limited. For example, I can't ...
9
votes
4
answers
11k
views
How to run two nodes on the same device?
I want to run two separate nodes on my computer but it seems that the two nodes will collide with other. I know some considerations should be taken such as the ports, but anything else should I take ...
41
votes
5
answers
38k
views
How can I run go-ethereum as daemon process on Ubuntu?
The Installation Instructions for Ubuntu suggest running geth from the command line, how can I run it as daemon process / service on Ubuntu?
36
votes
6
answers
76k
views
Can't send transaction -- "Exceeds block gas limit" or "Intrinsic gas too low"
I'm trying to send Ether using geth 1.3.5, like this:
eth.sendTransaction({
from: eth.accounts[0],
to:'0x[ADDRESS_HERE]',
value: web3.toWei(5, "ether"),
gas:21000
});`
And I'm getting "...
35
votes
5
answers
49k
views
Is there a way to find an account's current transaction nonce?
I need to know my transaction nonce because I am doing fancy stuff with contract addresses (which are the keccak hash of my address + my transaction nonce). Is there a way to find this through the ...
29
votes
4
answers
34k
views
How can I expose Geth's RPC server to external connections?
I want to set up a private network of applications which can connect to a single Geth node. What options do I have for exposing the RPC server?
I'm running this: geth --rpc --testnet (sometimes I use ...
23
votes
5
answers
29k
views
How to estimate gas at contract creation/deployment to private ethereum blockchain
What I have done
a) When I use web3.eth.estimateGas to estimate the cost of a contract creation constructor with no parameters, the estimate is correct.
b) If the contract is already deployed then ...
14
votes
1
answer
4k
views
Why isn't fast sync the default?
As I understand, fast sync has all the security guarantees of a full sync, but is faster. Is that correct? If so, why isn't fast sync the default?
2
votes
2
answers
2k
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 ...
46
votes
3
answers
84k
views
How to delete or reset the blockchain in geth? (OSX)
I have a currupt Blockchain and want to hard reset the chain. what do I need to delete in order to start downloading the chain from scratch?
I know that there are 2 ethereum folders (I am on OSX):
$...
27
votes
1
answer
32k
views
Geth node starts to sync from the beginning after fast sync
I have synced using the --fast command. Now how should I proceed?
I tried stopping it, and then running geth --rpc but it says:
Last Header #1311471
Last Block #0
Fast Block #1310224
What should I ...
25
votes
1
answer
7k
views
Instrumenting EVM
I need to get all contract internal transactions. To do it, I'll need to instrument Ethereum EVM.
My question is: what I should do to get the transaction details? Right now, I'm looking to the code ...
24
votes
1
answer
9k
views
eth.pendingTransactions vs eth.getBlock('pending').transactions
What is the difference between eth.pendingTransactions and eth.getBlock('pending').transactions?
I have noticed that sometimes eth.pendingTransactions have some transactions that eth.getBlock('...
17
votes
4
answers
34k
views
My C: drive in my WINDOWS PC is almost full. How can I change both geth and Mist path to relocate my blockchain files?
I read here somewhere that I have to execute geth --datadir "NEW PATH". But this solution:
1) Doesn't work in a permanent way for me (it will actually point geth in that direction but if I after ...
13
votes
3
answers
32k
views
Best way to burn ethers and other ethereum tokens?
Is it correct that any ethers or tokens sent to the address 0x0000000000000000000000000000000000000000 will be destroyed?
Or what is the best way of burning ethers / tokens?
28
votes
4
answers
34k
views
Possible to store the blockchain in a different directory?
I'm running geth on Linux within a Chromebook. The blockchain is being stored within ~/.ethereum, along with other important files. Problem is, the storage capacity on my Chromebook is quite limited ...
18
votes
4
answers
9k
views
How to schedule a transaction?
Anyone can guide me on how to schedule a transaction to be sent once a specific block number is mined?
Thanks
17
votes
2
answers
10k
views
How much faster is it to sync with --jitvm?
geth help has:
VIRTUAL MACHINE OPTIONS:
--jitvm Enable the JIT VM
The impact of --jitvm has been unanswered and I'm looking for answers to these 3 specifically:
How much faster is geth --fast -...
15
votes
2
answers
6k
views
Truffle Migrations Account Locked Error with --network command
I have started a private blockchain using the command,
geth --networkid 1337 --datadir ~/home/xyz/testnet --ipcpath /home/xyz/.ethereum/geth.ipc --rpc --rpcapi eth,web3 --rpcport 8545 --rpcaddr ...
10
votes
3
answers
13k
views
How do I send the entire ether balance from one account to another account?
I'm trying to use web3 to transfer all (or as much as I can) of the balance of an account to another account. Here is the code I have so far:
var sender = web3.eth.accounts[0];
var receiver = web3....
9
votes
1
answer
6k
views
How to unlock accounts programmatically after the node has started?
Is there any way of just unlocking accounts without opening the console with geth?
I'm writing some scripts to automate cluster generation and I wish I could just call geth to unlocking some accounts ...
8
votes
1
answer
2k
views
How do I tell whether the Mist/Wallet is "fast" or "full" syncing?
I'm currently installing Mist/Ethereum Wallet from the pre-built binaries.
Having the run the ./Ethereum-wallet executable, it's now part-way through syncing the blockchain. It seems to be taking ...
7
votes
1
answer
2k
views
How to call Library Function from a Contract? => [error] The contract code couldn't be stored, please check your gas amount. undefined
When I compiled following code at "https://ethereum.github.io/browser-solidity/" it gives me two Web3 deploy code for:
var libraryContract = web3.eth.contract(...); //Web3 deploy code
var ...