Skip to main content

All Questions

Tagged with or
Filter by
Sorted by
Tagged with
30 votes
2 answers
5k views

What is the merit of creating new smart contract languages like Solidity instead of using other languages?

What is the pros and cons of creating new languages like Solidity for smart contracts instead of using other computer languages like Golang or Python?
Satoshi Nakanishi's user avatar
13 votes
5 answers
23k views

why did it returned null after call miner.start()

> miner.start() > null before it , I had created a account like this . user1 = eth.accounts[0] "0xb62f0bae52d153365661c4e23ab1d594484e9bef"
Mike's user avatar
  • 131
11 votes
6 answers
16k views

How to decode input data with ABI using golang?

There is a tool on npm ethereum-input-data-decoder. And yes, i can read input data as hex. And i hope that i can decode transaction's inputdata using golang. For example ...
hundred lee's user avatar
10 votes
2 answers
5k views

Raw transaction data in Go

I would like to generate raw transactions in golang without any go binding and I'm wondering if there is library to dynamically encode my argument parameter using go? https://github.com/ethereum/wiki/...
rawEth's user avatar
  • 101
8 votes
2 answers
6k views

LevelDB in Geth, key and values

When parsing through the levelDB or RocksDB (Depending on the client you are using) there are string values representing the key and the value. These are both stored as Byte arrays as well. My ...
Fortune's user avatar
  • 532
8 votes
4 answers
10k views

How to decode Log.Data in Go

I'm fetching the logs using client.SubscribeFilterLogs. The event parameters are encoded in types.Log.Data. How can I decode it in go?
Robert Zaremba'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
7 votes
2 answers
3k views

What's the best way currently to get events to a Go app that uses go-ethereum?

I have generated and used Go bindings to deploy a few contracts and that worked very well, but I see events are not implemented yet. Is this work discussed somewhere? I'd like to understand what ...
murrekatt's user avatar
  • 261
6 votes
3 answers
7k views

Go Ethereum - get the enode before starting geth

I need to get the enode of my geth nodes before I start them up.. is there any way to do this via a command other than actually starting up the node ?
Gizzard's user avatar
  • 73
6 votes
2 answers
4k views

How to communicate with the JSON RPC server programmatically using Go?

Is there a way to interact with the JSON RPC server directly in Go? I tried the following: Starting the RPC Server with "geth --rpc" Running the following code: package main import ( "fmt" ...
MethDamon's user avatar
  • 803
5 votes
2 answers
4k views

Ethereum HD Wallet implementation in Golang, is there any library in go?

I need a library in golang to implement HD Wallet.
Sumit Sahu's user avatar
5 votes
3 answers
5k views

Validating Go Ethereum key signature with ecrecover

Resolved The basic process flow of what I'm writing goes as follows. Sign a message with a private key and create an Ethereum address from the private key (AKA the vettingAddress) Pass the signature ...
Samuel Hawksby-Robinson's user avatar
5 votes
2 answers
10k views

How generate number type uint256 in Go

My smart contract has a function like this function setTest(uint256 test) returns (bool){ testNumber = test; return true; } I used these piece of code Go to create a transaction to set new ...
Gin's user avatar
  • 51
5 votes
1 answer
3k views

ethereum-go how to get the latest block?

I've set up a private local Ethereum node with just a genesis block I made, and I have this Go code I want to run on the private local network: package main import ( "fmt" "math/...
thanos's user avatar
  • 854
4 votes
2 answers
851 views

How can we implement a new opcode in the Ethereum Virtual Machine.

How can we implement a new opcode in the Ethereum Virtual Machine. For eg : I want to implement an opcode logic such that the opcode number of this operation is 0x21. The EVM-implementation I am using ...
V.Agarwal's user avatar
4 votes
2 answers
8k views

Convert byte Address to Hex

Using Geth I am reading from a smart contract and a list of addresses is retrieved when outputting to the terminal. These addresses are in byte array format: fmt.printLn("address", address) output = ...
Kravitz's user avatar
  • 447
4 votes
2 answers
8k views

Unable to generate Go Ethereum Bindings using abigen

Not sure what the heck is going on, but I'm unable to use abigen to generate Go Ethereum bindings any more, I get an error that says EvalSymlinks: too many links solidity@pop-os:~/Documents/Code/...
hextet's user avatar
  • 1,593
4 votes
2 answers
4k views

How to validate an etherum address (go)?

I'm looping through various addresses and I need to know which ones are BTC addresses and which are ETH addresses. So far I just check if the address is hex encoded. Is this function safe to use? ...
Books's user avatar
  • 181
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
4 votes
1 answer
965 views

Convert pem public key into ethereum address by Go

I have ECC_SECG_P256K1 Public key PEM File generated by AWS KMS. I want to convert pem public key into ethereum address by Go. How can I get it? Sample Pem Data -----BEGIN PUBLIC KEY----- ...
takumi's user avatar
  • 41
4 votes
2 answers
10k views

What's the difference between using Golang and writing code in Solidity to create a decentralized application?

I've been working on creating my first decentralized application, and I'm currently working on this tutorial which attempts to create a decentralized version of Twitter. I want to integrate an IPFS ...
Evan's user avatar
  • 41
3 votes
4 answers
10k views

Decode raw transaction

How can I decode a raw transaction using Go / go-ethereum ? There is no method/function to read the raw bytes or the hex into a transaction https://godoc.org/github.com/ethereum/go-ethereum/core/types ...
Books's user avatar
  • 181
3 votes
2 answers
1k views

Geth 1.6.1 hangs throwing "unexpected fault address" fatal error

Since upgraded to version 1.6.1, Geth node hangs form time to time (once a week) with following fatal error: fatal error: fault [signal SIGSEGV: segmentation violation code=0x1 addr=0x7f6453b72c88 pc=...
Juan Ignacio Pérez Sacristán's user avatar
3 votes
1 answer
2k views

Dangling hash node ref: too many open files

I'm running two supernodes with the geth client. At peak times they have 500-800 connections and handle around 16GB traffic per hour. This is how I run the node: geth --networkid "1" --identity "...
q9f's user avatar
  • 33k
3 votes
1 answer
481 views

Are there Ethereum API wrappers?

I'm looking into developing some Go software on Ethereum and I'm wondering - are there any API wrappers around for Ethereum (something like BTCSuite's BTCRPCClient is for Bitcoin)? I know there is a ...
ThePiachu's user avatar
  • 562
3 votes
1 answer
2k views

Is it possible to include Go code in a Solidity contract?

I've learned Solidity first and now I am learning the Go language. Throughout my learning process I am noticing that both languages are very similar. So, is it possible in future to include Go code in ...
Sig Touri's user avatar
  • 1,090
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
3 votes
2 answers
1k views

Using home brew to install ethereum but it keeps returning a make error

I am using home brew to install ethereum but it keeps returning this error. Is there anyway I can fix it?
iivri  andre'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
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
3 votes
1 answer
581 views

Can I generate multiple wallet addresses using one keystore?

I am trying to generate multiple wallet addresses using single keystore file. Can someone please advise me if it is possible? OR one keystore can only have one wallet address? I generate keystore and ...
Sallu's user avatar
  • 175
3 votes
1 answer
913 views

send a tx, json rpc, golang

I tried to send a tx via geth json rpc using the following code. But the geth rpc server response with "Invalid sender". I also tried HomesteadSigner. In that case there is no error received, but I ...
Kevin Chow's user avatar
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
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
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(...
Chipe's user avatar
  • 259
2 votes
2 answers
1k views

type *types.Transaction has no field or method AsMessage)

I am following https://github.com/miguelmota/ethereum-development-with-go-book/tree/master/en/transaction-query Complete code package main import ( "context" "fmt" &...
pigfox's user avatar
  • 167
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 := ...
Chipe's user avatar
  • 259
2 votes
3 answers
479 views

How to implement the below solidity code in golang? especially the `abi.encode` function?

How to implement the below solidity code in golang? especially the abi.encode function? abi.encode( keccak256("delegate(address sender,string amount, string to)"), sender, amount,...
Daniel Moore's user avatar
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 = '...
Juan Ignacio Pérez Sacristán's user avatar
2 votes
1 answer
2k views

From golang sha3 to solidity sha3

Trying to match "golang.org/x/crypto/sha3" lib with solidity sha3() is giving me a hard time. Its been discussed in here, but I somehow cant apply it in go. How do I handle a big.Int type s.t i get ...
hannes's user avatar
  • 21
2 votes
1 answer
3k views

How to properly estimate gas costs of function calls with go-ethereum and golang?

I'm attempting to build out a program in golang to model ethereum gas costs of function calls for the smart contracts I write. I've successfully been able to estimate them using ethclient.EstimateGas ...
hextet's user avatar
  • 1,593
2 votes
1 answer
693 views

How to get Code from Contract Acccount?

I have a piece of code that connects to the network and displays transaction data. package main import ( "context" "fmt" "log" "github.com/ethereum/go-ethereum/common" "github....
EricEnticman's user avatar
2 votes
1 answer
1k views

Go can't find common and types package when building Geth client node project?

I am trying to build the Ethereum Geth client node on an Ubuntu 14.04 LTS box. I am using the 2017.3 Goland client. When I try to compile the project I get the errors below: interfaces.go:25:2: ...
Robert Oschler's user avatar
2 votes
1 answer
555 views

error when getting TransactionReceipt from parity node with ethereum-go

In my golang oracle, I need to get the TransactionReceipt for my transaction. To do so I call client.TransactionReceipt(context.TODO(), txHash) This yields a transaction receipt when the node is ...
Micha Roon's user avatar
  • 2,223
2 votes
1 answer
132 views

How to correctly pack Log data in Go

Using go-ethereum, I want to convert a struct containing my log fields into a types.Log{} object containing the data bytes and topics. Essentially, I want to do the opposite of the Parse<EventName&...
Ryan Collingham's user avatar

1
2 3 4 5