mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-08 06:15:33 +00:00
config: default indexer configuration to null (#8222)
After this change, new nodes will not have indexing enabled by default. Test configurations will still use "kv". * Update pending changelog and upgrading notes. * Fix indexer config for the test app. * Update config template and enable indexing for e2e tests.
This commit is contained in:
@@ -20,6 +20,7 @@ Special thanks to external contributors on this release:
|
||||
- [config] \#7930 Add new event subscription options and defaults. (@creachadair)
|
||||
- [rpc] \#7982 Add new Events interface and deprecate Subscribe. (@creachadair)
|
||||
- [cli] \#8081 make the reset command safe to use. (@marbar3778)
|
||||
- [config] \#8222 default indexer configuration to null. (@creachadair)
|
||||
|
||||
- Apps
|
||||
|
||||
|
||||
@@ -26,6 +26,13 @@ application concern so be very sure to test the application thoroughly
|
||||
using realistic workloads and the race detector to ensure your
|
||||
applications remains correct.
|
||||
|
||||
### Config Changes
|
||||
|
||||
The default configuration for a newly-created node now disables indexing for
|
||||
ABCI event metadata. Existing node configurations that already have indexing
|
||||
turned on are not affected. Operators who wish to enable indexing for a new
|
||||
node, however, must now edit the `config.toml` explicitly.
|
||||
|
||||
### RPC Changes
|
||||
|
||||
Tendermint v0.36 adds a new RPC event subscription API. The existing event
|
||||
|
||||
@@ -1088,9 +1088,8 @@ type TxIndexConfig struct {
|
||||
// If list contains `null`, meaning no indexer service will be used.
|
||||
//
|
||||
// Options:
|
||||
// 1) "null" - no indexer services.
|
||||
// 2) "kv" (default) - the simplest possible indexer,
|
||||
// backed by key-value storage (defaults to levelDB; see DBBackend).
|
||||
// 1) "null" (default) - no indexer services.
|
||||
// 2) "kv" - a simple indexer backed by key-value storage (see DBBackend)
|
||||
// 3) "psql" - the indexer services backed by PostgreSQL.
|
||||
Indexer []string `mapstructure:"indexer"`
|
||||
|
||||
@@ -1101,14 +1100,12 @@ type TxIndexConfig struct {
|
||||
|
||||
// DefaultTxIndexConfig returns a default configuration for the transaction indexer.
|
||||
func DefaultTxIndexConfig() *TxIndexConfig {
|
||||
return &TxIndexConfig{
|
||||
Indexer: []string{"kv"},
|
||||
}
|
||||
return &TxIndexConfig{Indexer: []string{"null"}}
|
||||
}
|
||||
|
||||
// TestTxIndexConfig returns a default configuration for the transaction indexer.
|
||||
func TestTxIndexConfig() *TxIndexConfig {
|
||||
return DefaultTxIndexConfig()
|
||||
return &TxIndexConfig{Indexer: []string{"kv"}}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -520,8 +520,8 @@ peer-query-maj23-sleep-duration = "{{ .Consensus.PeerQueryMaj23SleepDuration }}"
|
||||
# to decide which txs to index based on configuration set in the application.
|
||||
#
|
||||
# Options:
|
||||
# 1) "null"
|
||||
# 2) "kv" (default) - the simplest possible indexer, backed by key-value storage (defaults to levelDB; see DBBackend).
|
||||
# 1) "null" (default) - no indexer services.
|
||||
# 2) "kv" - a simple indexer backed by key-value storage (see DBBackend)
|
||||
# 3) "psql" - the indexer services backed by PostgreSQL.
|
||||
# When "kv" or "psql" is chosen "tx.height" and "tx.hash" will always be indexed.
|
||||
indexer = [{{ range $i, $e := .TxIndex.Indexer }}{{if $i}}, {{end}}{{ printf "%q" $e}}{{end}}]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#! /bin/bash
|
||||
set -ex
|
||||
#!/bin/bash
|
||||
set -exo pipefail
|
||||
|
||||
#- kvstore over socket, curl
|
||||
|
||||
@@ -8,9 +8,19 @@ set -ex
|
||||
export PATH="$GOBIN:$PATH"
|
||||
export TMHOME=$HOME/.tendermint_app
|
||||
|
||||
function kvstore_over_socket(){
|
||||
rm -rf $TMHOME
|
||||
function init_validator() {
|
||||
rm -rf -- "$TMHOME"
|
||||
tendermint init validator
|
||||
|
||||
# The default configuration sets a null indexer, but these tests require
|
||||
# indexing to be enabled. Rewrite the config file to set the "kv" indexer
|
||||
# before starting up the node.
|
||||
sed -i'' -e '/indexer = \["null"\]/c\
|
||||
indexer = ["kv"]' "$TMHOME/config/config.toml"
|
||||
}
|
||||
|
||||
function kvstore_over_socket() {
|
||||
init_validator
|
||||
echo "Starting kvstore_over_socket"
|
||||
abci-cli kvstore > /dev/null &
|
||||
pid_kvstore=$!
|
||||
@@ -25,9 +35,8 @@ function kvstore_over_socket(){
|
||||
}
|
||||
|
||||
# start tendermint first
|
||||
function kvstore_over_socket_reorder(){
|
||||
rm -rf $TMHOME
|
||||
tendermint init validator
|
||||
function kvstore_over_socket_reorder() {
|
||||
init_validator
|
||||
echo "Starting kvstore_over_socket_reorder (ie. start tendermint first)"
|
||||
tendermint start --mode validator > tendermint.log &
|
||||
pid_tendermint=$!
|
||||
@@ -42,7 +51,7 @@ function kvstore_over_socket_reorder(){
|
||||
kill -9 $pid_kvstore $pid_tendermint
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
case "$1" in
|
||||
"kvstore_over_socket")
|
||||
kvstore_over_socket
|
||||
;;
|
||||
|
||||
@@ -1,2 +1,5 @@
|
||||
[rpc]
|
||||
laddr = "tcp://0.0.0.0:26657"
|
||||
|
||||
[tx-index]
|
||||
indexer = ["kv"]
|
||||
|
||||
@@ -237,6 +237,7 @@ func MakeConfig(node *e2e.Node) (*config.Config, error) {
|
||||
cfg := config.DefaultConfig()
|
||||
cfg.Moniker = node.Name
|
||||
cfg.ProxyApp = AppAddressTCP
|
||||
cfg.TxIndex = config.TestTxIndexConfig()
|
||||
|
||||
if node.LogLevel != "" {
|
||||
cfg.LogLevel = node.LogLevel
|
||||
|
||||
Reference in New Issue
Block a user