Handle events

- Adds interfaces for developers to build handlers that update data in
response to log events
- Resolves #29
This commit is contained in:
Matt Krump
2018-03-05 10:01:50 -06:00
parent ed907535e3
commit 06f78e0083
163 changed files with 586 additions and 22397 deletions
+4 -4
View File
@@ -13,13 +13,13 @@ import (
func Info(client *rpc.Client) core.Node {
node := core.Node{}
node.NetworkId = NetworkId(client)
node.NetworkID = NetworkID(client)
node.GenesisBlock = GenesisBlock(client)
node.Id, node.ClientName = IdClientName(client)
node.ID, node.ClientName = IDClientName(client)
return node
}
func IdClientName(client *rpc.Client) (string, string) {
func IDClientName(client *rpc.Client) (string, string) {
var info p2p.NodeInfo
modules, _ := client.SupportedModules()
if _, ok := modules["admin"]; ok {
@@ -29,7 +29,7 @@ func IdClientName(client *rpc.Client) (string, string) {
return "", ""
}
func NetworkId(client *rpc.Client) float64 {
func NetworkID(client *rpc.Client) float64 {
var version string
client.CallContext(context.Background(), &version, "net_version")
networkId, _ := strconv.ParseFloat(version, 64)