All Questions
235 questions
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/...
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 ...
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 ...
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"
...
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
...
2
votes
0
answers
34
views
How to reduce corruption in developing countries using Ethereum [closed]
I would like an honest opinion on whether or not the picture below is self-explanatory. I would also like to know what more functionalities I can add to reduce the capital flight by government ...
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 ...
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 ...
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 ...
2
votes
1
answer
2k
views
Different outputs for Keccak256(), which one is right?
To get a value from contract storage I used this geth code succesfully:
var contractAddress = '0x88e726de6cbadc47159c6ccd4f7868ae7a037730'
var index = '...
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 ...
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-...
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.
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 ...
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
...
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 ...
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 ...
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-...
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 ?
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(...
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 ...
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 ...
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(...
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 (...
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/...
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 ...
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 ...
0
votes
1
answer
868
views
Converting Log Topics to int64 correctly in Go
I currently use the code below to extract the ERC721 Token ID from Transfer Event Logs:
txHash := newLog.TxHash.Hex()
hexString := common.BytesToAddress(newLog.Topics[3].Bytes()).Hex()
flowerNum, _ :=...
0
votes
1
answer
373
views
How does one go about implementing the ContractTransactor interface from the bind package in go-ethereum?
Hey guys thanks in advance!
Here is the interface provided by the go-ethereum library in the bin package. I need an example on how to implement this interface please :)
// ContractTransactor ...
0
votes
0
answers
277
views
Balance from ethereum accounts on geth disappears
I have geth private network with 3 accounts A, B and C.
each account has 100, 200 and 300 ether balance
I connected to this network from Metamask and Transferred the balance of 50 eth from account A ...
2
votes
2
answers
6k
views
GoEthereum getting public key from private key hex formatting
So I am trying to get public key in hex formatting. In some documentation I found the following will give public key from the private key, but it is not formatted correctly as I can see:
publicKey := ...
2
votes
1
answer
3k
views
goethereum getting publicKeyBytes from given public key
Trying to follow this documentation on verifying a signature: https://goethereumbook.org/signature-verify/
Where I am a bit confused is this line:
publicKeyBytes := crypto.FromECDSAPub(...
0
votes
1
answer
78
views
Private ethereum network account related query
Please help with below queries:
how to reset the paraphrase for an account on private ethereum network
Is there a way to delete an account on private ethereum network
How to enable the etherscan url ...
0
votes
0
answers
239
views
Metamask to Private ethereum communication issue [duplicate]
When i connect to my private ethereum network using the 'Custom RPC' of the metamask, it is getting connected from the MetaMask. FYI, i am connecting from outside the network of my server, and all ...
1
vote
1
answer
6k
views
How to fix "unexpected directory layout" error when Installing go-ethereum?
All, I hope this question belongs here.
I am following a Blockgeeks tutorial, trying to set up my environment for Ethereum blockchain development. I have basically gotten to the final step, ...
0
votes
1
answer
1k
views
How to use event log in solidity contract using go language
I have created ethereum smart contract using go language. Smart contract successfully deployed. I have a created many transactions on ethereum private network. But I confuse how to get event log.
2
votes
2
answers
582
views
Golang Equivalent to list accounts on node - web3.eth.Accounts()
Does anyone know if its possible to get a list of the accounts on a node using golang, after Dialing to the node, basic PoC would be assuming the accounts are already unlocked via the CLI
Basically ...
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 ...
0
votes
1
answer
3k
views
How to correctly send RPC call using Golang to get smart-contract owner?
Update 12 November 2018
Someone shared a very close solution to what I was looking for here.
Update 10 November 2018
Since I'm not able to achieve this using the approach in this question, I ...
1
vote
1
answer
2k
views
Golang binding - call contract method and get its return value or tuple?
Suppose i have contract like:
pragma solidity ^0.4.11;
contract MyToken {
uint256 a;
function SimpleGetter() returns(string) {
return "something";
}
function DoTheGreat(address _to) ...
0
votes
1
answer
1k
views
How do I check the Ethereum balance and unique transactions count of a Smart Contract over a period of time?
Basically I want to be able to track smart contracts balance and unique transactions over a period of time such as , last 24hours, last hour and so.
What would be the best approach into doing this? ...
0
votes
2
answers
144
views
Token transfer not dropped no event on MetaMask
I am using the following contract
Fixed Contract Example
And using this example to transfer token
Transfer token example
Everything goes fine, i see no error what so ever except MetaMask doesn't ...
0
votes
2
answers
499
views
Golang - alloc large Wei amount to address
Im modifying the puppeth genesis wizard file for my own use case. I want to be able to assign a pre-set amount in Wei to a few chosen addresses..
Im having some trouble figuring out how to format the ...
1
vote
1
answer
2k
views
Golang How to slice Ethereum log events from smart contract to a more readable format
Im looking to use a channel to watch contract log events but the output returns a byte array like this
the go code i am using looks like this
package main
import (
"...
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 :...
2
votes
1
answer
1k
views
Cannot get transaction's field "From" using Golang
How I can get transaction's field "From"?
client, err := ethclient.Dial("https://mainnet.infura.io")
if err != nil {
log.Fatal(err)
}
blockNumber := big.NewInt(5671744)
block, err := client....
2
votes
1
answer
3k
views
ethereumjs-abi equivalent for Golang?
ethereumjs-abi is great for easily ABI encoding and decoding in javascript. Is there an equivalently simple package for Golang?
Geth's accounts/abipackage does this, but there's a lot of setup and it'...
1
vote
1
answer
687
views
Is it possible to get bytecode from the evm in golang?
Imagine this scenario, I have a contract that has a function where I call with runtime.Call().
But this function returns an address of a newly created contract, but not the bytecode as runtime.Create ...
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 ...
0
votes
1
answer
3k
views
go-ethereum event subscriptions doesn't work?
I'm new to go-ethereum and even Golang in general so my terminology might be wrong, I'm guessing event handling is also referred to as "subscription"? Anyways, my actual issue is that I want to test ...