waves_logo Docs
  • Node Owner Guide
    Node Owner Guide
  • Install Waves Node
    • Deploy Node in Docker
      Deploy Node in Docker
    • Install Node on Ubuntu
      Install Node on Ubuntu
    • Install Node on macOS
      Install Node on macOS
    • Install Node on Windows
      Install Node on Windows
    • Install from Source (Building SBT)
      Install from Source (Building SBT)
    Install Waves Node
  • Synchronize Waves Blockchain
    • Import/Export Blockchain
      Import/Export Blockchain
    • Download the Latest Blockchain
      Download the Latest Blockchain
    • Rollback Waves Node
      Rollback Waves Node
    Synchronize Waves Blockchain
  • Generate Blocks
    Generate Blocks
  • Upgrade Waves Node
    Upgrade Waves Node
  • Node Configuration
    Node Configuration
  • Logging Configuration
    Logging Configuration
  • Node Wallet
    Node Wallet
  • Features
    • Activation protocol
      Activation protocol
    Features
  • Custom Blockchain
    Custom Blockchain
  • Node REST API
    • API Key
      API Key
    • Working with Transactions
      Working with Transactions
    • Numeric Fields Format
      Numeric Fields Format
    • Pagination
      Pagination
    • CORS
      CORS
    • API Limitations of Pool of Public Nodes
      API Limitations of Pool of Public Nodes
    • Slow Requests
      Slow Requests
    • Response Codes and Errors
      Response Codes and Errors
    Node REST API
  • Extensions
    • gRPC Server
      gRPC Server
    • Blockchain Updates
      Blockchain Updates
    Extensions
  • Troubleshooting
    • Block Generation FAQ
      Block Generation FAQ
    Troubleshooting
  • Node Go
    Node Go
      • English
      • Русский
      On this page
        • Client Generation
        • gRPC Server Installation
        • gRPC on Public Nodes
        • Debugging with gRPCurl
      waves_logo Docs

          # gRPC Server

          gRPC Server is a node extension that allows running gRPC services on a node. gRPC interaface can be used to run apps on your own node.

          gRPC services provide information about:

          • accounts
          • blockchain
          • blocks
          • tokens
          • transactions

          # Client Generation

          The clients generated from proto files are used to connect to gRPC services.

          Example of usage of gRPC client generated from .proto files: Retrieving blocks in C#

          To create a TypeScript or JavaScript client, we recommend using the node-api-grpc library.

          # gRPC Server Installation

          The gRPC Server extension can be installed on the node by two methods: using DEB package or TGZ archive.

          # Installation via DEB Package

          1. Download the latest version of the DEB package from the Releases page (Assets section).

            The extension package name is as follows:

            • for Mainnet grpc-server_{version number}_all.deb

            • for Testnet grpc-server-testnet_{version number}_all.deb

            • for Stagenet grpc-server-stagenet_{version number}_all.deb

          2. Install the package.

            Mainnet:

            sudo dpkg -i grpc-server_{version number}_all.deb
            

            Testnet:

            sudo dpkg -i grpc-server-testnet_{version number}_all.deb
            

            Stagenet:

            sudo dpkg -i grpc-server-stagenet_{version number}_all.deb
            
          3. Edit the node configuration file as described in the Node Configuration article. For Mainnet, the configuration file is located at /etc/waves/waves.conf, for Testnet at /etc/waves-testnet/waves.conf, for Stagenet at /etc/waves-stagenet/waves.conf.

            3.1. Add gRPC Server to the waves.extensions section:

            waves {
               ...
               extensions = [
                  com.wavesplatform.api.grpc.GRPCServerExtension
               ]
            }
            

            3.2. If you want to change the port for client connection (default is 6870), add the following setting:

            waves {
               ...
               grpc {
                  port = 6877 # Specify port
            }
            
          4. Restart the node.

            Mainnet:

            sudo systemctl restart waves
            

            Testnet:

            sudo systemctl restart waves-testnet
            

            Stagenet:

            sudo systemctl restart waves-testnet
            

          # Installation via TGZ Archive

          1. Download the TGZ archive with the extension from the Releases page (Assets section) on Github.

            The TGZ archive name is as follows:

            • for Mainnet grpc-server-{version number}.tgz

            • for Testnet grpc-server-testnet-{version number}.tgz

            • for Stagenet grpc-server-stagenet-{version number}.tgz

          2. Unpack the archive to the directory containing node's JAR-file.

          3. Create a new configuration file or open the existing one, see the Node Configuration article.

            3.1. Add gRPC Server to the waves.extensions section:

            waves {
               ...
               extensions = [
                  com.wavesplatform.api.grpc.GRPCServerExtension
               ]
            }
            

            3.2. If you want to change the port for client connection (default is 6870), add the following setting:

            waves {
               ...
               grpc {
                  port = 6877 # Specify port
            }
            
          4. Run the command:

            Mainnet

            java -cp 'waves-all-{version number}.jar:grpc-server-{version number}/lib/*' com.wavesplatform.Application {configuration file name}.conf
            

            Testnet:

            java -cp 'waves-all-{version number}.jar:grpc-server-testnet-{version number}/lib/*' com.wavesplatform.Application {configuration file name}.conf
            

            Stagenet:

            java -cp 'waves-all-{version number}.jar:grpc-server-stagenet-{version number}/lib/*' com.wavesplatform.Application {configuration file name}.conf
            

            On Windows, use ; instead of :, for example:

            java -cp 'waves-all-{version number}.jar;grpc-server-{version number}/lib/*' com.wavesplatform.Application {configuration file name}.conf
            

          # gRPC on Public Nodes

          You can connect to the public gRPC services provided by the Waves team for getting acquainted:

          • Mainnet: https://nodes.wavesnodes.com:6870
          • Testnet: https://nodes-testnet.wavesnodes.com:6870
          • Stagenet: https://nodes-stagenet.wavesnodes.com:6870

          Limitations:

          • The maximum number of simultaneous requests per IP address is 5.
          • The maximum number of the requests per second (r/s) from IP address is 20.

          # Debugging with gRPCurl

          gRPCurl is a command-line tool that lets you interact with gRPC servers. It's basically curl for gRPC servers.

          You can use gRPCurl to make requests to the gRPC Server of the Waves node and get data in a command-line interface, without writing any code:

          1. Install gRPCurl, see Installation .

          2. Clone or download the repository with proto files .

          3. Specify request parameters:

            • plaintext
            • -proto: path to the proto file that contains the definition of service to request,
            • --import-path - path to the directory containing all the proto files,
            • -d — request arguments in JSON,
            • the node address and the gRPC Server port,
            • the service and function to invoke.

          ⚠️ All byte arrays in JSON must be base64 encoded, including addresses, asset IDs, and other data that are base58 encoded in the Node REST API. The response also contains base64 encoded data.

          Request example:

          grpcurl -v -plaintext \
           -proto /home/projects/waves/protobuf-schemas/proto/waves/node/grpc/assets_api.proto \
           -import-path /home/projects/waves/protobuf-schemas/proto \
           -d '{ "asset_id": "PFrWEj4csGLWzPmlsjs/xccLxChfBm27mGoHZtYJSzU=" }' \
           nodes.wavesnodes.com:6870 waves.node.grpc.AssetsApi/GetInfo
          
          Extensions
          Blockchain Updates
          Extensions
          Blockchain Updates