Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
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
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
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
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
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
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
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
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
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
3 votes
1 answer
5k views

How do I increase the amount of memory geth can use for cache?

I'm running geth on a system with 96GB of memory, soon to be bumped up to 192GB. I currently start geth with --cache 32768 but I plan to double it when my memory is upgraded. However, I've noticed ...
Broseph's user avatar
  • 695
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
0 votes
1 answer
83 views

Infura node seems to crash when tryining to deploy contract

I am trying to deploy a contract and run some tests on the functions within it. Here is what my code currently looks like: package main import ( "context" "crypto/rand" "encoding/hex" ...
0xsegfault's user avatar
  • 1,260
0 votes
1 answer
32 views

Balance returning zero after sending KETH to it

I have sent the following transactions to the account 0x2D76d8729F9Cfa5bC3CEba8a504400FE30bb53D2: 0x8667bd1859a5ccc99bcc77b38c5453195bf32b308b4038ae409b47b002546344 ...
0xsegfault's user avatar
  • 1,260
0 votes
0 answers
232 views

How it works with modified go-ethereum source code

I modified go-ethereum source code and built it. I am wondering if I want to test and run geth with the modified source code in mainnet or testnet, and how it works in the mainnet or testnet. How to ...
JongH's user avatar
  • 73
0 votes
1 answer
3k views

Decode transaction inputs with go-ethereum

When making a contract transaction using go-ethereum (golang) how can I decode the transaction inputs. Specifically Given a tx.Data []byte , the contract's contractABI abi.ABI and the method that ...
Nico Vergauwen's user avatar
0 votes
1 answer
323 views

How is Ethereum Virtual Machine (EVM) isolated (sandboxed)?

I always had this question in mind: What are the used technologies, in order to achieve the isolation of the EVM? does it just run as an isolated process in its own namespaces using the linux feature ...
icy3's user avatar
  • 98
2 votes
1 answer
463 views

Subscribe to events using local geth in light mode?

I've followed this guide to subscribe to events. I succesfully subscribed to the new block headers using Infura provider. But when I try to use local geth node syncing in light mode, it connects, but ...
Ivan Zakharov'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
0 votes
1 answer
1k views

Is there a web3 api written in golang to interact with Eth nodes?

I'm looking for a library that can easily interact with Ethereum nodes that is similar to Web3.js. go-ethereum is written entirely in go so I would of thought I could write scripts pretty easily.
Cer Hewer's user avatar
1 vote
1 answer
2k views

Connecting my Golang Backend server with Metamask

I'm trying to build a Ticket-Office project in one of my courses at the University. The project uses a backend server (which I'm writing in Golang) and it should be able to deploy and use smart ...
Daniel Shterenberg'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
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
1 vote
1 answer
522 views

The EVM throws an error "invalid opcode 0x1c" [duplicate]

I have written a simple smart contract that allows to store a string, and I'am trying to use go-ethereum(which is similar to web3j). When I execute a transaction, I have this error VM returned ...
MS B's user avatar
  • 196
1 vote
1 answer
255 views

How to programmatically check the type of Ethereum node/backend that I'm connected to using Go?

I'm aware that I can do this using CURL like so: curl -H "Content-Type: application/json" -X POST --data '{"jsonrpc":"2.0","method":"web3_clientVersion","params":[],"id":67}' https://the-node-ip-...
Zulhilmi Zainudin's user avatar
0 votes
1 answer
610 views

connecting geth to web3.go 1.0 via websockets or HTTP

Is there anyThing similar to web3.js written in go that allows me to communicate with the geth client ?
MS B's user avatar
  • 196
3 votes
1 answer
278 views

How to get an evm reference inside go-ethereum GetBalance function?

In order to modify GetBalance function to fork go-ethereum, I find difficulties to get a reference of the running evm. The function has a reference for self *StateDB: func (self *StateDB) GetBalance(...
Juan Ignacio Pérez Sacristán's user avatar
0 votes
1 answer
127 views

Reading genesis config on GoLang

In a custom fork of Ethereum my team is developing, we need to read a new config parameter from genesis block. At https://github.com/ethereum/go-ethereum/blob/master/cmd/evm/runner.go#L100 the code ...
Juan Ignacio Pérez Sacristán's user avatar
4 votes
1 answer
3k views

Calling contract method internally from geth code

On developing a custom geth fork there is the need to call a specific hardcoded smart contract when ETH transfer occur. This is not an Ethereum normal behaviour but a new feature we want to implement ...
Juan Ignacio Pérez Sacristán'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
0 votes
1 answer
540 views

Genesis allocation and (address, balance) tuples

On go-ethereum souce code at core\genesis_alloc.go(19): ... package core // Constants containing the genesis allocation of built-in genesis blocks. // Their content is an RLP-encoded list of (...
Juan Ignacio Pérez Sacristán's user avatar
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
8 votes
6 answers
5k views

Given a RAW Transaction - how to get senders address

Is it possible to get the senders address using golang when all you have is the raw transaction string. I can decode it and get the nonce, hash, to etc as these are all exported functions from the ...
Kravitz's user avatar
  • 447