Skip to content

Instantly share code, notes, and snippets.

@jcbombardelli
Last active March 13, 2018 18:50
Show Gist options
  • Save jcbombardelli/674d5b19e47e8746189f3fe87cc4f88a to your computer and use it in GitHub Desktop.
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
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