Questions tagged [go-ethereum]

go-ethereum, also known as geth, is a Go implementation of the Ethereum protocol. Use this tag for questions about creating or writing code for a geth-based Ethereum service.

go-ethereum is the most widely used client implementation for Ethereum.

Command Line Options

Install on Mac

Install brew...

brew update
brew upgrade

Install Ethereum

brew tap ethereum/ethereum
brew install ethereum

Install on Windows

Download the latest stable binary, extract it, download the zip file, extract geth.exe from zip, open a command terminal and type:

chdir <path to extracted binary>
open geth.exe

Install on Linux

sudo apt-get install software-properties-common
sudo add-apt-repository -y ppa:ethereum/ethereum
sudo apt-get update
sudo apt-get install ethereum
430 questions
3
votes
2 answers

Is there a way to simulate the output of a smart-contract call?

I want to know the exact effect of submitting a smart-contract call. For example, if I swap USDC to ETH on uniswap. For transactions, we have eth_call, is there something similar for contracts? This needs to work for arbitrary complicated…
Danny
  • 41
  • 1
  • 3
3
votes
1 answer

Golang Interpret gdb SIGILL, Illegal Instruction

I've written a small go program to be run on a MIPS 32-bit router. I'm able to get a basic hello world program running on the router using the go build toolchain. env GOOS=linux GOARCH=mips GOMIPS=softfloat go build -a The program I'm trying to…
MattLock
  • 174
  • 3
  • 17
3
votes
1 answer

Docker on Windows: Error starting protocol stack: listen unix /root/.ethereum/geth.ipc: bind: operation not permitted

On a Windows 10 system, I am trying to run a Docker containiner running geth which listens to port 8545. This docker-compose.yml has been tested to run perfectly on both Ubuntu and Mac OS X. docker-compose version 1.21.1, build 7641a569 is being…
Nyxynyx
  • 61,411
  • 155
  • 482
  • 830
3
votes
1 answer

geth --targetgaslimit not working?

My contract creation requires 5633321 gas - more than default block gas limit. I was able to deploy on Ropsten network it few times ago: https://ropsten.etherscan.io/tx/0xe90e8920018f8b633620c731c68b63f3ce11dc19f59ddb49401c9e2c9cd1f8c2. Now i want…
4ntoine
  • 19,816
  • 21
  • 96
  • 220
3
votes
0 answers

Adding a web3 wallet with a private key adds account with incorrect address

I am trying to link an account that I created use geth with an instance of web3 that I'm running in a node repl. In order to add the account, I did the following: 1) I decrypted the JSON private key file created by Geth, in the MyEtherWallet…
fraxture
  • 5,113
  • 4
  • 43
  • 83
3
votes
1 answer

Is it possible to predefine smart contracts in genesis.json?

I encountered exactly the same issue as this https://ethereum.stackexchange.com/questions/7707/is-it-possible-to-preload-contracts-in-the-genesis-block?rq=1 Agian, is it possible to predefine a contract by assigning alloc -> code field like…
3
votes
1 answer

Compile error when trying to import web3swift

I am trying to import web3swift into one of my Swift files, but get the compiler error No such module 'web3swift'". The import statements look like this: import Geth import web3swift In my pod file, I have: pod 'web3swift', :git =>…
3
votes
1 answer

Solidity function with array.push() not work when structure have more than two parameters

I have deployed a contract with following push function to my local privatechain via remix. struct TestComplex{ address testValue; address delegate; uint testInt; } TestComplex[] testArray; function setTestArrayByPush( address _delegate,…
Yudao Yan
  • 95
  • 1
  • 7
3
votes
1 answer

eth.call on web3 interface returns null value for contract function returning array of bytes32/strings

I am trying to run a bidding smart contract on a private blockchain and my smart contract is working on the Remix IDE and the same works on my private chain except for one function [dataOwnedBy()] which is suposed to return an array of bytes32 but…
3
votes
2 answers

geth account new - password on command line

I'm trying to use a password on the command line instead of keeping it on a text file using geth: geth --password mYp@ssw0rd account new but the above throws: Fatal: Failed to read password file: open mYp@ssw0rd: no such file or …
Pedro Lobito
  • 94,083
  • 31
  • 258
  • 268
3
votes
1 answer

Can I configure my truffle project to use an .ipc endpoint file instead of an ethereum RPC listener?

I'm working on a project that uses truffle framework and want to test my code on a private ethereum network. When I run truffle console, it connects to the network specified in truffle.js, like this: module.exports = { networks: { development:…
2
votes
1 answer

Get CALL_EXCEPTION details

I am running private geth node and I am wondering if there is any way to find the root cause of transaction exception. When I send the transaction, all I can see is: transaction failed [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ] And…
ekimpl
  • 449
  • 6
  • 11
2
votes
1 answer

how to parse negative int256 in Go ethereum

There is a uniswap v3 transaction, the last event log is an Swap event: https://etherscan.io/tx/0x6c6d106c260586b91641fc994d034dfc55fa4d2283afad967442e2b2ce8ad12a#eventlog Please notice the amount1 argument is a negative int256, But When I parse it…
Moon soon
  • 2,616
  • 2
  • 30
  • 51
2
votes
0 answers

How to filter erc721 mint transaction from pending pool?

what i want to do is filter ERC721 mint transactions from mem pool what i already known is : subscrib pending: txch := make(chan common.Hash, 1000) _, err = gcli.SubscribePendingTransactions(context.Background(), txch) or …
2
votes
0 answers

How to send BSC transaction with golang

I have a Smart Chain wallet which i want to send a token or BSC from it to another address programmatically using Go. I tried go-ethereum library and bnb-chain but i can't figure out how to do this. Note: i don't want to run a full/light node to…
mohammad
  • 31
  • 3