You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
630 B

9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
  1. /*
  2. Package server is used to start a new ABCI server.
  3. It contains two server implementation:
  4. * gRPC server
  5. * socket server
  6. */
  7. package server
  8. import (
  9. "fmt"
  10. "github.com/tendermint/tendermint/abci/types"
  11. "github.com/tendermint/tendermint/libs/service"
  12. )
  13. func NewServer(protoAddr, transport string, app types.Application) (service.Service, error) {
  14. var s service.Service
  15. var err error
  16. switch transport {
  17. case "socket":
  18. s = NewSocketServer(protoAddr, app)
  19. case "grpc":
  20. s = NewGRPCServer(protoAddr, types.NewGRPCApplication(app))
  21. default:
  22. err = fmt.Errorf("unknown server type %s", transport)
  23. }
  24. return s, err
  25. }