Skip to main content

All Questions

Tagged with or
Filter by
Sorted by
Tagged with
0 votes
1 answer
255 views

Simple Go-Ethereum Program not compiling

I am following this tutorial: 01-Interact with Ethereum blockchain using Golang When I compile the code, i get the following errors: # github.com/deckarep/golang-set ../github.com/deckarep/golang-set/...
gnome's user avatar
  • 1
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
0 votes
1 answer
294 views

How to extend functionality of geth (module, addon)?

Is there a way to extend functionality of geth using some sort of plugins, modules or addons? However, I haven't found any information about the topic. How to do it?
pablo camilo's user avatar
0 votes
1 answer
103 views

How to obtain full token address from uniswap/PCS router transactions (*types.Transaction)

When trying to obtain the token address from router transactions (add liquidity and remove liquidity taxes), the token addresses appear truncated, with 8 leading 0s and the 8 final characters missing. ...
jrn's user avatar
  • 1
0 votes
1 answer
360 views

Can I deploy contract with go-ethereum and sign it via MetaMask?

I want to deploy contracts by using my go backend code with go-ethereum package. Since this part of the system will run as a central element (since it does a lot of other stuffs), I won't (and don't ...
prodx's user avatar
  • 1
0 votes
1 answer
197 views

How to set total supply of native token in genesis file?

I understand you prefund wallet address with a native token in the alloc param, but where do you define the total supply at in the genesis.json file? "genesis": { "nonce":...
cormacncheese's user avatar
0 votes
1 answer
972 views

How to interact with mainnet smart contracts by GOlang?

Please tell me an example of code in GOlang that connects to the contract and checks the balance of the ERC20 token / transfer tokens / gets the name of the token. I looked for examples and did not ...
hey's user avatar
  • 1
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
1 answer
1k views

How do I listen for Events starting at a previous block number in Golang?

I'm writing an Event listener for my smart contract using the go-ethereum library. I'm trying to figure out how to listen for all SubmitProof events and have successfully been able to use the builtin ...
hexcowboy's user avatar
2 votes
2 answers
2k views

Await transaction using `go-ethereum/ethclient`

In ethers.js, one can wait for a transaction to be mined with wait(). Is there a way to do this when using ethclient from go-ethereum as a package? I would like to wait for the result before moving on ...
boston's user avatar
  • 33
0 votes
1 answer
152 views

Using Ethereum as a Unique ID Generator

I have a requirement where I would like to call a smart contract and store some values against a unique ID. I have seen the Counters library from OpenZeppelin. Is a smart contract a good use case for ...
magna_nz's user avatar
  • 103
0 votes
0 answers
30 views

Go Ethereum "invalid signature recovery id" when recovery byte is >= 4 [duplicate]

I have a signed message that was generated by Metamask. It looks like this: ...
hexcowboy'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
0 votes
0 answers
379 views

Decode pending transaction input into map

I'm attempting to decode a transaction input into a map, the input contains uint256 which are translated to bigint but the output value I get is incorrect. I use this function to decode the input data ...
Collins's user avatar
1 vote
1 answer
921 views

Go Ethereum encode types.Transaction as hex

I have a types.Transaction object. How can I encode this to receive the raw transaction hex? Something like this: ...
Ricky Barnett's user avatar
0 votes
1 answer
1k views

Decode Raw Transaction In GoLang to Go-Ethereum types.Transaction

I have the following raw transaction string. ...
Ricky Barnett's user avatar
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
2 answers
422 views

how to manually craft tx data in golang WITHOUT ethclient

how do i manually craft tx data (the actual DATA field in a tx) in golang without ethclient? i am trying to craft tx data to be signed later. lets assume i am trying to call a solidity function like ...
D3l_Gato's user avatar
  • 135
1 vote
1 answer
921 views

Deploy smart contracts using golang

I tried to deploy smart contracts using go and go-ethereum. To deploy it, I use sendTransaction function from go-ethereum library, but when i check it on ropsten explorer, it just a basic transaction ...
ade ramdani's user avatar
0 votes
1 answer
126 views

Start and HTTP JSON-RPC geth on android?

Is it possible to change the code in /mobile to allow for a json-rpc api to be spawned on an android? Or is there something I need to do in Java with the NodeConfig? I already managed to run a light-...
Markus Haas's user avatar
1 vote
1 answer
2k views

Why is my contract so expensive to deploy?

I've tried to deploy a contract based on openzeppelin library (see below). The fee I paid is about $146 and the contract didn't even deploy(i.e it run out of gas ). I find this unbelievable high. It ...
goldish-boar'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
0 votes
0 answers
236 views

geth is not attached with JavaScript console

I am Nikhil Upadhyay I am trying to connect geth with javaScript Console but it didn't work for me here are few steps which I already tried but could not resolve it geth attach ipc:gethDataDir/ geth....
Nikhil Upadhyay's user avatar
0 votes
0 answers
33 views

Transferring tokens with Geth: what's outdated about this tutorial?

I'm using this e-book to learn about using go-ethereum, but it's pretty outdated. I'm on the part about transferring tokens and I'm getting an invalid opcode when estimating gas. I have a private key ...
ckrug's user avatar
  • 3
0 votes
0 answers
784 views

Call getReserves() from goweb3

I've been using https://github.com/umbracle/go-web3 as my go web3 library, and I am having trouble finding out how to call the "function getReserves(address factory, address tokenA, address ...
Frustrated 's user avatar
1 vote
1 answer
2k views

types.NewTx instead of types.NewTransaction

var data []byte tx := types.NewTransaction(nonce, toAddress, value, gasLimit, gasPrice, data) signedTx, err := types.SignTx(tx, types.HomesteadSigner{}, privateKey) NewTransaction is ...
vx0's user avatar
  • 11
0 votes
1 answer
81 views

Properly using consensus/ethash module in go-ethereum

Traditionally, Ethereum pools used the deprecated Ethash, which is quite inconvenient to use with modern golang, specifically around the usage of Go modules. Examples of this are Sammy007's Open ...
tug's user avatar
  • 1
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
0 votes
2 answers
57 views

Setup Quorum Blockchain

I am setting up a quorum blockchain on my computer. According to the official documentation, I have to first clone the git repo and give the following command: git clone https://github.com/Consensys/...
HAMMAD ALI'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
0 votes
1 answer
2k views

ParserError: Expected '{' but got 'constant'

This is my error message ParserError: Expected '{' but got 'constant' --> amkcoin.sol:50:35: | 50 | function totalSupply() public constant returns (uint); | ^^^^^^^^ and this is code line.. } /** ...
Relaksman's user avatar
0 votes
1 answer
384 views

Get smart contract info from transaction

Lets take for example this, we can see that it did not transfer any ether, it interacts with a contract (that's why there's the stamp of the contract creation/execution). Is there a way to get in go-...
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
0 votes
1 answer
32 views

I'm here to run the official Go-Ethereum repo. How can i do that?

I want to run go-ethereum in my own PC. Is there any instruction about this? How they deployed it?
Muhammad Sibghatullah's user avatar
0 votes
1 answer
2k views

Monitoring pending transactions with Go

I'm trying to write a program in Go to watch pending transactions, using a geth full node that I'm connected to over websockets. I'm pretty sure I have to use the github.com/ethereum/go-ethereum/eth/...
boston's user avatar
  • 33
0 votes
1 answer
89 views

Ethereum miner does not produce blocks

first time Mining! Watching a YouTube Tutorial about Blockchain basics and it shows how to set up a Genesis Block as well as how to start Mining. I've followed all the steps to the best of my ...
paul's user avatar
  • 1
0 votes
1 answer
2k views

Issues with autogenerated go file while using abigen

I have a simple sol file message.sol pragma solidity >=0.5.10; contract Message { string public message; constructor(string memory initMessage) public { message = initMessage; ...
Oscar's user avatar
  • 1
1 vote
1 answer
1k views

How do I receive a revert message using go-ethereum

How do I receive a revert message using go-ethereum? receipt, err := bind.WaitMined(context.Background(), client, tx) if err != nil { fmt.Errorf(err) } fmt.Println(receipt.Status) Now I can only ...
Igor's user avatar
  • 11
0 votes
1 answer
3k views

How to solve the "cannot find package" error in GoLand?

I just imported the go-ethereum project in GoLand. But the configuration shows the error below, how to solve it?
jiebang's user avatar
  • 1,003
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
1 vote
1 answer
1k views

How to calculate CREATE2 address in golang?

I have a factory pattern smart contract that creates other smart-contracts by cloning the master smart contract via Minimal Proxy Contract and CREATE2 opcode. What is the proper way to calculate ...
navigante's user avatar
3 votes
1 answer
3k views

How to install solc of a specific version?

I want to install solc 0.4.24 but the commands given below installs the new version. sudo add-apt-repository ppa:ethereum/ethereum sudo apt-get update sudo apt-get install solc Or sudo snap install ...
Puneet Kumar'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
0 votes
1 answer
171 views

Generate directory hash without upload using Swarm API

I am using the Swarm API (github.com/ethersphere/swarm/) with go to upload a directory on a private network. The client API(/api/client) provides a UploadDirectory function which returns a manifest ...
Stephen S's user avatar
  • 140
1 vote
1 answer
408 views

go-ethereum: Return data from contract function

I have a smart contract written in solidity. I deployed the contract to my Ganache network and I can interact with it via go-ethereum using stubs generated by abigen. My function returns a uint256, ...
paulturnip's user avatar