func SaveConfig(p *persist.Persist, c *ConsensusConfig) error { craw, err := proto.Marshal(c) if err != nil { return err } err = p.StoreState("config", craw) return err }
func RestoreConfig(p *persist.Persist) (*ConsensusConfig, error) { raw, err := p.ReadState("config") if err != nil { return nil, err } config := &ConsensusConfig{} err = proto.Unmarshal(raw, config) if err != nil { return nil, err } return config, nil }