Use rpc/client/ws_client; OnStart() returns error

This commit is contained in:
Jae Kwon
2015-08-04 18:44:15 -07:00
parent 3949d3f21d
commit e86073ec96
19 changed files with 112 additions and 97 deletions

View File

@ -75,12 +75,12 @@ func main() {
sendTx := makeRandomTransaction(10, rootAccount.Sequence+1, root, 2, accounts)
fmt.Println(sendTx)
wsClient, err := rpcclient.NewWSClient("ws://" + remote + "/websocket")
wsClient := rpcclient.NewWSClient("ws://" + remote + "/websocket")
_, err = wsClient.Start()
if err != nil {
Exit(Fmt("Failed to establish websocket connection: %v", err))
}
wsClient.Subscribe(types.EventStringAccInput(sendTx.Inputs[0].Address))
wsClient.Start()
go func() {
for {