* Add gRPC proxy * Make GRPC disabled by default * WIP on integration tests * WIP on integration tests * Start setting up in process tests * Start setting up in process tests * Make it compile * Add start server to network util * Add Println * Use go routine * Fix scopelint * Move to proxy_test * Add response type cache * Remove proxy * Tweaks * Use channel to handle error * Use error chan * Update server/start.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Use %w * Add sdk.Context * Add comments * Fix lint * Add header and tests * Address comments * Factorize some code * Fix lint * Add height and prove in req metadata * Add reflection test * Fix lint * Put grpc test in server/grpc * Update baseapp/grpcserver.go * Update baseapp/grpcserver.go * Remove proof header Co-authored-by: Amaury Martiny <amaury.martiny@protonmail.com> Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com> Co-authored-by: SaReN <sahithnarahari@gmail.com>
30 lines
514 B
Go
30 lines
514 B
Go
package server
|
|
|
|
import (
|
|
"io"
|
|
"os"
|
|
"path/filepath"
|
|
|
|
dbm "github.com/tendermint/tm-db"
|
|
|
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
)
|
|
|
|
func openDB(rootDir string) (dbm.DB, error) {
|
|
dataDir := filepath.Join(rootDir, "data")
|
|
db, err := sdk.NewLevelDB("application", dataDir)
|
|
return db, err
|
|
}
|
|
|
|
func openTraceWriter(traceWriterFile string) (w io.Writer, err error) {
|
|
if traceWriterFile != "" {
|
|
w, err = os.OpenFile(
|
|
traceWriterFile,
|
|
os.O_WRONLY|os.O_APPEND|os.O_CREATE,
|
|
0666,
|
|
)
|
|
return
|
|
}
|
|
return
|
|
}
|