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 }