Skip to content
Last updated

gRPC

Access gRPC-based blockchain nodes through a single endpoint with metadata-based chain routing.

Connection

grpc.vilna.io:443

TLS is required. Authentication and chain identification are passed via gRPC metadata:

Metadata keyValue
x-api-keyYour API key
x-chain-idCAIP-2 chain ID or alias (e.g., tron or tron:mainnet)
Explicit port

Always specify the :443 port. Some clients (including grpcurl) don't assume a default port and will fail with missing port in address if it's omitted.

Tron

Any Tron gRPC service method can be called through Vilna RPC. The request is routed to the Tron node transparently. gRPC reflection is enabled on the upstream, so grpcurl resolves descriptors automatically.

Get current block

grpcurl \
  -H "x-api-key: your-api-key" \
  -H "x-chain-id: tron:mainnet" \
  -d '{}' \
  grpc.vilna.io:443 \
  protocol.Wallet/GetNowBlock2

Quick sanity check

grpcurl \
  -H "x-api-key: your-api-key" \
  -H "x-chain-id: tron:mainnet" \
  grpc.vilna.io:443 \
  protocol.Wallet/TotalTransaction

Get a specific block by number

grpcurl \
  -H "x-api-key: your-api-key" \
  -H "x-chain-id: tron:mainnet" \
  -d '{"num":70000000}' \
  grpc.vilna.io:443 \
  protocol.Wallet/GetBlockByNum2

If you don't have grpcurl installed, the same call works from Docker:

docker run --rm fullstorydev/grpcurl \
  -H "x-api-key: your-api-key" \
  -H "x-chain-id: tron:mainnet" \
  -d '{}' \
  grpc.vilna.io:443 \
  protocol.Wallet/GetNowBlock2

Available services

Vilna proxies all standard Tron gRPC services:

ServiceDescription
protocol.WalletAccount, transaction, and block operations
protocol.WalletSolidityRead-only queries against confirmed blocks
protocol.DatabaseLow-level chain data access

For the full list of available methods, see the Tron protocol documentation.

Error handling

System errors

Returned by Vilna RPC when the request cannot reach the blockchain node:

SituationgRPC status
Missing API keyUNAUTHENTICATED
Invalid API keyUNAUTHENTICATED
Network not foundNOT_FOUND
Protocol mismatchINVALID_ARGUMENT
Network unavailableUNAVAILABLE

For common API errors and troubleshooting, see the Errors guide.

Blockchain node errors

If the request reaches the node but the node returns an error, you receive the node's native gRPC error. These errors come directly from the blockchain node.

Next steps