Skip to content

Commit

Permalink
docs: Rename to CometBFT (tendermint#26)
Browse files Browse the repository at this point in the history
* docs: Update README

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* docs: Update contributing guidelines

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* docs: Replace how_to_release doc with RELEASES in repo root

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Remove dead links from code

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Use standard Apache 2.0 license

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Apply suggestions from code review

Co-authored-by: Sergio Mena <sergio@informal.systems>

* docs: Add fork notice to readme

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* docs: Reshuffle some links

Signed-off-by: Thane Thomson <connect@thanethomson.com>

Signed-off-by: Thane Thomson <connect@thanethomson.com>
Co-authored-by: Sergio Mena <sergio@informal.systems>
  • Loading branch information
thanethomson and sergio-mena authored Jan 17, 2023
1 parent 2f2cde9 commit 0dd0299
Show file tree
Hide file tree
Showing 7 changed files with 93 additions and 62 deletions.
9 changes: 4 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# Contributing

Thank you for your interest in contributing to tm-db!
This repository follows the [contribution guidelines] of tendermint and the corresponding [coding repo].
Please take a look if you are not already familiar with those.
Thank you for your interest in contributing to CometBFT DB! This repository
follows the [contribution guidelines] of CometBFT - please take a look if you
are not already familiar with those.

[contribution guidelines]: https://github.com/tendermint/tendermint/blob/master/CONTRIBUTING.md
[coding repo]: https://github.com/tendermint/coding
[contribution guidelines]: https://github.com/cometbft/cometbft/blob/main/CONTRIBUTING.md
5 changes: 3 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
Expand Down Expand Up @@ -178,15 +179,15 @@
APPENDIX: How to apply the Apache License to your work.

To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "{}"
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2016 All in Bits, Inc
Copyright [yyyy] [name of copyright owner]

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
93 changes: 71 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,88 @@
# Tendermint DB
# CometBFT DB

[![version](https://img.shields.io/github/tag/tendermint/tm-db.svg)](https://github.com/tendermint/tm-db/releases/latest)
[![license](https://img.shields.io/github/license/tendermint/tm-db.svg)](https://github.com/tendermint/tm-db/blob/master/LICENSE)
[![API Reference](https://camo.githubusercontent.com/915b7be44ada53c290eb157634330494ebe3e30a/68747470733a2f2f676f646f632e6f72672f6769746875622e636f6d2f676f6c616e672f6764646f3f7374617475732e737667)](https://pkg.go.dev/github.com/tendermint/tm-db)
[![codecov](https://codecov.io/gh/tendermint/tm-db/branch/master/graph/badge.svg)](https://codecov.io/gh/tendermint/tm-db)
![Lint](https://github.com/tendermint/tm-db/workflows/Lint/badge.svg?branch=master)
![Test](https://github.com/tendermint/tm-db/workflows/Test/badge.svg?branch=master)
[![Discord chat](https://img.shields.io/discord/669268347736686612.svg)](https://discord.gg/AzefAFd)
[![version](https://img.shields.io/github/tag/cometbft/cometbft-db.svg)](https://github.com/cometbft/cometbft-db/releases/latest)
[![license](https://img.shields.io/github/license/cometbft/cometbft-db.svg)](https://github.com/cometbft/cometbft-db/blob/main/LICENSE)
[![API Reference](https://camo.githubusercontent.com/915b7be44ada53c290eb157634330494ebe3e30a/68747470733a2f2f676f646f632e6f72672f6769746875622e636f6d2f676f6c616e672f6764646f3f7374617475732e737667)](https://pkg.go.dev/github.com/cometbft/cometbft-db)
[![codecov](https://codecov.io/gh/cometbft/cometbft-db/branch/main/graph/badge.svg)](https://codecov.io/gh/cometbft/cometbft-db)
![Lint](https://github.com/cometbft/cometbft-db/workflows/Lint/badge.svg?branch=main)
![Test](https://github.com/cometbft/cometbft-db/workflows/Test/badge.svg?branch=main)

Common database interface for various database backends. Primarily meant for applications built on [Tendermint](https://github.com/tendermint/tendermint), such as the [Cosmos SDK](https://github.com/cosmos/cosmos-sdk), but can be used independently of these as well.
A fork of [tm-db].

Common database interface for various database backends. Primarily meant for
applications built on [CometBFT], such as the [Cosmos SDK].

**NB:** As per [cometbft/cometbft\#48], the CometBFT team plans on eventually
totally deprecating and removing this library from CometBFT. As such, we do not
recommend depending on this library for new projects.

### Minimum Go Version

Go 1.18+

## Supported Database Backends

- **[GoLevelDB](https://github.com/syndtr/goleveldb) [stable]**: A pure Go implementation of [LevelDB](https://github.com/google/leveldb) (see below). Currently the default on-disk database used in the Cosmos SDK.

- **MemDB [stable]:** An in-memory database using [Google's B-tree package](https://github.com/google/btree). Has very high performance both for reads, writes, and range scans, but is not durable and will lose all data on process exit. Does not support transactions. Suitable for e.g. caches, working sets, and tests. Used for [IAVL](https://github.com/tendermint/iavl) working sets when the pruning strategy allows it.

- **[LevelDB](https://github.com/google/leveldb) [experimental]:** A [Go wrapper](https://github.com/jmhodges/levigo) around [LevelDB](https://github.com/google/leveldb). Uses LSM-trees for on-disk storage, which have good performance for write-heavy workloads, particularly on spinning disks, but requires periodic compaction to maintain decent read performance and reclaim disk space. Does not support transactions.
- **[GoLevelDB](https://github.com/syndtr/goleveldb) [stable]**: A pure Go
implementation of [LevelDB](https://github.com/google/leveldb) (see below).
Currently the default on-disk database used in the Cosmos SDK.

- **MemDB [stable]:** An in-memory database using [Google's B-tree
package](https://github.com/google/btree). Has very high performance both for
reads, writes, and range scans, but is not durable and will lose all data on
process exit. Does not support transactions. Suitable for e.g. caches, working
sets, and tests. Used for [IAVL](https://github.com/tendermint/iavl) working
sets when the pruning strategy allows it.

- **[LevelDB](https://github.com/google/leveldb) [experimental]:** A [Go
wrapper](https://github.com/jmhodges/levigo) around
[LevelDB](https://github.com/google/leveldb). Uses LSM-trees for on-disk
storage, which have good performance for write-heavy workloads, particularly
on spinning disks, but requires periodic compaction to maintain decent read
performance and reclaim disk space. Does not support transactions.

- **[BoltDB](https://github.com/etcd-io/bbolt) [experimental]:** A
[fork](https://github.com/etcd-io/bbolt) of
[BoltDB](https://github.com/boltdb/bolt). Uses B+trees for on-disk storage,
which have good performance for read-heavy workloads and range scans. Supports
serializable ACID transactions.

- **[RocksDB](https://github.com/tecbot/gorocksdb) [experimental]:** A [Go
wrapper](https://github.com/tecbot/gorocksdb) around
[RocksDB](https://rocksdb.org). Similarly to LevelDB (above) it uses LSM-trees
for on-disk storage, but is optimized for fast storage media such as SSDs and
memory. Supports atomic transactions, but not full ACID transactions.

- **[BadgerDB](https://github.com/dgraph-io/badger) [experimental]:** A
key-value database written as a pure-Go alternative to e.g. LevelDB and
RocksDB, with LSM-tree storage. Makes use of multiple goroutines for
performance, and includes advanced features such as serializable ACID
transactions, write batches, compression, and more.

- **[BoltDB](https://github.com/etcd-io/bbolt) [experimental]:** A [fork](https://github.com/etcd-io/bbolt) of [BoltDB](https://github.com/boltdb/bolt). Uses B+trees for on-disk storage, which have good performance for read-heavy workloads and range scans. Supports serializable ACID transactions.
## Meta-databases

- **[RocksDB](https://github.com/tecbot/gorocksdb) [experimental]:** A [Go wrapper](https://github.com/tecbot/gorocksdb) around [RocksDB](https://rocksdb.org). Similarly to LevelDB (above) it uses LSM-trees for on-disk storage, but is optimized for fast storage media such as SSDs and memory. Supports atomic transactions, but not full ACID transactions.
- **PrefixDB [stable]:** A database which wraps another database and uses a
static prefix for all keys. This allows multiple logical databases to be
stored in a common underlying databases by using different namespaces. Used by
the Cosmos SDK to give different modules their own namespaced database in a
single application database.

- **[BadgerDB](https://github.com/dgraph-io/badger) [experimental]:** A key-value database written as a pure-Go alternative to e.g. LevelDB and RocksDB, with LSM-tree storage. Makes use of multiple goroutines for performance, and includes advanced features such as serializable ACID transactions, write batches, compression, and more.
- **RemoteDB [experimental]:** A database that connects to distributed
CometBFT db instances via [gRPC](https://grpc.io/). This can help with
detaching difficult deployments such as LevelDB, and can also ease dependency
management for CometBFT developers.

## Meta-databases
## Tests

- **PrefixDB [stable]:** A database which wraps another database and uses a static prefix for all keys. This allows multiple logical databases to be stored in a common underlying databases by using different namespaces. Used by the Cosmos SDK to give different modules their own namespaced database in a single application database.
To test common databases, run `make test`. If all databases are available on the
local machine, use `make test-all` to test them all.

- **RemoteDB [experimental]:** A database that connects to distributed Tendermint db instances via [gRPC](https://grpc.io/). This can help with detaching difficult deployments such as LevelDB, and can also ease dependency management for Tendermint developers.
To test all databases within a Docker container, run:

## Tests
```bash
make docker-test
```

To test common databases, run `make test`. If all databases are available on the local machine, use `make test-all` to test them all.
[tm-db]: https://github.com/tendermint/tm-db
[CometBFT]: https://github.com/cometbft/cometbft-db
[Cosmos SDK]: https://github.com/cosmos/cosmos-sdk
[cometbft/cometbft\#48]: https://github.com/cometbft/cometbft/issues/48
15 changes: 15 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Releases

This document provides a step-by-step guide for creating a release of CometBFT
DB.

1. Create a local branch `release/vX.X.X`, where `vX.X.X` corresponds to the
version of the release you want to cut.
2. Update and build the changelog on your local release branch.
3. Submit a pull request from your release branch, targeting the `main` branch.
4. Once approved and merged, tag the commit associated with the merged release
branch.
5. Create a [GitHub release] from the new tag, and include a link from the
description to the heading associated with the new version in the changelog.

[GitHub release]: https://docs.github.com/en/github/administering-a-repository/releasing-projects-on-github/managing-releases-in-a-repository#creating-a-release
30 changes: 0 additions & 30 deletions docs/how_to_release.md

This file was deleted.

1 change: 0 additions & 1 deletion memdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ func (db *MemDB) DeleteSync(key []byte) error {
func (db *MemDB) Close() error {
// Close is a noop since for an in-memory database, we don't have a destination to flush
// contents to nor do we want any data loss on invoking Close().
// See the discussion in https://github.com/tendermint/tendermint/libs/pull/56
return nil
}

Expand Down
2 changes: 0 additions & 2 deletions remotedb/grpcdb/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ var _ protodb.DBServer = (*server)(nil)
// - fsdb
// - memdB
// - goleveldb
//
// See https://godoc.org/github.com/tendermint/tendermint/libs/db#BackendType
func (s *server) Init(ctx context.Context, in *protodb.Init) (*protodb.Entity, error) {
s.mu.Lock()
defer s.mu.Unlock()
Expand Down

0 comments on commit 0dd0299

Please sign in to comment.