func NewDB(name string, dir string) (*CLevelDB, error) {
	dbPath := filepath.Join(dir, name+".db")
	opts := levigo.NewOptions()
	opts.SetCache(levigo.NewLRUCache(1 << 30))
	opts.SetCreateIfMissing(true)
	db, err := levigo.Open(dbPath, opts)
	if err != nil {
		return nil, err
	}
	ro := levigo.NewReadOptions()
	wo := levigo.NewWriteOptions()
	woSync := levigo.NewWriteOptions()
	woSync.SetSync(true)
	database := &CLevelDB{
		db:     db,
		ro:     ro,
		wo:     wo,
		woSync: woSync,
	}
	return database, nil
}
New creates a new CLevelDB.
package cleveldb
import (
	"fmt"
	"path/filepath"
	"github.com/jmhodges/levigo"
	tmdb "github.com/tendermint/tm-db"
)
type CLevelDB struct {
	db     *levigo.DB
	ro     *levigo.ReadOptions
	wo     *levigo.WriteOptions
	woSync *levigo.WriteOptions
}
var _ tmdb.DB = (*CLevelDB)(nil)