Last active
March 13, 2018 18:50
-
-
Save jcbombardelli/674d5b19e47e8746189f3fe87cc4f88a to your computer and use it in GitHub Desktop.
Código para executar transação entre carteiras usando o Geth do EthereumClassic
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ethereum | |
import ( | |
"fmt" | |
"time" | |
web3 "github.com/regcostajr/go-web3" | |
) | |
func main() { | |
web3Client := web3.NewWeb3(providers.NewHTTPProvider("http://127.0.0.1:8545)) | |
client = web3Client | |
from = "" | |
pass = "" | |
_, err := client.Personal.UnlockAccount(from, pass, 0) | |
if err != nil { | |
fmt.Println(err.Error(), "unlock account") | |
} | |
hash, err := rpc.client.Eth.SendTransaction(from, from, 1, "registroSucesso") | |
fmt.Println(hash) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment