1
0
Fork 0
mirror of https://github.com/eosswedenorg/thalos synced 2026-06-16 04:24:56 +02:00

config: adding Ship.EnableTableDeltas and table_deltas cli flag

This commit is contained in:
Henrik Hautakoski 2024-10-21 12:24:29 +02:00
parent ffd2504834
commit bedb8a92e8
4 changed files with 6 additions and 0 deletions

View file

@ -59,6 +59,7 @@ func NewBuilder() *Builder {
"ship.chain": "chain",
"ship.blacklist": "blacklist",
"ship.blacklist_is_whitelist": "blacklist-is-whitelist",
"ship.table_deltas": "table-deltas",
},
}
}

View file

@ -127,6 +127,7 @@ func TestBuilder_WithDefaultConfig(t *testing.T) {
StartBlockNum: shipclient.NULL_BLOCK_NUMBER,
EndBlockNum: shipclient.NULL_BLOCK_NUMBER,
MaxMessagesInFlight: 10,
EnableTableDeltas: true,
},
Redis: RedisConfig{
Addr: "127.0.0.1:6379",
@ -174,6 +175,7 @@ func TestBuilder_Flags(t *testing.T) {
require.NoError(t, flags.Set("chain", "wax"))
require.NoError(t, flags.Set("blacklist", "contract:action1,contract:action2,contract2:action1"))
require.NoError(t, flags.Set("blacklist-is-whitelist", "true"))
require.NoError(t, flags.Set("table-deltas", "false"))
cfg, err := NewBuilder().
SetSource(bytes.NewReader([]byte(``))).

View file

@ -46,6 +46,8 @@ func GetFlags() *pflag.FlagSet {
flags.Lookup("start-block").DefValue = "Config value, cache, head from api"
flags.Lookup("end-block").DefValue = "none"
flags.Bool("table-deltas", true, "True if thalos should receive and process table deltas from ship.")
flags.Bool("irreversible-only", false, "Only stream irreversible blocks from ship")
flags.Int("max-msg-in-flight", 10, "Maximum messages that can be sent from SHIP without acknowledgement")
flags.String("chain", "", "ChainID used in channel namespace, can be any string (default from api)")

View file

@ -39,6 +39,7 @@ type ShipConfig struct {
Chain string `yaml:"chain" mapstructure:"chain"`
Blacklist types.Blacklist `yaml:"blacklist" mapstructure:"blacklist"`
BlacklistIsWhitelist bool `yaml:"blacklist_is_whitelist" mapstructure:"blacklist_is_whitelist"`
EnableTableDeltas bool `yaml:"table_deltas" mapstructure:"table_deltas"`
}
type Config struct {