diff --git a/scripts/init-simapp-v2.sh b/scripts/init-simapp-v2.sh index ca25b4f706c0..7410b2174746 100755 --- a/scripts/init-simapp-v2.sh +++ b/scripts/init-simapp-v2.sh @@ -9,7 +9,7 @@ if [ -d "$SIMD_HOME" ]; then rm -rv $SIMD_HOME; fi $SIMD_BIN config set client chain-id simapp-v2-chain $SIMD_BIN config set client keyring-backend test $SIMD_BIN config set client keyring-default-keyname alice -$SIMD_BIN config set app api.enable true +$SIMD_BIN config set app rest.enable true $SIMD_BIN keys add alice --indiscreet $SIMD_BIN keys add bob --indiscreet $SIMD_BIN init simapp-v2-node --chain-id simapp-v2-chain diff --git a/server/v2/api/rest/server.go b/server/v2/api/rest/server.go index eaa0fe8b6b94..993501c710eb 100644 --- a/server/v2/api/rest/server.go +++ b/server/v2/api/rest/server.go @@ -12,7 +12,7 @@ import ( ) const ( - ServerName = "rest-v2" + ServerName = "rest" ) type Server[T transaction.Tx] struct { diff --git a/server/v2/cometbft/internal/mock/mock_store.go b/server/v2/cometbft/internal/mock/mock_store.go index 15a47b33d639..765659ce6042 100644 --- a/server/v2/cometbft/internal/mock/mock_store.go +++ b/server/v2/cometbft/internal/mock/mock_store.go @@ -16,11 +16,11 @@ import ( ) type MockStore struct { - Storage storev2.VersionedDatabase + Storage storev2.VersionedWriter Committer storev2.Committer } -func NewMockStorage(logger log.Logger, dir string) storev2.VersionedDatabase { +func NewMockStorage(logger log.Logger, dir string) storev2.VersionedWriter { storageDB, _ := sqlite.New(dir) ss := storage.NewStorageStore(storageDB, logger) return ss @@ -36,7 +36,7 @@ func NewMockCommiter(logger log.Logger, actors ...string) storev2.Committer { return sc } -func NewMockStore(ss storev2.VersionedDatabase, sc storev2.Committer) *MockStore { +func NewMockStore(ss storev2.VersionedWriter, sc storev2.Committer) *MockStore { return &MockStore{Storage: ss, Committer: sc} } @@ -83,7 +83,7 @@ func (s *MockStore) StateAt(version uint64) (corestore.ReaderMap, error) { return NewMockReaderMap(version, s), nil } -func (s *MockStore) GetStateStorage() storev2.VersionedDatabase { +func (s *MockStore) GetStateStorage() storev2.VersionedWriter { return s.Storage } diff --git a/store/v2/mock/types.go b/store/v2/mock/types.go index a8c2a196d5bb..83eba3326f26 100644 --- a/store/v2/mock/types.go +++ b/store/v2/mock/types.go @@ -10,7 +10,7 @@ type StateCommitter interface { store.UpgradeableStore } -// StateStorage is a mock of store.VersionedDatabase +// StateStorage is a mock of store.VersionedWriter type StateStorage interface { store.VersionedWriter store.UpgradableDatabase diff --git a/store/v2/storage/README.md b/store/v2/storage/README.md index 5467bff24a05..aaffab357c30 100644 --- a/store/v2/storage/README.md +++ b/store/v2/storage/README.md @@ -2,7 +2,7 @@ The `storage` package contains the state storage (SS) implementation. Specifically, it contains RocksDB, PebbleDB, and SQLite (Btree) backend implementations of the -`VersionedDatabase` interface. +`VersionedWriter` interface. The goal of SS is to provide a modular storage backend, i.e. multiple implementations, to facilitate storing versioned raw key/value pairs in a fast embedded database, @@ -26,7 +26,7 @@ latest and historical versions efficiently. ### RocksDB The RocksDB implementation is a CGO-based SS implementation. It fully supports -the `VersionedDatabase` API and is arguably the most efficient implementation. It +the `VersionedWriter` API and is arguably the most efficient implementation. It also supports versioning out-of-the-box using User-defined Timestamps in ColumnFamilies (CF). However, it requires the CGO dependency which can complicate an app’s build process. @@ -42,7 +42,7 @@ and does not require CGO. ### SQLite (Btree) The SQLite implementation is another CGO-based SS implementation. It fully supports -the `VersionedDatabase` API. The implementation is relatively straightforward and +the `VersionedWriter` API. The implementation is relatively straightforward and easy to understand as it’s entirely SQL-based. However, benchmarks show that this options is least performant, even for reads. This SS backend has a lot of promise, but needs more benchmarking and potential SQL optimizations, like dedicated tables @@ -92,7 +92,7 @@ batch object which is committed to the underlying SS engine. An SS backend is meant to be used within a broader store implementation, as it only stores data for direct and historical query purposes. We define a `Database` -interface in the `storage` package which is mean to be represent a `VersionedDatabase` +interface in the `storage` package which is mean to be represent a `VersionedWriter` with only the necessary methods. The `StorageStore` interface is meant to wrap or accept this `Database` type, e.g. RocksDB. diff --git a/store/v2/storage/store.go b/store/v2/storage/store.go index b16ee9e7eae4..aa1095cd11aa 100644 --- a/store/v2/storage/store.go +++ b/store/v2/storage/store.go @@ -22,7 +22,7 @@ var ( _ store.UpgradableDatabase = (*StorageStore)(nil) ) -// StorageStore is a wrapper around the store.VersionedDatabase interface. +// StorageStore is a wrapper around the store.VersionedWriter interface. type StorageStore struct { logger log.Logger db Database diff --git a/tools/confix/data/v2-app.toml b/tools/confix/data/v2-app.toml index 8a35d32f543b..842dc0df561b 100644 --- a/tools/confix/data/v2-app.toml +++ b/tools/confix/data/v2-app.toml @@ -41,6 +41,12 @@ max-recv-msg-size = 10485760 # The default value is math.MaxInt32. max-send-msg-size = 2147483647 +[rest] +# Enable defines if the REST server should be enabled. +enable = true +# Address defines the REST server address to bind to. +address = 'localhost:8080' + [server] # minimum-gas-prices defines the price which a validator is willing to accept for processing a transaction. A transaction's fees must meet the minimum of any denomination specified in this config (e.g. 0.25token1;0.0001token2). minimum-gas-prices = '0stake' diff --git a/x/accounts/README.md b/x/accounts/README.md index a7490a9fcc65..9d14fd808b74 100644 --- a/x/accounts/README.md +++ b/x/accounts/README.md @@ -502,7 +502,7 @@ In order to create accounts at genesis, the `x/accounts` module allows developer a list of genesis `MsgInit` messages that will be executed in the `x/accounts` genesis flow. The init messages are generated offline. You can also use the following CLI command to generate the -json messages: `simd accounts tx init [account type] [msg] --from me --genesis`. This will generate +json messages: `simd tx accounts init [account type] [msg] --from me --genesis`. This will generate a jsonified init message wrapped in an x/accounts `MsgInit`. This follows the same initialization flow and rules that would happen if the chain is running.