mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-06 01:32:18 +00:00
9614c81228
Former-commit-id: 54da8e259e6abae30c61dc6301cbfeeb0ede8570 [formerly 31f207fb38d4a1699dc60c294cf99a1673b54ab7] Former-commit-id: c70fc84a836a6b03bcaf07b5fe7a9eb5c116e0da
34 lines
606 B
Go
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
|
|
|
|
}
|