Skip to content

Commit

Permalink
Introduce light node & refactor RPC client (cosmos#681)
Browse files Browse the repository at this point in the history
* introduce light node
* add config option to start light node
* refactor `rpc/server.go/Server` to accept the `tendermint/rpc/client` interface

Closes cosmos#662; Closes cosmos#663; Closes cosmos#664; Closes cosmos#682.

Co-authored-by: Connor O'Hara <[email protected]>
  • Loading branch information
S1nus and Connor O'Hara committed Jan 19, 2023
1 parent d8679cc commit 008281c
Show file tree
Hide file tree
Showing 13 changed files with 726 additions and 500 deletions.
4 changes: 4 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const (
flagDAStartHeight = "rollmint.da_start_height"
flagNamespaceID = "rollmint.namespace_id"
flagFraudProofs = "rollmint.experimental_insecure_fraud_proofs"
flagLight = "rollmint.light"
)

// NodeConfig stores rollmint node configuration.
Expand All @@ -33,6 +34,7 @@ type NodeConfig struct {
BlockManagerConfig `mapstructure:",squash"`
DALayer string `mapstructure:"da_layer"`
DAConfig string `mapstructure:"da_config"`
Light bool `mapstructure:"light"`
}

// BlockManagerConfig consists of all parameters required by BlockManagerConfig
Expand All @@ -59,6 +61,7 @@ func (nc *NodeConfig) GetViperConfig(v *viper.Viper) error {
nc.BlockTime = v.GetDuration(flagBlockTime)
nsID := v.GetString(flagNamespaceID)
nc.FraudProofs = v.GetBool(flagFraudProofs)
nc.Light = v.GetBool(flagLight)
bytes, err := hex.DecodeString(nsID)
if err != nil {
return err
Expand All @@ -80,4 +83,5 @@ func AddFlags(cmd *cobra.Command) {
cmd.Flags().Uint64(flagDAStartHeight, def.DAStartHeight, "starting DA block height (for syncing)")
cmd.Flags().BytesHex(flagNamespaceID, def.NamespaceID[:], "namespace identifies (8 bytes in hex)")
cmd.Flags().Bool(flagFraudProofs, def.FraudProofs, "enable fraud proofs (experimental & insecure)")
cmd.Flags().Bool(flagLight, def.Light, "run light client")
}
1 change: 1 addition & 0 deletions config/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ var DefaultNodeConfig = NodeConfig{
},
DALayer: "mock",
DAConfig: "",
Light: false,
}
Loading

0 comments on commit 008281c

Please sign in to comment.