Enable Tx Indexing on Vochain
It seems that the transaction config does not enable transaction indexing on the Vochain. I'm unable to receive any transactions when querying the tendermint tx_search rpc. Example:
natewilliams:vocexplorer 🐓 websocat wss://gw2.dev.vocdoni.net/tendermint
{"jsonrpc":"2.0","id":108,"method":"tx_search","params":{"order_by":"asc","page":"1","per_page":"1","prove":false,"query":"tx.height > 0 AND tx.height < 100000"}}
{ "jsonrpc": "2.0", "id": 108, "result": { "txs": [], "total_count": "0" } }
I'm pretty sure that this is caused by the fact that we use the default TxIndexConfig which seems to only enable indexing by key/value, ie by hash. (This is consistent with being able to query txs by hash).
@jordipainan you seem to have removed any explicit setting of TxIndexConfig in cc0661c9. Is there a specific reason for that?
I propose we add the following to vochain/start.go:
tconfig.TxIndex.IndexAllKeys = true
or
tconfig.TxIndex.IndexKeys = "tx.height"
It's hard to find a clear documentation that the TxIndexConfig index keys can disable the tx_search query.. evidence of the relationship is here: https://github.com/tendermint/tendermint/issues/4544 and here: https://github.com/tendermint/tendermint/issues/3812