mirror of
https://github.com/eosswedenorg/thalos
synced 2026-06-16 04:24:56 +02:00
Update github.com/eosswedenorg-go/antelope-ship-client to v0.2.2
This commit is contained in:
parent
788cc2621e
commit
82dce9b190
4 changed files with 13 additions and 10 deletions
|
|
@ -15,10 +15,10 @@ import (
|
|||
type ShipProcessor struct {
|
||||
abi *abi.AbiManager
|
||||
publisher transport.Publisher
|
||||
shClient *shipclient.ShipClient
|
||||
shClient *shipclient.Client
|
||||
}
|
||||
|
||||
func SpawnProccessor(shClient *shipclient.ShipClient, publisher transport.Publisher, abi *abi.AbiManager) {
|
||||
func SpawnProccessor(shClient *shipclient.Client, publisher transport.Publisher, abi *abi.AbiManager) {
|
||||
processor := &ShipProcessor{
|
||||
abi: abi,
|
||||
publisher: publisher,
|
||||
|
|
|
|||
2
go.mod
2
go.mod
|
|
@ -4,7 +4,7 @@ go 1.18
|
|||
|
||||
require (
|
||||
github.com/eoscanada/eos-go v0.10.3-0.20221117104514-64cafd714c60
|
||||
github.com/eosswedenorg-go/antelope-ship-client v0.2.0
|
||||
github.com/eosswedenorg-go/antelope-ship-client v0.2.2
|
||||
github.com/eosswedenorg-go/pid v1.0.1
|
||||
github.com/go-redis/cache/v8 v8.4.4
|
||||
github.com/go-redis/redis/v8 v8.11.6-0.20220405070650-99c79f7041fc
|
||||
|
|
|
|||
4
go.sum
4
go.sum
|
|
@ -26,8 +26,8 @@ github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/r
|
|||
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc=
|
||||
github.com/eoscanada/eos-go v0.10.3-0.20221117104514-64cafd714c60 h1:ARNYziHaKCrqe0S6DpQqEPVKGhdEr18iBRlbd/LHlPw=
|
||||
github.com/eoscanada/eos-go v0.10.3-0.20221117104514-64cafd714c60/go.mod h1:oZfBd71yux4P7WrWYy/AvtGCjAP38bBP7z/keeu15A0=
|
||||
github.com/eosswedenorg-go/antelope-ship-client v0.2.0 h1:alZ5eROs7RNKp0skRFT1QfDt9d1HpUxzkeF2y3z3L1g=
|
||||
github.com/eosswedenorg-go/antelope-ship-client v0.2.0/go.mod h1:/DTza5QuczvTtXYxBjHt4GDFHnXS2rBMUVJ/sxRt/jE=
|
||||
github.com/eosswedenorg-go/antelope-ship-client v0.2.2 h1:eFj1gczfiueuLelo7H1PGKDaGMDxc0n5xtYfKvda5Es=
|
||||
github.com/eosswedenorg-go/antelope-ship-client v0.2.2/go.mod h1:/DTza5QuczvTtXYxBjHt4GDFHnXS2rBMUVJ/sxRt/jE=
|
||||
github.com/eosswedenorg-go/pid v1.0.1 h1:W4AEnnNwb041SpNR1uTZ/KbJ0OTA5eqiqIR1Q5Ah6A0=
|
||||
github.com/eosswedenorg-go/pid v1.0.1/go.mod h1:wiOB/JXGt4YA3+T0j0xmCGSc3Jxzb7Ti/Ftli1fgWu4=
|
||||
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
|
||||
|
|
|
|||
13
main.go
13
main.go
|
|
@ -32,7 +32,7 @@ import (
|
|||
|
||||
var conf config.Config
|
||||
|
||||
var shClient *shipclient.ShipClient
|
||||
var shClient *shipclient.Client
|
||||
|
||||
// Reader states
|
||||
const (
|
||||
|
|
@ -79,7 +79,7 @@ func readerLoop() {
|
|||
case RS_READ:
|
||||
err := shClient.Read()
|
||||
if err != nil {
|
||||
if shErr, ok := err.(shipclient.ShipClientError); ok {
|
||||
if shErr, ok := err.(shipclient.ClientError); ok {
|
||||
|
||||
// Bail out if socket is closed
|
||||
if shErr.Type == shipclient.ErrSockClosed {
|
||||
|
|
@ -119,7 +119,7 @@ func run() {
|
|||
}
|
||||
|
||||
// Cleanly close the connection by sending a close message.
|
||||
err := shClient.SendCloseMessage()
|
||||
err := shClient.Shutdown()
|
||||
if err != nil {
|
||||
log.WithError(err).Info("failed to send close message to ship server")
|
||||
}
|
||||
|
|
@ -198,7 +198,6 @@ func main() {
|
|||
return
|
||||
}
|
||||
|
||||
// Connect client and get chain info.
|
||||
log.Printf("Get chain info from api at: %s", conf.Api)
|
||||
eosClient := eos.New(conf.Api)
|
||||
chainInfo, err = eosClient.GetInfo(context.Background())
|
||||
|
|
@ -215,7 +214,11 @@ func main() {
|
|||
}
|
||||
}
|
||||
|
||||
shClient = shipclient.NewClient(conf.StartBlockNum, conf.EndBlockNum, conf.IrreversibleOnly)
|
||||
shClient = shipclient.NewClient(func(c *shipclient.Client) {
|
||||
c.StartBlock = conf.StartBlockNum
|
||||
c.EndBlock = conf.EndBlockNum
|
||||
c.IrreversibleOnly = conf.IrreversibleOnly
|
||||
})
|
||||
|
||||
app.SpawnProccessor(
|
||||
shClient,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue