func (l *LevelDB) GetConfig() (*types.ClusterConfig, *types.Metadata, error) {
	configSerialized, metadata, err := l.Get(worldstate.ConfigDBName, worldstate.ConfigKey)
	if err != nil {
		return nil, nil, err
	}
	config := &types.ClusterConfig{}
	if err := proto.Unmarshal(configSerialized, config); err != nil {
		return nil, nil, errors.Wrap(err, "error while unmarshaling committed cluster configuration")
	}
	return config, metadata, nil
}
GetConfig returns the cluster configuration
package leveldb
import (
	"bytes"
	"encoding/binary"
	"fmt"
	"os"
	"path/filepath"
	"time"
	"github.com/golang/protobuf/proto"
	"github.com/hyperledger-labs/orion-server/internal/worldstate"
	"github.com/hyperledger-labs/orion-server/pkg/types"
	"github.com/pkg/errors"
	"github.com/syndtr/goleveldb/leveldb"
	"github.com/syndtr/goleveldb/leveldb/opt"
	"github.com/syndtr/goleveldb/leveldb/util"
)
var (
	lastCommittedBlockNumberKey = []byte("lastCommittedBlockNumber")
)
func (l *LevelDB) Exist(dbName string) bool {
	l.dbsList.RLock()
	defer l.dbsList.RUnlock()
	_, ok := l.dbs[dbName]
	return ok
}
func (l *LevelDB) ListDBs() []string {
	l.dbsList.RLock()
	defer l.dbsList.RUnlock()
	dbsToExclude := make(map[string]struct{})
	for _, name := range preCreateDBs {
		dbsToExclude[name] = struct{}{}
	}
	var dbNames []string
	for name := range l.dbs {
		if _, ok := dbsToExclude[name]; ok {
			continue
		}
		dbNames = append(dbNames, name)
	}
	return dbNames
}
func (l *LevelDB) Height() (uint64, error) {
	l.dbsList.RLock()
	defer l.dbsList.RUnlock()
	db, ok := l.dbs[worldstate.MetadataDBName]
	if !ok {
		return 0, errors.Errorf("unable to retrieve the state database height due to missing metadataDB")
	}
	db.mu.RLock()
	defer db.mu.RUnlock()
	blockNumberEnc, err := db.file.Get(lastCommittedBlockNumberKey, &opt.ReadOptions{})
	if err != nil && err != leveldb.ErrNotFound {
		return 0, errors.Wrap(err, "error while retrieving the state database height")
	}
	if err == leveldb.ErrNotFound {
		return 0, nil
	}
	blockNumberDec, err := binary.ReadUvarint(bytes.NewBuffer(blockNumberEnc))
	if err != nil {
		return 0, errors.Wrap(err, "error while decoding the stored height")
	}
	return blockNumberDec, nil
}
func (l *LevelDB) Get(dbName string, key string) ([]byte, *types.Metadata, error) {
	l.dbsList.RLock()
	defer l.dbsList.RUnlock()
	db, ok := l.dbs[dbName]
	if !ok {
		return nil, nil, &DBNotFoundErr{
			dbName: dbName,
		}
	}
	db.mu.RLock()
	defer db.mu.RUnlock()
	dbval, err := db.file.Get([]byte(key), db.readOpts)
	if err == leveldb.ErrNotFound {
		return nil, nil, nil
	}
	if err != nil {
		return nil, nil, errors.WithMessagef(err, "failed to retrieve leveldb key [%s] from database %s", key, dbName)
	}
	persisted := &types.ValueWithMetadata{}
	if err := proto.Unmarshal(dbval, persisted); err != nil {
		return nil, nil, err
	}
	return persisted.Value, persisted.Metadata, nil
}
func (l *LevelDB) GetVersion(dbName string, key string) (*types.Version, error) {
	_, metadata, err := l.Get(dbName, key)
	if err != nil {
		return nil, err
	}
	return metadata.GetVersion(), nil
}
func (l *LevelDB) GetACL(dbName, key string) (*types.AccessControl, error) {
	_, metadata, err := l.Get(dbName, key)
	if err != nil {
		return nil, err
	}
	return metadata.GetAccessControl(), nil
}
func (l *LevelDB) Has(dbName, key string) (bool, error) {
	l.dbsList.RLock()
	db := l.dbs[dbName]
	l.dbsList.RUnlock()
	return db.file.Has([]byte(key), nil)
}