Questions tagged [go-ethereum]

Go Ethereum (short: Geth) is a Golang implementation of the Ethereum protocol.

Filter by
Sorted by
Tagged with
13
votes
1answer
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?
13
votes
6answers
8k views

Sorting an Array of integer with Ethereum

I'm trying to have a simple array of integer sorted in Solidity but i couldn't find any real ressources so instead i'm trying to do it "the hard way" but so far with very little success. Is anyone ...
13
votes
2answers
9k views

Calling debug_traceTransaction from web3 API

I want to use debug.traceTransaction to get internal transactions from NodeJS using web3 API. I'm using web3 0.17 beta and I don't see any debug_traceTransaction on the code. Am I missing something or ...
13
votes
3answers
1k views

Why do constant state variables get initialised every time?

I was working with constant variables in a contract contract X{ uint constant var1=now; uint var2=now; function checkConstant() returns(uint,uint){ return (var1,var2); }} I was wondered each ...
13
votes
3answers
19k views

how do you know your db is synced in geth?

In order to answer this question there is a need to get the timestamp of when the database is synced with geth. I can think of two ways of doing that : find the 1st occurrence of 1 block in the geth ...
13
votes
2answers
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" + " /// ...
13
votes
1answer
3k views

Can I run Geth without syncing?

I want to test some api calls using web3.js and so I am using geth as HttpProvider. Can I start geth without the syncing? Is something like geth --nosync --rpc available?
13
votes
2answers
3k views

What's the difference between developer mode and testnet?

I just tried running geth in developer mode on testnet. ~ $ geth --dev --testnet F0127 21:07:16.947591 6407 flags.go:467] dev and testnet are mutually exclusive I wasn't aware of the actual ...
13
votes
3answers
3k views

How can I completely automate a Docker image and Dockerfile for a geth test network

I would like to create a Docker image for a test network that has everything ready to go - pre-created accounts with ether already allocated. The problem is there doesn't seem to be a way to do this ...
13
votes
2answers
6k views

What are artifacts in truffle?

Your build artifacts are saved within the ./build directory, along side the compiled deployed contract artifacts in ./build/contracts. What exactly are these artifacts?
13
votes
2answers
23k views

What is the Private Key?

I am trying to understand what is the private key in Ethereum. Help please. Private key = the address? Private key = the password/passphrase? Private key = the text seen when we open the file in the ...
13
votes
2answers
1k views

Will Eth 2.0 be implemented in geth (go-ethereum) or will it run on a new client?

Geth is the official implementation of Ethereum based on the coding language Go. Currently, there are 8 teams that are building Eth 2.0 https://www.coindesk.com/next-gen-buidlers-the-8-teams-working-...
13
votes
3answers
8k views

Geth disk and memory performance analysis

A week ago I started a synchronization of a geth node with these parameters: --fast --cache=1024 --rpc --rpcaddr "0.0.0.0" --ws --wsaddr "0.0.0.0" --wsorigins="*" The result that I have obtained is ...
12
votes
6answers
23k views

Is there a quicker way than geth --fast to download the Ethereum blockchain?

I had the Mist client installed, but it hadn't been updated in a few weeks so I tried renaming the chaindata folder (instead of deleting it) and downloading the blockchain with geth --fast as that is ...
12
votes
2answers
9k views

Fatal: Failed to write genesis block: unsupported fork ordering: eip150Block not enabled, but eip155Block enabled at 0 genesis block

I am attempting to launch a private geth chain with the following command: geth --datadir=./test-private-blockchain/ init genesis.json I am receiving the following error: Fatal: Failed to write ...
12
votes
7answers
15k views

How to add peers on a private network?

I have created a private blockchain on two different machines. Now I want these nodes to connect with each other as "peers". I am using geth console. I have tried the following command: > admin....
12
votes
3answers
15k views

How to retrieve the Contract account balance in web3 or in geth command line?

I have created a private network with miner node using Ethereum. Then I deployed an Ethereum smart contract in the network. I have got the contract address as "...
12
votes
5answers
16k views

Invalid JSON RPC response: "" In Browser-Solidity

I'd like to connect private geth node from browser-solidity, however it returned the error Invalid JSON RPC response: "". Please check the following picture for details. Could you tell me how to ...
12
votes
1answer
8k views

Defining constructors as functions with the same name as the contract is deprecated. Use "constructor(...) { ... }" instead [duplicate]

The warning is from running sample code from Mastering Ethereum, I get the above error and it says Use "constructor(...) { ... }" instead. function Migrations() public {
12
votes
1answer
5k 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 ...
12
votes
2answers
2k views

Is it possible to preload contracts in the genesis block?

Here's the setup I'm trying to use: A genesis.json with the alloc field set to include code. "alloc": { "0000000000000000000000000000000000000001": { "code": "...
12
votes
3answers
6k views

Setting up a private PoA Clique network with puppeth

I would like to set-up a new private network using Clique as protocol with the help of puppeth. When configuring the new Genesis block, this question is being asked: Which accounts are allowed to ...
12
votes
1answer
2k views

Looking for a working Whisper example

I was looking to develop an application using Whisper & NodeJS and I'm having trouble finding an example that works and is updated. I've encountered this doc web3js.readthedocs.io/en/1.0/web3-shh....
11
votes
4answers
31k views

How do you configure geth to use coinbase?

I'm a novice. I'm looking for instructions on how to configure geth so it sends my mined eth to coinbase. In my head, I think the process is: Sync the blockchain geth --datadir /data/ethData --...
11
votes
5answers
20k views

How to check currently installed web3 version?

How to check installed web3 version with command line terminal?
11
votes
5answers
20k views

why did it returned null after call miner.start()

> miner.start() > null before it , I had created a account like this . user1 = eth.accounts[0] "0xb62f0bae52d153365661c4e23ab1d594484e9bef"
11
votes
2answers
12k views

Invalid sender error on private chain

I created a transaction in Go, signed it with a EIP155Signer signer, but when I try to publish the transaction through the Go client to the private blockchain, I get the error Invalid sender. Any idea ...
11
votes
3answers
8k views

Geth not syncing on testnet

I'm trying to run geth on a new mac and it gets stuck when trying to sync. I'm running geth --testnet --syncmode "fast" This is the console output: INFO [01-06|11:33:20] Starting peer-to-peer node ...
11
votes
4answers
3k views

Ethereum private chain resets back to block 0 when restarted

I am currently running the latest geth 1.8.1 Iceberg version. I set up a private ethereum network as per tutorial and everything including mining works fine, but every time I restart geth - the chain ...
11
votes
2answers
2k views

What is the difference between a static node and a trusted node?

In the docs, static nodes are described as Geth supports a feature called static nodes if you have certain peers you always want to connect to. Static nodes are re-connected on disconnects. There ...
11
votes
1answer
6k views

Geth: what does "commit new work on block" exactly mean?

First intuition was that it signals that there are transactions to be mined, but even without a tx on a private net sometimes I see it three times per block I0604 10:00:49.877830 miner/worker.go:337] ...
11
votes
4answers
1k views

"potential rewrite attack" message on Geth

When I was sending Ether using Mist I got the following message on Geth. I0528 18:34:57.312997 core/blockchain.go:959] imported 1 block(s) (0 queued 0 ignored) including 3 txs in 19.344963ms. #...
11
votes
3answers
3k views

What's the fastest way to mine a transaction so I can test contracts quickly?

I am developing a solidity automated test framework in nodejs that uses events/logging extensively. The use of events eliminates (I believe) all the RPC simulators out there. It's also frustrating ...
11
votes
4answers
18k views

ethminer Failed to submit hashrate

I keep getting an error: ethminer Failed to submit hashrate :( I am very new to this whole mining thing, and just want to learn more. I am using: Geth Version: 1.5.0-unstable ethminer version 1.2.7 ...
11
votes
1answer
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 ...
11
votes
3answers
12k views

How to get an ERC20 token listed in etherscan.io

In etherscan.io, under the TOKEN drop down menu, there is a list of tokens, and it is indicated that they all are ERC20 standard tokens 1) How do they get listed? Do we have to register a new ERC20 ...
11
votes
2answers
10k views

Fatal: Error starting protocol stack: ... Access is denied

What should you do if you get an error similar to the below when starting geth? Fatal: Error starting protocol stack: Access is denied.
11
votes
2answers
4k views

How to connect etherwallet to my private blockchain?

I am unable to make etherwallet v3.4.2 to connect to my private blockchain. The way I run my private network: (please note that it works perfectly fine) geth --port 3000 --networkid 23422 --identity ...
11
votes
1answer
2k views

Why do some blocks contain no transactions?

While poking through my Geth logs I noticed that block 1,000,006 doesn't actually contain any transactions. Why is that?
11
votes
1answer
3k views

Does "delete" on mapping really frees the memory space?

I have the following mapping(uint => Foo[]) data structure. I have mapped 10 unique ids with 10 Foo structs, where each Foo is an arraylist of 10 items. Step 1: for(int i = 0; i < 10; i++) ...
11
votes
3answers
2k views

Syncing ethereum testnet

I'm syncing my geth client with ropsten testnet and just realized how slow is the syncing process after a certain block(trying to retrieve information from blocks that got in blockchain yesterday) for ...
10
votes
3answers
26k 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?
10
votes
3answers
4k views

How can you share a struct definition between contracts in separate files?

I can't declare a stand-alone struct in its own file, what gives?
10
votes
2answers
7k views

Fatal: Could not open database: resource temporarily unavailable

I get this error when I run the geth upgradedb command: I0317 08:29:57.792433 4202 chaincmd.go:137] Upgrading blockchain database I0317 08:29:57.792491 4202 database.go:71] Alloted 16MB cache ...
10
votes
1answer
6k views

contract.at is not a function

I'm learning about ethereum and smart contracts and I have a simple contract that stores a string. I'm trying to use web3js to change that string. I'm having trouble following the instructions from ...
10
votes
3answers
9k views

Geth response: invalid content type, only application/json is supported

I started geth on a remote server running on rinkeby with the parameters --rinkeby --fast --cache=128 --rpc --rpcaddr 0.0.0.0 When I try to test my access to geth using curl -X POST --data '{"...
10
votes
4answers
10k views

Get raw transaction from hash

I wonder if there is an equivalent to bitcoind's getrawtransaction, i.e., a command to dump a raw transaction in hex format, given its hash id. I am working preferably in geth.
10
votes
2answers
8k views

How to run a "server" for light clients?

When running geth --light the go-ethereum client somehow has to connect to full nodes to interact with. Could geth connect to any full node on the network or does this require a special endpoint? How ...
10
votes
1answer
6k views

Difference between full node and bootstrap nodes in Ethereum?

I know that when a new geth instance runs it connects to the bootstrap nodes. What I want to know that do other nodes download blockchain from the bootstrap nodes or nor? Bootstrap nodes are highly ...
10
votes
2answers
8k views

Updating ERC-721 Token's Metadata after it was Minted

Is it possible to somehow update an existing ERC-721 Token's MetaData after it was already minted? Let's say we've created a Knight character for a game - by minting an NFT for it, and 3 months later ...