### Navigate to Route Guide Example Directory Source: https://github.com/grpc/grpc.io/blob/main/content/en/docs/languages/cpp/basics.md Change to the route guide example directory after building and installing gRPC from source. ```bash cd examples/cpp/route_guide ``` -------------------------------- ### Install and Run gRPC Gateway Example Source: https://github.com/grpc/grpc.io/blob/main/content/en/blog/coreos.md Commands to install the example application and start the server. Requires a Go 1.6+ development environment. ```sh go get -u github.com/philips/grpc-gateway-example grpc-gateway-example serve ``` -------------------------------- ### Run gRPC Example Server Source: https://github.com/grpc/grpc.io/blob/main/content/en/docs/languages/python/basics.md Start the Python gRPC route guide server. Ensure this is running before starting the client. ```sh python route_guide_server.py ``` -------------------------------- ### Navigate to Example Directory Source: https://github.com/grpc/grpc.io/blob/main/content/en/docs/languages/dart/basics.md Change the current directory to the route guide example directory to run the provided client and server. ```sh cd example/route_guide ``` -------------------------------- ### Navigate to example directory Source: https://github.com/grpc/grpc.io/blob/main/content/en/docs/languages/python/basics.md Change your current directory to the route guide example directory within the cloned gRPC repository. ```sh cd grpc/examples/python/route_guide ``` -------------------------------- ### Navigate to route guide example Source: https://github.com/grpc/grpc.io/blob/main/content/en/docs/languages/ruby/basics.md Change directory to the specific Ruby route guide example within the cloned gRPC repository. ```shell cd examples/ruby/route_guide ``` -------------------------------- ### Configure Build with CMake Source: https://github.com/grpc/grpc.io/blob/main/content/en/docs/languages/cpp/basics.md Run CMake to configure the build for the route guide example, specifying the installation directory for gRPC. ```bash mkdir -p cmake/build cd cmake/build cmake -DCMAKE_PREFIX_PATH=$MY_INSTALL_DIR ../.. ``` -------------------------------- ### Run gRPC Server Source: https://github.com/grpc/grpc.io/blob/main/content/en/docs/languages/cpp/quickstart.md Start the gRPC greeter server from the example build directory. ```sh ./greeter_server ``` -------------------------------- ### Install Composer Dependencies Source: https://github.com/grpc/grpc.io/blob/main/content/en/docs/languages/php/quickstart.md Navigate to the PHP examples directory and install the necessary gRPC composer package and generate proto files. This step is crucial for setting up the client environment. ```sh ./greeter_proto_gen.sh composer install ``` -------------------------------- ### Clone gRPC Example Repository Source: https://github.com/grpc/grpc.io/blob/main/content/en/docs/languages/ruby/quickstart.md Clone the gRPC repository to obtain the example code for the quick start guide. This command fetches the specific version of the repository. ```sh # Clone the repository to get the example code: git clone -b {{< param grpc_vers.core >}} --depth 1 --shallow-submodules https://github.com/grpc/grpc # Navigate to the "hello, world" Ruby example: cd grpc/examples/ruby ``` -------------------------------- ### Navigate to Example Directory Source: https://github.com/grpc/grpc.io/blob/main/content/en/docs/languages/cpp/quickstart.md Change your current directory to the C++ helloworld example. ```sh cd examples/cpp/helloworld ``` -------------------------------- ### Run Node.js Server Source: https://github.com/grpc/grpc.io/blob/main/content/en/docs/languages/node/basics.md Start the Route Guide server. Ensure you provide the path to the database file. ```sh node ./routeguide/dynamic_codegen/route_guide_server.js --db_path=./routeguide/dynamic_codegen/route_guide_db.json ``` -------------------------------- ### Navigate to Example Directory Source: https://github.com/grpc/grpc.io/blob/main/content/en/docs/languages/dart/quickstart.md Changes the current directory to the helloworld example within the cloned repository. ```sh cd grpc-dart/example/helloworld ``` -------------------------------- ### Build Example on Windows Source: https://github.com/grpc/grpc.io/blob/main/content/en/docs/languages/cpp/quickstart.md Build the C++ gRPC example using CMake on Windows. Ensure you have the correct CMake version and a proper installation. ```powershell mkdir "cmake\build" pushd "cmake\build" cmake -DCMAKE_INSTALL_PREFIX=%MY_INSTALL_DIR% ..\.. cmake --build . --config Release -j 4 popd ``` -------------------------------- ### Clone gRPC Node.js examples Source: https://github.com/grpc/grpc.io/blob/main/content/en/docs/languages/node/quickstart.md Clone the gRPC Node.js repository to obtain example code. Navigate to the dynamic codegen 'hello, world' example directory and install its dependencies. ```sh git clone -b {{< param grpc_vers.node >}} --depth 1 --shallow-submodules https://github.com/grpc/grpc-node cd grpc-node/examples npm install cd helloworld/dynamic_codegen ``` -------------------------------- ### Navigate to example directory Source: https://github.com/grpc/grpc.io/blob/main/content/en/docs/platforms/android/java/basics.md Change your current directory to the android examples within the cloned grpc-java repository. ```sh cd grpc-java/examples/android ``` -------------------------------- ### Navigate to Examples Directory Source: https://github.com/grpc/grpc.io/blob/main/content/en/docs/languages/node/basics.md Change your current directory to the examples folder within the cloned gRPC Node.js repository. ```bash cd examples ``` -------------------------------- ### Install Objective-C Client Libraries Source: https://github.com/grpc/grpc.io/blob/main/content/en/docs/languages/objective-c/quickstart.md Use CocoaPods to install the gRPC client library and dependencies for the Objective-C HelloWorld example. This step generates necessary code from .proto files. ```sh cd ../../objective-c/helloworld pod install ``` -------------------------------- ### Compile and run the gRPC example Source: https://github.com/grpc/grpc.io/blob/main/content/en/docs/languages/kotlin/quickstart.md Compile the client and server for the gRPC example using Gradle, then run the server and client applications. The server starts listening on port 50051. ```sh ./gradlew installDist ./server/build/install/server/bin/hello-world-server Server started, listening on 50051 ``` ```sh ./client/build/install/client/bin/hello-world-client Received: Hello world ``` -------------------------------- ### Install gRPC for Go Source: https://github.com/grpc/grpc.io/blob/main/content/en/blog/installation.md Use the go get command to fetch the gRPC package for Go on Linux, macOS, and Windows. ```bash go get google.golang.org/grpc ``` -------------------------------- ### Clone gRPC Go Example Code Source: https://github.com/grpc/grpc.io/blob/main/content/en/docs/languages/go/quickstart.md Clones the grpc-go repository to access the quick start example code. Ensure you use the correct branch for compatibility. ```sh git clone -b {{< param grpc_vers.go >}} --depth 1 https://github.com/grpc/grpc-go ``` -------------------------------- ### Set up Python virtual environment Source: https://github.com/grpc/grpc.io/blob/main/content/en/docs/languages/python/quickstart.md Create and activate a virtual environment to manage Python dependencies for the gRPC example. This is recommended for system-wide installations. ```sh python -m pip install virtualenv virtualenv venv source venv/bin/activate python -m pip install --upgrade pip ``` -------------------------------- ### Navigate to route_guide example directory Source: https://github.com/grpc/grpc.io/blob/main/content/en/docs/languages/dart/basics.md Change your current directory to the route_guide example within the cloned grpc-dart repository. ```sh cd grpc-dart/example/route_guide ``` -------------------------------- ### Build Example on Linux/macOS Source: https://github.com/grpc/grpc.io/blob/main/content/en/docs/languages/cpp/quickstart.md Build the C++ gRPC example using CMake on Linux or macOS. Ensure you have the correct CMake version and a proper installation. ```sh mkdir -p cmake/build pushd cmake/build cmake -DCMAKE_PREFIX_PATH=$MY_INSTALL_DIR ../.. make -j 4 popd ``` -------------------------------- ### Run gRPC Example Client Source: https://github.com/grpc/grpc.io/blob/main/content/en/docs/languages/python/basics.md Execute the Python gRPC route guide client to interact with the running server. This should be run in a separate terminal. ```sh python route_guide_client.py ``` -------------------------------- ### Build and Run gRPC Example Source: https://github.com/grpc/grpc.io/blob/main/content/en/docs/languages/cpp/basics.md Instructions for building the gRPC example code and running the server and client applications. ```sh make ``` ```sh ./route_guide_server --db_path=path/to/route_guide_db.json ``` ```sh ./route_guide_client --db_path=path/to/route_guide_db.json ``` -------------------------------- ### Start a gRPC Server in C++ Source: https://github.com/grpc/grpc.io/blob/main/content/en/docs/languages/cpp/basics.md Use ServerBuilder to configure and start a gRPC server. Specify the listening port, register your service implementation, and then build and start the server. The server will block until shutdown. ```cpp void RunServer(const std::string& db_path) { std::string server_address("0.0.0.0:50051"); RouteGuideImpl service(db_path); ServerBuilder builder; builder.AddListeningPort(server_address, grpc::InsecureServerCredentials()); builder.RegisterService(&service); std::unique_ptr server(builder.BuildAndStart()); std::cout << "Server listening on " << server_address << std::endl; server->Wait(); } ``` -------------------------------- ### RouteGuideServer Class and Startup Source: https://github.com/grpc/grpc.io/blob/main/content/en/docs/languages/kotlin/basics.md Defines the RouteGuideServer class responsible for creating and starting the gRPC server. Includes methods to start the server and await termination. ```kotlin class RouteGuideServer( val port: Int, val features: Collection = Database.features(), val server: Server = ServerBuilder.forPort(port) .addService(RouteGuideService(features)).build() ) { fun start() { server.start() println("Server started, listening on $port") /* ... */ } /* ... */ } fun main(args: Array) { val port = 8980 val server = RouteGuideServer(port) server.start() server.awaitTermination() } ``` -------------------------------- ### Example Protoc Plugin with Bazel Source: https://github.com/grpc/grpc.io/blob/main/content/en/blog/vsco.md A concise example of a protoc plugin built with Bazel, demonstrating how to achieve reflection features for protobuf compilation. ```Go package main import ( "fmt" "log" "google.golang.org/protobuf/compiler/protogen" "google.golang.org/protobuf/types/descriptorpb" ) func main() { opt := protogen.Options{ Req: protogen.Request{ // TODO: fill in ProtoFiles: map[string][]byte{ "example.proto": []byte(` syntax = "proto3"; package main; message MyMessage { string value = 1; } `), }, // TODO: fill in }, // TODO: fill in } g := opt.New() // TODO: fill in for _, file := range g.Files { if file.Generate { fmt.Printf("Generating file: %s\n", file.Desc.Path()) // TODO: add generation logic } } } func generateFile(f *protogen.File) (*protogen.GeneratedFile, error) { filename := f.GeneratedFilenamePrefix + ".pb.go" g := f.Protogen.NewGeneratedFile(filename, f.GoImportPath) g.P("// Code generated by protoc-gen-demo. DO NOT EDIT.") g.P("// source: ", f.Desc.Path()) g.P("package ", f.GoPackageName) g.P() for _, msg := range f.Messages { fmt.Printf("\tMessage: %s\n", msg.Desc.Name()) // TODO: add message generation logic } return g, nil } ``` -------------------------------- ### Start a Node.js gRPC Server Source: https://github.com/grpc/grpc.io/blob/main/content/en/docs/languages/node/basics.md Implement and start a gRPC server for a defined service. Ensure the service methods are correctly implemented and added to the server instance before binding and starting. ```javascript function getServer() { var server = new grpc.Server(); server.addService(routeguide.RouteGuide.service, { getFeature: getFeature, listFeatures: listFeatures, recordRoute: recordRoute, routeChat: routeChat }); return server; } var routeServer = getServer(); routeServer.bindAsync('0.0.0.0:50051', grpc.ServerCredentials.createInsecure(), () => { routeServer.start(); }); ``` -------------------------------- ### Install gRPC-Web Protoc Plugin Source: https://github.com/grpc/grpc.io/blob/main/content/en/docs/platforms/web/basics.md Installs the gRPC-Web protoc plugin. This command must be run from the repo's root directory. ```sh cd grpc-web sudo make install-plugin ``` -------------------------------- ### Manual C++ gRPC Installation Source: https://github.com/grpc/grpc.io/blob/main/content/en/blog/installation.md Instructions for manually building and installing the gRPC C++ runtime on Linux, macOS, and Windows. ```bash Currently requires [manual build and install](https://github.com/grpc/grpc/blob/{{< param grpc_vers.core >}}/src/cpp/README.md) ``` -------------------------------- ### Install Protocol Buffer Go Plugins Source: https://github.com/grpc/grpc.io/blob/main/content/en/docs/languages/go/quickstart.md Installs the necessary protocol buffer compiler plugins for Go. Ensure your GOPATH is set correctly. ```sh go install google.golang.org/protobuf/cmd/protoc-gen-go@latest go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest ``` ```sh export PATH="$PATH:$(go env GOPATH)/bin" ``` -------------------------------- ### Install gRPCio system-wide Source: https://github.com/grpc/grpc.io/blob/main/content/en/docs/languages/python/quickstart.md Install the gRPCio library system-wide using sudo. Use this if you need gRPC available globally on your system. ```sh sudo python -m pip install grpcio ``` -------------------------------- ### Install basic build tools (macOS) Source: https://github.com/grpc/grpc.io/blob/main/content/en/docs/languages/cpp/quickstart.md Installs autoconf, automake, libtool, and pkg-config using Homebrew on macOS. ```shell brew install autoconf automake libtool pkg-config ``` -------------------------------- ### Build and install gRPC and Protocol Buffers (Windows) Source: https://github.com/grpc/grpc.io/blob/main/content/en/docs/languages/cpp/quickstart.md Configures, builds, and installs gRPC and Protocol Buffers locally using CMake on Windows. It specifies installation prefix and uses CMake's build tool for a release build. ```powershell mkdir "cmake\build" pushd "cmake\build" cmake -DgRPC_INSTALL=ON -DgRPC_BUILD_TESTS=OFF -DCMAKE_CXX_STANDARD=17 -DCMAKE_INSTALL_PREFIX=%MY_INSTALL_DIR% ..\.. cmake --build . --config Release --target install -j 4 popd ``` -------------------------------- ### Run Tonic Routeguide Server Source: https://github.com/grpc/grpc.io/blob/main/content/en/docs/languages/rust/basics.md Execute this command from the examples/route_guide directory to start the gRPC server. ```sh cargo run --bin routeguide-server ``` -------------------------------- ### Clone rules_protobuf Repository Source: https://github.com/grpc/grpc.io/blob/main/content/en/blog/bazel-rules-protobuf.md Clone the rules_protobuf repository to get started with building gRPC services using Bazel. Ensure Bazel is installed before proceeding. ```sh git clone https://github.com/pubref/rules_protobuf cd rules_protobuf ~/rules_protobuf$ ``` -------------------------------- ### Example Project Structure Source: https://github.com/grpc/grpc.io/blob/main/content/en/blog/bazel-rules-protobuf.md Displays the file tree of the rules_protobuf examples subdirectory, showing folders with BUILD files. This helps visualize the organization of Protobuf-related targets. ```bash tree -P 'BUILD|WORKSPACE' -I 'third_party|bzl' examples/ . ├── BUILD ├── WORKSPACE └── examples ├── helloworld │ ├── cpp │ │   └── BUILD │ ├── go │   │   ├── client │   │   │   └── BUILD │   │   ├── greeter_test │   │   │   └── BUILD │   │   └── server │   │   └── BUILD │ ├── grpc_gateway │ │   └── BUILD │ ├── java │ │   └── org │ │   └── pubref │ │   └── rules_protobuf │ │   └── examples │ │   └── helloworld │ │   ├── client │   │   │   └── BUILD │   │   └── server │   │   └── BUILD │ └── proto │      └── BUILD └── proto └── BUILD ``` -------------------------------- ### Run gRPC Client Source: https://github.com/grpc/grpc.io/blob/main/content/en/docs/languages/cpp/quickstart.md Execute the gRPC greeter client from the example build directory and observe the output. ```sh ./greeter_client Greeter received: Hello world ``` -------------------------------- ### Run Dart gRPC Server Source: https://github.com/grpc/grpc.io/blob/main/content/en/docs/languages/dart/quickstart.md Starts the gRPC server application from the example directory. ```sh dart bin/server.dart ``` -------------------------------- ### Run gRPC server Source: https://github.com/grpc/grpc.io/blob/main/content/en/docs/languages/node/quickstart.md Start the gRPC server from the 'examples/helloworld/dynamic_codegen' directory. ```sh node greeter_server.js ``` -------------------------------- ### Get Dart Package Dependencies Source: https://github.com/grpc/grpc.io/blob/main/content/en/docs/languages/dart/quickstart.md Downloads all necessary package dependencies for the Dart gRPC example. ```sh dart pub get ``` -------------------------------- ### Run gRPC Routeguide Client Source: https://github.com/grpc/grpc.io/blob/main/content/en/docs/languages/rust/basics.md Execute this command from the examples/route_guide directory in a separate terminal to run the gRPC client. ```sh cargo run --bin grpc-routeguide-client ``` -------------------------------- ### Create Project Layout for grpc_greetertimer Source: https://github.com/grpc/grpc.io/blob/main/content/en/blog/bazel-rules-protobuf.md Sets up the necessary directories and empty files for the grpc_greetertimer project, including proto definitions, Go sources, and Java sources. ```sh mkdir grpc_greetertimer && cd grpc_greetertimer ~/grpc_greetertimer$ mkdir -p proto/ go/ java/org/pubref/grpc/greetertimer/ ~/grpc_greetertimer$ touch WORKSPACE ~/grpc_greetertimer$ touch proto/BUILD ~/grpc_greetertimer$ touch proto/greetertimer.proto ~/grpc_greetertimer$ touch go/BUILD ~/grpc_greetertimer$ touch go/main.go ~/grpc_greetertimer$ touch java/org/pubref/grpc/greetertimer/BUILD ~/grpc_greetertimer$ touch java/org/pubref/grpc/greetertimer/GreeterTimerServer.java ``` -------------------------------- ### Compile Proto Files Source: https://github.com/grpc/grpc.io/blob/main/content/en/docs/languages/php/basics.md Compile the example's .proto files using the generated route_guide_proto_gen.sh script. This step is necessary after building the grpc_php_plugin. ```bash cd examples/php/route_guide ./route_guide_proto_gen.sh ``` -------------------------------- ### Clone the gRPC Java repository Source: https://github.com/grpc/grpc.io/blob/main/content/en/docs/languages/java/quickstart.md Clone the grpc-java repository to get the example code. Ensure you checkout the correct branch for your gRPC version. ```shell git clone -b {{< param grpc_vers.java >}} --depth 1 https://github.com/grpc/grpc-java ``` -------------------------------- ### Rust Client-Side Streaming RPC Example Source: https://github.com/grpc/grpc.io/blob/main/content/en/docs/languages/rust/basics.md Initiates a client-side streaming RPC, sends multiple request messages, and then receives a single response. Use this when the client needs to send a sequence of messages to the server before receiving a final result. The client must call `close_and_recv()` to signal completion and get the response. ```rust let point_count = rand::random_range(2..=30); let mut points = Vec::with_capacity(point_count); for _ in 0..point_count { points.push(random_point()); } println!("Traversing {point_count} points."); let mut stream = client.record_route().await; for point in points { if stream.send(&point).await.is_err() { break; } } let response = stream.close_and_recv().await.expect("RPC failed"); println!( "Route summary: Point count: {}, Distance: {}", response.point_count(), response.distance() ); ``` -------------------------------- ### Start a gRPC Server in Go Source: https://github.com/grpc/grpc.io/blob/main/content/en/docs/languages/go/basics.md Initializes and starts a gRPC server. It involves listening on a TCP port, creating a new gRPC server instance, registering the service implementation, and serving incoming requests. ```go lis, err := net.Listen("tcp", fmt.Sprintf("localhost:%d", port)) if err != nil { log.Fatalf("failed to listen: %v", err) } var opts []grpc.ServerOption ... grpcServer := grpc.NewServer(opts...) pb.RegisterRouteGuideServer(grpcServer, newServer()) grpcServer.Serve(lis) ``` -------------------------------- ### Install Older ActiveSupport and CocoaPods Source: https://github.com/grpc/grpc.io/blob/main/content/en/docs/languages/objective-c/quickstart.md Troubleshoot CocoaPods installation errors by installing an older version of `activesupport` before installing CocoaPods. This is a workaround for version compatibility issues. ```sh [sudo] gem install activesupport -v 4.2.6 [sudo] gem install cocoapods ``` -------------------------------- ### Install recent cmake locally (Linux) Source: https://github.com/grpc/grpc.io/blob/main/content/en/docs/languages/cpp/quickstart.md Downloads, installs, and cleans up a recent version of CMake into the local installation directory on Linux. ```shell wget -q -O cmake-linux.sh https://github.com/Kitware/CMake/releases/download/v3.30.3/cmake-3.30.3-linux-x86_64.sh sh cmake-linux.sh -- --skip-license --prefix=$MY_INSTALL_DIR rm cmake-linux.sh ``` -------------------------------- ### Create a RouteGuide Client Stub Source: https://github.com/grpc/grpc.io/blob/main/content/en/docs/languages/node/basics.md Instantiate a client stub by providing the server address and credentials. This is the first step to calling service methods. ```javascript new routeguide.RouteGuide('localhost:50051', grpc.credentials.createInsecure()); ``` -------------------------------- ### Start gRPC Server in Python Source: https://github.com/grpc/grpc.io/blob/main/content/en/docs/languages/python/basics.md Initialize and start a gRPC server, adding the implemented servicer and specifying the port to listen on. The server start is non-blocking. ```python def serve(): server = grpc.server(futures.ThreadPoolExecutor(max_workers=10)) route_guide_pb2_grpc.add_RouteGuideServicer_to_server(RouteGuideServicer(), server) server.add_insecure_port("[::]:50051") server.start() server.wait_for_termination() ``` -------------------------------- ### Navigate to gRPC Java examples directory Source: https://github.com/grpc/grpc.io/blob/main/content/en/docs/languages/java/basics.md Change your current directory to the examples directory within the cloned gRPC Java repository to begin working with the tutorial code. ```shell cd grpc-java/examples ``` -------------------------------- ### Install Latest LTS Node.js Version Source: https://github.com/grpc/grpc.io/blob/main/README.md Installs the latest Long Term Support (LTS) release of Node.js using nvm. Ensure nvm is installed first. ```console $ nvm install --lts ``` -------------------------------- ### Create and Run a gRPC Project with .NET SDK Source: https://github.com/grpc/grpc.io/blob/main/content/en/blog/grpc-on-dotnetcore.md Use the .NET SDK to create a new gRPC project and run it. This command generates a basic gRPC Greeter service. ```sh dotnet new grpc -o GrpcGreeter cd GrpcGreeter dotnet run ``` -------------------------------- ### Install cmake (Windows) Source: https://github.com/grpc/grpc.io/blob/main/content/en/docs/languages/cpp/quickstart.md Installs CMake using Chocolatey on Windows. ```powershell choco install cmake ``` -------------------------------- ### Install cmake (macOS) Source: https://github.com/grpc/grpc.io/blob/main/content/en/docs/languages/cpp/quickstart.md Installs CMake using Homebrew on macOS. ```shell brew install cmake ``` -------------------------------- ### Install gRPC Plugins and Libraries Source: https://github.com/grpc/grpc.io/blob/main/content/en/docs/languages/objective-c/quickstart.md Compile and install the gRPC plugins and libraries from the downloaded source code. This step makes gRPC available for use in your project. ```sh cd grpc make [sudo] make install ``` -------------------------------- ### Clone gRPC Dart Example Source: https://github.com/grpc/grpc.io/blob/main/content/en/docs/languages/dart/quickstart.md Clones the grpc-dart repository to access example code. ```sh git clone https://github.com/grpc/grpc-dart ``` -------------------------------- ### Install gRPCio Source: https://github.com/grpc/grpc.io/blob/main/content/en/docs/languages/python/quickstart.md Install the gRPCio library for Python. This package provides the core gRPC functionality. ```sh python -m pip install grpcio ``` -------------------------------- ### Install gRPC for Ruby Source: https://github.com/grpc/grpc.io/blob/main/content/en/blog/installation.md Use gem to install the gRPC runtime for Ruby on Linux, macOS, and Windows. ```bash gem install grpc ``` -------------------------------- ### Install gRPC for Python Source: https://github.com/grpc/grpc.io/blob/main/content/en/blog/installation.md Use pip to install the gRPCio package for Python on Linux, macOS, and Windows. ```bash pip install grpcio ``` -------------------------------- ### Install gRPC for Node.js Source: https://github.com/grpc/grpc.io/blob/main/content/en/blog/installation.md Use npm to install the gRPC runtime for Node.js on Linux, macOS, and Windows. ```bash npm install grpc ``` -------------------------------- ### Serve the gRPC Website Locally Source: https://github.com/grpc/grpc.io/blob/main/README.md Starts a local development server to preview the gRPC website at http://localhost:8888. Run this command to serve the site locally. ```console $ npm run serve ``` -------------------------------- ### Build and install gRPC and Protocol Buffers (Linux/macOS) Source: https://github.com/grpc/grpc.io/blob/main/content/en/docs/languages/cpp/quickstart.md Configures, builds, and installs gRPC and Protocol Buffers locally using CMake on Linux and macOS. It sets specific CMake options for installation and testing, and uses parallel build jobs. ```shell cd grpc mkdir -p cmake/build pushd cmake/build cmake -DgRPC_INSTALL=ON \ -DgRPC_BUILD_TESTS=OFF \ -DCMAKE_CXX_STANDARD=17 \ -DCMAKE_INSTALL_PREFIX=$MY_INSTALL_DIR \ ../.. make -j 4 make install popd ``` -------------------------------- ### Install grpcio-tools Source: https://github.com/grpc/grpc.io/blob/main/content/en/docs/languages/python/basics.md Install the necessary package for generating gRPC code in Python. This is a prerequisite for the code generation command. ```sh pip install grpcio-tools ```