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.

32 lines
884 B

  1. /*
  2. grpcdb is the distribution of Tendermint's db.DB instances using
  3. the gRPC transport to decouple local db.DB usages from applications,
  4. to using them over a network in a highly performant manner.
  5. grpcdb allows users to initialize a database's server like
  6. they would locally and invoke the respective methods of db.DB.
  7. Most users shouldn't use this package, but should instead use
  8. remotedb. Only the lower level users and database server deployers
  9. should use it, for functionality such as:
  10. ln, err := net.Listen("tcp", "0.0.0.0:0")
  11. srv := grpcdb.NewServer()
  12. defer srv.Stop()
  13. go func() {
  14. if err := srv.Serve(ln); err != nil {
  15. t.Fatalf("BindServer: %v", err)
  16. }
  17. }()
  18. or
  19. addr := ":8998"
  20. cert := "server.crt"
  21. key := "server.key"
  22. go func() {
  23. if err := grpcdb.ListenAndServe(addr, cert, key); err != nil {
  24. log.Fatalf("BindServer: %v", err)
  25. }
  26. }()
  27. */
  28. package grpcdb