Migrate TestGetEvents into a unit and a CLI test

Docker-DCO-1.1-Signed-off-by: Guilherme Salgado <gsalgado@gmail.com> (github: gsalgado)
Move truncindex in separate package in pkg/

Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
Improve truncindex benchmarks

Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
Merge pull request #6216 from gsalgado/convert-integration-tests

Convert integration/api_test:TestGetEvents into a unit test and a CLI test
Merge pull request #6648 from LK4D4/truncindex_bench

Truncindex benchmarks