# GetNodeInfo gRPC Method

> For the complete documentation index, see [llms.txt](/docs/llms.txt)


Retrieves detailed information about the TRON node you're connected to, including version, configuration, and status.

## Parameters

This method does not accept any parameters.

## Returns

- **beginSyncNum** (integer): Block number from which the node starts syncing

- **block** (string): Current block information

- **solidityBlock** (string): Current solidity block information

- **currentConnectCount** (integer): Number of current connections

- **activeConnectCount** (integer): Number of active connections

- **passiveConnectCount** (integer): Number of passive connections

- **totalFlow** (integer): Total network flow

- **peerInfoList** (array): List of connected peer information
  - **lastSyncBlock** (string): Last block synced with peer
  - **remainNum** (integer): Remaining number of blocks to sync
  - **lastBlockUpdateTime** (integer): Timestamp of last block update
  - **syncFlag** (boolean): Whether syncing is in progress
  - **headBlockTimeWeBothHave** (integer): Timestamp of head block both nodes have
  - **needSyncFromPeer** (boolean): Whether node needs to sync from peer
  - **needSyncFromUs** (boolean): Whether peer needs to sync from node
  - **host** (string): Peer host address
  - **port** (integer): Peer port
  - **nodeId** (string): Peer node ID
  - **connectTime** (integer): Connection timestamp
  - **avgLatency** (number): Average latency with peer
  - **syncToFetchSize** (integer): Size of sync to fetch queue
  - **syncToFetchSizePeekNum** (integer): Peek number for sync to fetch size
  - **syncBlockRequestedSize** (integer): Size of sync block requested queue
  - **unFetchSynNum** (integer): Number of unfetched sync blocks
  - **blockInPorcSize** (integer): Size of blocks in processing
  - **headBlockWeBothHave** (string): Head block hash both nodes have
  - **isActive** (boolean): Whether the connection is active
  - **score** (integer): Peer score
  - **nodeCount** (integer): Number of nodes
  - **inFlow** (integer): Inbound network flow
  - **disconnectTimes** (integer): Number of disconnections
  - **localDisconnectReason** (string): Local disconnect reason
  - **remoteDisconnectReason** (string): Remote disconnect reason

- **configNodeInfo** (object): Node configuration information
  - **codeVersion** (string): Code version
  - **p2pVersion** (string): P2P protocol version
  - **listenPort** (integer): Listening port
  - **discoverEnable** (boolean): Whether node discovery is enabled
  - **activeNodeSize** (integer): Size of active node list
  - **passiveNodeSize** (integer): Size of passive node list
  - **sendNodeSize** (integer): Size of send node list
  - **maxConnectCount** (integer): Maximum connection count
  - **sameIpMaxConnectCount** (integer): Maximum connections from same IP
  - **backupListenPort** (integer): Backup listening port
  - **backupMemberSize** (integer): Size of backup member list
  - **backupPriority** (integer): Backup priority
  - **dbVersion** (integer): Database version
  - **minParticipationRate** (integer): Minimum participation rate
  - **supportConstant** (boolean): Whether constant features are supported
  - **minTimeRatio** (number): Minimum time ratio
  - **maxTimeRatio** (number): Maximum time ratio
  - **allowCreationOfContracts** (integer): Block height when contract creation was enabled
  - **allowAdaptiveEnergy** (integer): Block height when adaptive energy was enabled

- **machineInfo** (object): Information about the machine running the node
  - **threadCount** (integer): Number of threads
  - **deadLockThreadCount** (integer): Number of deadlocked threads
  - **cpuCount** (integer): Number of CPU cores
  - **totalMemory** (integer): Total system memory
  - **freeMemory** (integer): Free system memory
  - **cpuRate** (number): CPU usage rate
  - **javaVersion** (string): Java version
  - **osName** (string): Operating system name
  - **jvmTotalMemory** (integer): Total JVM memory
  - **jvmFreeMemory** (integer): Free JVM memory
  - **processCpuRate** (number): Process CPU usage rate
  - **memoryDescInfoList** (array): List of memory descriptor information
    - **name** (string): Memory area name
    - **initSize** (integer): Initial memory size
    - **useSize** (integer): Used memory size
    - **maxSize** (integer): Maximum memory size
    - **useRate** (number): Memory usage rate
  - **deadLockThreadInfoList** (array): List of deadlocked thread information
    - **name** (string): Thread name
    - **lockName** (string): Lock name
    - **lockOwner** (string): Thread that owns the lock
    - **state** (string): Thread state
    - **blockTime** (integer): Time thread has been blocked
    - **waitTime** (integer): Time thread has been waiting
    - **stackTrace** (string): Stack trace of the thread

- **cheatWitnessInfoMap** (object): Map of cheat witness information

## Code Examples

### GO

```go
package main

import (
	"context"
	"crypto/tls"
	"encoding/json"
	"fmt"
	"github.com/fbsobreira/gotron-sdk/pkg/client"
	"google.golang.org/grpc"
	"google.golang.org/grpc/credentials"
	"log"
)

// Quicknode endpoints consist of two crucial components: the endpoint name and the corresponding token
// For eg: QN Endpoint: https://docs-demo.tron-mainnet.quiknode.pro/abcde123456789
// endpoint will be: docs-demo.tron-mainnet.quiknode.pro:50051  {50051 is the port number for Tron gRPC}
// token will be : abcde123456789

var token = "YOUR_TOKEN"
var endpoint = "YOUR_ENDPOINT:50051"

type auth struct {
	token string
}

func (a *auth) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error) {
	return map[string]string{
		"x-token": a.token,
	}, nil
}

func (a *auth) RequireTransportSecurity() bool {
	return false
}

func main() {
	
	opts := []grpc.DialOption{
		grpc.WithTransportCredentials(credentials.NewTLS(&tls.Config{})),
		grpc.WithPerRPCCredentials(&auth{token}),
	}
	conn := client.NewGrpcClient(endpoint)
	if err := conn.Start(opts...); err != nil {
		panic(err)
	}
	defer conn.Conn.Close()

	fmt.Println("Fetching TRON node information...")
	nodeInfo, err := conn.GetNodeInfo()
	if err != nil {
		log.Fatalf("Error getting node info: %v\n", err)
	}
	nodeJSON, _ := json.MarshalIndent(nodeInfo, "", "  ")
	fmt.Println("\nTRON Node Information:")
	fmt.Println(string(nodeJSON))
}
```

