Skip to content

Commit

Permalink
Add HA leader/follower election manager (#182)
Browse files Browse the repository at this point in the history
  • Loading branch information
wanliqun authored Apr 11, 2024
1 parent bbb1724 commit d1bf875
Show file tree
Hide file tree
Showing 4 changed files with 375 additions and 4 deletions.
13 changes: 13 additions & 0 deletions config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,19 @@ sync:
# # Maximum number of blocks to batch sync ETH data once
# maxBlocks: 10

# # HA leader/follower election.
# election:
# # Enable/disable leader election
# enabled: false
# # The leader identity
# id: "leader"
# # The duration of the leader term
# lease: 1m
# # the amount of time to wait between retries of becoming the leader
# retry: 5s
# # the time interval at which the leader will try to renew its term
# renew: 15s

# # Metrics configurations
# metrics:
# # Whether to collect metrics
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ go 1.22

require (
github.com/Conflux-Chain/go-conflux-sdk v1.5.9
github.com/Conflux-Chain/go-conflux-util v0.2.0
github.com/Conflux-Chain/go-conflux-util v0.2.1-0.20240401035823-007ed13c1155
github.com/Conflux-Chain/web3pay-service v0.0.0-20230609030113-dc3c4d42820a
github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce
github.com/buraksezer/consistent v0.9.0
github.com/cespare/xxhash v1.1.0
github.com/ethereum/go-ethereum v1.10.15
github.com/go-redis/redis/v8 v8.8.2
github.com/go-sql-driver/mysql v1.6.0
github.com/google/uuid v1.3.0
github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d
github.com/montanaflynn/stats v0.6.6
github.com/openweb3/go-rpc-provider v0.3.3-0.20240314082803-8ee6dd0c7e4f
Expand Down Expand Up @@ -58,7 +59,6 @@ require (
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/go-cmp v0.5.7 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/hashicorp/go-bexpr v0.1.10 // indirect
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ github.com/Conflux-Chain/go-conflux-sdk v1.0.29/go.mod h1:eUYR736AUkH29rjeiPCLR2
github.com/Conflux-Chain/go-conflux-sdk v1.5.9 h1:S61iF4G+uicWJ+k62FDpfCvUciBkKEhWPhPAzWY/yhI=
github.com/Conflux-Chain/go-conflux-sdk v1.5.9/go.mod h1:L1DiAH5zBCZmA4Eq/XLC3JA3d5ecaPczhqrSzk6y+XA=
github.com/Conflux-Chain/go-conflux-util v0.0.0-20220907035343-2d1233bccd70/go.mod h1:dcfcQp/A6V0nu9LLqdcg8yv+lSg378JktLtuPUVcm4k=
github.com/Conflux-Chain/go-conflux-util v0.2.0 h1:Eie1A6so5oSDGeSOzKi+qwOGpJDQHmAELkga6OYs+HY=
github.com/Conflux-Chain/go-conflux-util v0.2.0/go.mod h1:8WdtAuUTRWLDPnyUgAqw5WPr6hM+WCp4R857nFc1l04=
github.com/Conflux-Chain/go-conflux-util v0.2.1-0.20240401035823-007ed13c1155 h1:4R2nwLTqzFOhDd+GB7EFYcj22r8927m9aK4auwI2V1A=
github.com/Conflux-Chain/go-conflux-util v0.2.1-0.20240401035823-007ed13c1155/go.mod h1:8WdtAuUTRWLDPnyUgAqw5WPr6hM+WCp4R857nFc1l04=
github.com/Conflux-Chain/web3pay-service v0.0.0-20230609030113-dc3c4d42820a h1:3Rr/2Z/dCXx1PVh+VQns/R8f8niJ2jvWMViSGHPupJg=
github.com/Conflux-Chain/web3pay-service v0.0.0-20230609030113-dc3c4d42820a/go.mod h1:YCr1LGh6g2mgceQ5K+YBLxWK1Ahq2IgdTDoeZkXbgBY=
github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM=
Expand Down
Loading

0 comments on commit d1bf875

Please sign in to comment.