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
1
vote
0 answers

What type should result be in golang smart contract binding call

I am calling this code: package multicall import ( "fmt" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/ethclient" "github.com/ethereum/go-ethereum/accounts/abi/bind" ) var multicallContractAddress =…
mteam88
  • 103
  • 1
  • 12
1
vote
1 answer

How to get From address by transaction hash by golang

ethclient.Client.TransactionByHash and ethclient.Client.TransactionReceipt return types.Transaction and types.Receipt, but both of the types don't have From method. How can I get the From address by golang? I want to get From addresslike etherscan…
1
vote
1 answer

Fatal: Error starting protocol stack: listen tcp 127.0.0.1:8551: bind: Only one usage of each socket address is normally permitted

I'm trying to create three nodes with one private chain. node1 is successfully created. But node2 and node3 showing the following error. Fatal: Error starting protocol stack: listen tcp 127.0.0.1:8551: bind: Only one usage of each socket address…
李林發
  • 13
  • 3
1
vote
0 answers

How to switch geth synced to ETH mainnet, to ETHPOW fork mainnet upon launch without having to sync chain from scratch?

I have a geth node synced to the ETH mainnet, and once there is a POW hardfork, such as ETHPOW, I would like to think it is possible to change the geth settings, so that it begins to sync to the new ETHPOW network, while maintaining the entire…
josjunior
  • 11
  • 1
1
vote
0 answers

Always out of gas after estimating gas

// contracts/Gold20.sol // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; contract Gold20 is ERC20 { constructor() ERC20("Gold20", "G20") { } function mint(address…
dazan
  • 13
  • 2
1
vote
1 answer

solidity security fallback function priority

I know that the fallback is triggered when sending a transaction to this contract and calling a non-existent function, what I want to understand is: Contract A sends a transaction to Contract B (fallback), the solidity code has run to here The…
nopnopttt
  • 11
  • 1
1
vote
1 answer

go-ethereum encoding or decoding input data without abi

In web3.js, I can decode input parameters without abi: const data = web3.eth.abi.decodeParameters( ["uint256", "uint256", "address[]", "address", "uint256"], …
Moon soon
  • 2,616
  • 2
  • 30
  • 51
1
vote
0 answers

How to subscribe to pending transaction in Ethereum?

I'm trying to subscribe to pending transaction in Ethereum. Whilest I know how to do in web3.js const subscription = web3.eth.subscribe("pendingTransactions", (err, res) => { if (err) console.error(err); }); I haven't been able to find any method…
1
vote
0 answers

Geth doesn't sync ropsten ethereum testnet

I have 1.10.16-stable-20356e57 version geth and using SSD disk for synchronization. But it doesn't sync. I'm waiting more than a day... Tried to reinstall and clean data dir, but it doesn't work. Does anyone have same problem?
1
vote
1 answer

How can I connect to already deployed smart contracts with Go?

I'm a budding blockchain dev, and I've been using Go to dive into things as that's the language I'm most comfortable with. I've at an impasse now, and hope I can get some help. Pretty much all the tutorials I've seen on working with smart contracts…
SnoopBoard
  • 65
  • 1
  • 6
1
vote
0 answers

Concurrent Ethereum account creation takes lot of time and freezes the ethereum n/w

I am bit new on Ethereum Blockchain and I wanted to create several ethereum accounts concurrently something like as shown below. I am using Geth to spin up my Ethereum n/w. Till the count is 15, there is not much delay. But as i start increasing the…
1
vote
1 answer

When I use golang call the contract method,how can I confirm this trx status?

I mint the token to my account and it return transaction hash ,but I wnat to now this hash status .Like js can use callback function to wait this trx finished var promise = await token.mint("my account",1) …
Mr.c
  • 23
  • 5
1
vote
0 answers

How do you find contracts on the blockchain matching a specific bytecode?

I discovered a YouTube based scam where a fake Solidity tutorial instructs users to go into Remix and deploy a scam contract. The scam contract allows any address to withdraw the funds. It has fake comments that are hilarious, but it is really scary…
1
vote
1 answer

How to deploy hardhat contract to mainnet without ALCHEMY or INFURA?

How to deploy hardhat contract to mainnet without ALCHEMY or INFURA ?
1
vote
0 answers

How to fix a "hex string of odd length" error

I'm trying to write a script in Go to interact with a smart contract on Binance Smart Chain using an RPC and the github.com/ethereum/go-ethereum package. However, I keep getting "panic: hex string of odd length" when trying to call a method…
what_4
  • 19
  • 2