prysm-pulse/sharding/collator/collator_client.go
nisdas 9614c81228 Fix RPC error and change log statement
Former-commit-id: 54da8e259e6abae30c61dc6301cbfeeb0ede8570 [formerly 31f207fb38d4a1699dc60c294cf99a1673b54ab7]
Former-commit-id: c70fc84a836a6b03bcaf07b5fe7a9eb5c116e0da
2018-03-31 14:13:51 +08:00

34 lines
606 B
Go

package collator
import (
"github.com/ethereum/go-ethereum/sharding/client"
"github.com/ethereum/go-ethereum/log"
cli "gopkg.in/urfave/cli.v1"
)
func NewCollatorClient(ctx *cli.Context) *client.ShardingClient {
c := client.MakeClient(ctx)
return c
}
func CollatorStart(sclient *client.ShardingClient) error {
log.Info("Starting collator client")
rpcClient, err := sclient.Start()
defer rpcClient.Close()
if err != nil {
return err
}
if err := joinCollatorPool(sclient); err != nil {
return err
}
if err := subscribeBlockHeaders(sclient); err != nil {
return err
}
return nil
}