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.

22 lines
481 B

9 years ago
8 years ago
8 years ago
9 years ago
8 years ago
9 years ago
9 years ago
9 years ago
  1. package server
  2. import (
  3. "fmt"
  4. "github.com/tendermint/abci/types"
  5. cmn "github.com/tendermint/go-common"
  6. )
  7. func NewServer(protoAddr, transport string, app types.Application) (cmn.Service, error) {
  8. var s cmn.Service
  9. var err error
  10. switch transport {
  11. case "socket":
  12. s, err = NewSocketServer(protoAddr, app)
  13. case "grpc":
  14. s, err = NewGRPCServer(protoAddr, types.NewGRPCApplication(app))
  15. default:
  16. err = fmt.Errorf("Unknown server type %s", transport)
  17. }
  18. return s, err
  19. }