Skip to main content

All Questions

Tagged with or
80 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
3 votes
1 answer
84 views

for loop containing types.Sender sometimes does not leave and consumes 100% CPU

I have this simplified code here: signer := types.LatestSignerForChainID(s.ethApiBackend.ChainConfig().ChainID) log.Info("Before msg generation", "txsLen", len(txs)) msgs := make([]...
flo's user avatar
  • 115
3 votes
2 answers
1k views

Verified go signature in solidity (EIP712 TypedData)

I am trying to recover the signer of a TypedData message (eip712). I am able to sign and verify with ethersJS and validate in the contract as well. With Go, I can sign and verify as well but the ...
MadeInDreams's user avatar
  • 1,615
3 votes
1 answer
3k views

How to convert string to type defined by an abi.Type for payload construction?

I am writing a CLI in Go that should faciliate users to be able to make contract function calls from it. This entails generating contract ABIs and providing input parameters to the function arguments ...
Shiri's user avatar
  • 826
3 votes
0 answers
191 views

Getting error message from require() using golang, and go-ethereum?

From everything I've been able to find, the only way you can get the error message from require() is by using remix which isn't practical for dealing with production issues. Therefore, I'm wondering ...
hextet's user avatar
  • 1,593
3 votes
1 answer
1k views

How to access non-indexed event arguments from Go types.Log?

The Go bindings have a type called Log that has the following fields type Log struct { // Consensus fields: // address of the contract that generated the event Address common.Address `...
Steven Roose's user avatar
3 votes
1 answer
2k views

Encode method signature and parameters using Go-Ethereum

Is there any way to use the Go-Ethereum library to get the string I have to send to JSON RPC to call a contract method. I mean, Go-Ethereum comes with a CLI, so there must be some built-in functions ...
MethDamon's user avatar
  • 803
2 votes
1 answer
125 views

Why is the same set of bytes encoded base58 differently?

I want to generate a bip32 private root key based on bip39 seed. I found an article with python code, copied it to myself and executed it, getting a valid private root key (checked here). Then I wrote ...
Mod diller's user avatar
2 votes
0 answers
487 views

Simulate transaction replacement on go-ethereum SimulatedBackend

i'm writing in go-lang and using go-ethereum package to interact with nodes. For testing purposes go-ethereum provides blockhchain simulation via SimulatedBackend (https://github.com/ethereum/go-...
Andrey Obruchkov's user avatar
2 votes
0 answers
1k views

Getting ALL pending tx from txPool

I'm working on top of geth in golang. My first goal would be to stream all pending transactions from the txPool. The problem is that when I run my script, I can't manage to catch 100% of pending ...
kms kms's user avatar
  • 21
2 votes
0 answers
215 views

Subscribe to smart contract using go-ethereum

I am trying to subscribe to certain smart contract using go-ethereum. Here is the example of my function client, err := ethclient.Dial(config.AppConfig.SmartcontractHost) if err != nil { log.Fatal(...
Yur Gasparyan's user avatar
2 votes
0 answers
468 views

Reading TxPool using GO

Hello I am trying to learn Go and have not been able to figure out how to get pending transactions. I was reading the following link but I am not sure what I should be importing: https://geth.ethereum....
marrrrrrk's user avatar
2 votes
1 answer
613 views

Problem with deploying the precompiled contract bytecode in genesis.json file

I am trying to add this simple test contract dumb.sol to my genesis.json file. pragma solidity <0.8.6; contract Dumb { string public name; string public symbol; constructor() { ...
Sakon Thephamongkhol's user avatar
2 votes
1 answer
305 views

UnhandledPromiseRejectionWarning: Error: nonce generation function failed or private key is invalid in Ganache

In Go I am using go-ethereum to read data from the ethereum smart contract. My smart contract is maintained with truffle. I am trying to fetch candidate information based on candidate id. I have a ...
NinjaMAN's user avatar
  • 419
2 votes
0 answers
82 views

How to add or modify account_signTransaction function

In this github.com/ethereum/go-ethereum/accounts/external/backend.go of Ethereum project i see the "account_signTransaction" function and i want to edit or update the logic for this function, where ...
Mark Nguyen's user avatar
2 votes
0 answers
1k views

No contract code at give address

Its a bit of a long question... I am using Go to deploy a Smart Contract using the following code: client, err := ethclient.Dial("http://localhost:8545") if err != nil { errorhandler.HandleErr(...
user3536523's user avatar
2 votes
1 answer
963 views

Invalid transaction signature on sending transaction

Hello guys I'm having a "Invalid transaction signature." error. Can't get pass this one. Am I missing something? client, err := ethclient.Dial("path/to/geth.ipc") if err != nil { return err } ks :...
emurmotol's user avatar
2 votes
1 answer
247 views

Transactions Mined Status in Go Lang

I have a private block chain setup. I am calling a smart contract method from Go Lang. I my code in GoLang should wait until the transaction got mined. How I can achieve that. Regards AKM
Amit Modi's user avatar
  • 321
2 votes
1 answer
695 views

getTransactionByHash function is not available in the go-ethereum package

In have downloaded go-ethereum package and made the private network. I am able to make changes in the code as per my requirement and it is also working fine. However, ethereum_js.go file has the ...
userven's user avatar
  • 201
1 vote
0 answers
96 views

abi: attempting to unmarshal an empty string while arguments are expected

After updating go-etherum from github.com/ethereum/go-ethereum v1.10.22 to v1.13.15 My contracts started printing out error abi: attempting to unmarshal an empty string while arguments are expected ...
Mikheil Janiashvili's user avatar
1 vote
0 answers
73 views

Confusion regarding the technical implementation of PoS Consensus Mechanism in custom blockchain? Master Node?

I have been making my own custom blockchain just as a practice for the past few weeks. The code is available here link to github repo I have hitherto implemented the Execution Layer, so to speak. I ...
Geek's user avatar
  • 41
1 vote
0 answers
17 views

How does MetaMask confirm the trasaction? The workflow of metamask

I'm trying to make interaction between my customized chain and Metamask. Network is added, and token sending is successful on chain side. But in MM, tx state is still pending. how can I fix that? What'...
Daniel Moore's user avatar
1 vote
0 answers
219 views

($10 ETH Bounty) Base Chain - My submitted transaction is always 2 blocks behind the current block

For some reason whenever I submit my transaction it is always included 2 or more blocks behind the current block. There's an address that always has their transaction included in the same block as the ...
shlx's user avatar
  • 31
1 vote
0 answers
447 views

Flashbots - Bundle simulation always reverts

I have a series of transactions I'm trying to bundle in golang. several of the transactions are signed transactions from a range of different wallets that are not yet submitted to the mempool. When I ...
user3428734's user avatar
1 vote
0 answers
104 views

Why is the TransactionByHash function in the go-ethereum client unable to return the sender?

I learned how to get the sender's address from this question. JSON-RPC returns a result with a from field, which we can unmarshal in our struct. But I'm curious why go-ethereum didn't return ...
user109485's user avatar
1 vote
0 answers
78 views

Point a Go-Ethereum contract instance at a different address

I am running a golang backend that will interact with tens of thousands of deployed contracts that are all the same, just with different addresses (uniswap pools). I am thinking that it would be more ...
skrrrraaaa's user avatar
1 vote
1 answer
115 views

How to filter return value from go-ethereum evm runtime.call

I am writing simple solidity code that's will be running inside evm using golang (go-ethereum). I have successfully run the code, but I can't find the right return value of the function. Test.sol // ...
ade ramdani's user avatar
1 vote
1 answer
732 views

Verify Nonce Signature in the backend Golang

I am trying to implement a metamask user authentication flow on BSC. I managed to get it working on ethereum. The flow is like this. I've found the code for ethereum on some gist however I am unable ...
Lucian Tarna's user avatar
1 vote
1 answer
1k views

Calling multicall contract using Go

I'm trying to make a multicall using go. The function "aggregate" takes a tuple of "calls" with address and bytes. "name": "aggregate", "...
Lio's user avatar
  • 11
1 vote
0 answers
642 views

How to add a custom JSON RPC endpoint to geth?

I would like to add custom RPC method to geth. I found this question: How to add a custom JSON-RPC endpoint to geth?. But it does not work... What I did: 1. https://github.com/ethereum/go-ethereum 2. ...
clzola's user avatar
  • 191
1 vote
0 answers
589 views

Geth: Simulated Backend?

I recently stumbled upon SimulatedBackend struct while browsing the code. I noticed that it has a constructor (i.e. NewSimulatedBackendWithDatabase) which accepts the path to the node's LevelDB, which ...
Anton Chtepine's user avatar
1 vote
0 answers
274 views

Golang - Help gnosis transaction hash not calculated right

I have been trying to submit a transaction to gnosis rinkeby api but always the server response is that the hash is not correct and suggest's the lazy way which is not safe for what I want to do so I ...
Amaury Diaz's user avatar
1 vote
0 answers
403 views

Enhancing geth subscription processing to be able to work with transaction data

I'm thinking to have a geth "extension" that would be working with a Geth subscriptions. I would like to filter over pending transactions. When I'm searching in the code I can see that I can ...
chalda's user avatar
  • 111
1 vote
0 answers
65 views

Expose aditional APIs via Go Geth Ethereum Client

I am asking more experienced Go Geth developers what is the module that is in charge of exposing variables on the Geth Console / RPC. What I need is to expose the variable containing the addresses in ...
Cristofor's user avatar
  • 143
1 vote
1 answer
894 views

what should golang abi.pack argument looks like compared to solidity function

The following code is a popular solidity ethereum function function: swapExactETHForTokens(uint256 amountOutMin, address[] path, address to, uint256 deadline) what should amountOutMin type look like ...
anonymous's user avatar
1 vote
0 answers
72 views

Could Insufficient Funds error mean the signature is incorrect? - using golang and raw transactions

I want to sign a transaction "offline" without using crypto.sign. The code looks like the following: unsignedTx := types.NewTransaction(nonce, to, amount, gasLimit, gasPrice, nil) networkID ...
Jorge Alvarado's user avatar
1 vote
0 answers
1k views

How to pull data from DeFi Liquidity Pools

I am relatively new to decentralised development, and apologies in advance if a bit of a dumb question. I am doing a project where I am looking to download the following data. I am trying to figure ...
erixliechtenstein's user avatar
1 vote
1 answer
188 views

Plans to migrate go-ethereum to rust-ethereum?

Is anyone planning to migrate go-ethereum to rust-ethereum? Rust with all its features such as zero-cost abstractions, safe memory management, fearless concurrency really outshines Go. Nathan Aw (...
Nathan Aw's user avatar
  • 1,954
1 vote
0 answers
83 views

Getting Blockchain Domains From Transaction Hashes

I am compiling a list of some blockchain domains (.eth, .crypto, etc.) and was wondering what would be the best approach. My strategy is to take something like this: https://etherscan.io/address/...
goEthDevvv1's user avatar
1 vote
0 answers
61 views

Geth's golang contract bindings need "RPC subscription features that are still under review" to process event logs. What are those features?

The documentation for Geth's golang contract bindings start out with Please note, events are not yet implemented as they need some RPC subscription features that are still under review. What ...
Alex Coventry's user avatar
1 vote
0 answers
79 views

Retrieving a State_object value on go-ethereum

I have a deployed contract address and I need to query a contract storage value, a token account balance that is stored on a mapping variable: mapping (address => uint256) balances; From go-...
Juan Ignacio Pérez Sacristán's user avatar
1 vote
1 answer
446 views

How can I make new account by JSON-RPC of Go

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 ...
steven's user avatar
  • 11
1 vote
0 answers
196 views

Handling EOF when subscribing to Event Logs

I'm trying to subscribe to events logs to handle Transfer(address,address,uint64) events. I've followed this example. https://github.com/miguelmota/ethereum-development-with-go-book/blob/master/en/...
Daniel Sarosi's user avatar
1 vote
1 answer
298 views

How to parse input data in transaction using go programming language?

I know there are some resolutions about parsing transaction input data, but they don't work with go. I wander if there is any way i can use with abi available. Specifically, When i receive a ...
Jocelyn's user avatar
  • 71
1 vote
0 answers
411 views

How to configure Geth for accepting future transactions without full sync?

I need to monitor a future (also known as pending or unconfirmed) transactions. First of all, let's start with the source code. In the core/tx_pool.go let's configure logging a little. Replace log....
Sergey Potekhin's user avatar
1 vote
1 answer
122 views

Need help with start mining(I am getting like this)

I am new to ethereum private blockchain System information: geth version:1.8.2 os&version:linux synopsis: when i tried to connect peers to my private blockchain it showing like WARN [03-20|11:...
Raji's user avatar
  • 11
1 vote
0 answers
272 views

How to calculate difficulty (int) based on (float)

I am trying to adapt my pool based on github.com/sammy007/open-ethereum-pool to nicehash protocol. It works more or less and I am receiving shares already, but I ran into the problem with difficulty ...
Korjavin Ivan's user avatar
1 vote
1 answer
676 views

How do I start to write a function to debug Transaction?

I want to write a program that will do: for the given txhash debug TraceTransaction and return that What can i do in Go ? Do you have any materials, a tutorial or can you give me tips on how to ...
EricEnticman's user avatar
1 vote
0 answers
212 views

Make Android Command Not Running. (Mobile Go-Ethereum)

Planning to make some modifications to the go-ethereum mobile code,so inorder to do that need to use "make android" command which will create the geth.arr (Manual builds: https://github.com/ethereum/...
snappyBot's user avatar
0 votes
1 answer
34 views

How to encode transaction hash argument in go ethclient CallContext

I am trying to call debug_traceTransaction in go by doing: cl, err := ethclient.Dial("http://localhost:8545") if err != nil { panic("Failed starting") } txnHash := common....
Riccardo Perego's user avatar
0 votes
0 answers
43 views

go -ethereum abi: cannot marshal in to go type: length insufficient 640 require 8225"

Im trying to decode a struct which basically is a tuple where i have this byte of data and passing the byte of data it will be able to be decoded into a struct in Go. My goal here is trying to create ...
0xbyterider's user avatar