[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-09-01。"],[[["\u003cp\u003eThis guide outlines the necessary steps to prepare for querying a Blockchain Node Engine node, emphasizing the use of an API key for authentication.\u003c/p\u003e\n"],["\u003cp\u003eBefore querying a blockchain node, users must create an API key through the Google Cloud console's \u003cstrong\u003eAPIs & Services, Credentials\u003c/strong\u003e page.\u003c/p\u003e\n"],["\u003cp\u003eBlockchain node endpoint URLs can be retrieved via the Google Cloud console's \u003cstrong\u003eBlockchain Node Engine\u003c/strong\u003e page or through an API request.\u003c/p\u003e\n"],["\u003cp\u003ePrivate Service Connect enabled nodes require a specific configuration using the Private Service Connect static IP address and designated port instead of standard DNS endpoints, while public endpoint nodes are listed in the \u003ccode\u003eendpointInfo\u003c/code\u003e and \u003ccode\u003eadditionalEndpoints\u003c/code\u003e sections.\u003c/p\u003e\n"],["\u003cp\u003eOnce the API key and node URLs are obtained, you can find instructions on how to query different blockchain nodes in their respective guides, like the one provided for Ethereum.\u003c/p\u003e\n"]]],[],null,["# Using blockchain nodes\n\nThis page describes how to get ready to query a Blockchain Node Engine node using\nan API key for authentication.\n\nBefore you can use the blockchain node, you need to:\n\n- [Create an API key](#create-api-key)\n- [Get the node's URLs](#get-urls)\n\nCreate an API key\n-----------------\n\nYou must use an API key for authentication to query your node.\n\nTo generate a key in the Google Cloud console:\n\n1. In the Google Cloud console, go to the\n **APIs \\& Services, Credentials** page.\n\n\n [Go to Credentials](https://console.cloud.google.com/apis/credentials)\n2. Click **Create credentials**.\n\n3. Click **API key**.\n\n4. In the **API key created** dialog, click\n content_copy **Copy**\n to copy the key, and then paste it into a temporary file. You will need the\n API key in [Query a blockchain node](#query-node).\n\nSee\n[Authenticate using API keys](https://cloud.google.com/docs/authentication/api-keys)\nfor more information on API keys.\n\nGet the blockchain node endpoint URLs\n-------------------------------------\n\nYou can get the blockchain node URLs using the [console](#console) or by\nsending an [API request](#api):\n\n### Using the console\n\nTo view details about a node in the UI:\n\n1. In the Google Cloud console, go to the **Blockchain Node Engine** page.\n\n\n [Go to Blockchain Node Engine](https://console.cloud.google.com/blockchain-node-engine)\n2. The [**Nodes**](/blockchain-node-engine/docs/node-list) list page is displayed by default.\n3. Click a node name. The\n [**Node details**](/blockchain-node-engine/docs/node-details) page is\n displayed. \n\n Blockchain node URLs are displayed in the **Endpoints** area.\n\n### Using an API\n\nTo list details related to a blockchain node with\n[ListBlockchainNodes](/blockchain-node-engine/docs/reference/rest/v1/projects.locations.blockchainNodes/list),\nsend the following request: \n\n curl \\\n -H \"Authorization: Bearer $(gcloud auth print-access-token)\" \\\n -H \"Content-Type: application/json\" \\\n https://blockchainnodeengine.googleapis.com/v1/projects/\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e/\\\n locations/\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e/blockchainNodes/\u003cvar translate=\"no\"\u003eNODE_NAME\u003c/var\u003e\n\nWhere:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e is your Google Cloud project ID. For example, `my-project-id`\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e is the [location](/blockchain-node-engine/docs/terms#location) you selected in [Create a blockchain node](/blockchain-node-engine/docs/create-node). For example, `us-central1`.\n- \u003cvar translate=\"no\"\u003eNODE_NAME\u003c/var\u003e is the name of the node that you created in [Create a blockchain node](/blockchain-node-engine/docs/create-node). For example, `my-node`.\n\n#### Private Service Enabled Nodes\n\nNOTE: This section only applies to\n[Private Service Connect nodes](/blockchain-node-engine/docs/psc).\nAll other nodes can proceed to\n[the next section](#nodes-with-public-endpoints)\n\nPrivate Service Connect enabled nodes will return a `serviceAttachment`\nas shown in the following Ethereum example: \n\n {\n \"name\": \"projects/cloud-web3/locations/us-central1/blockchainNodes/my-node\",\n \"createTime\": \"2023-12-08T15:06:43.538015Z\",\n \"updateTime\": \"2023-12-08T15:23:53.016239Z\",\n \"blockchainType\": \"ETHEREUM\",\n \"connectionInfo\": {\n \"serviceAttachment\": \"projects/associated-project/regions/us-central1/serviceAttachments/associated-service-attachment\"\n },\n \"ethereumDetails\": {\n \"network\": \"MAINNET\",\n \"nodeType\": \"ARCHIVE\",\n \"executionClient\": \"ERIGON\",\n \"consensusClient\": \"LIGHTHOUSE\",\n \"apiEnableAdmin\": false,\n \"apiEnableDebug\": false\n },\n \"state\": \"RUNNING\",\n \"pscOnly\": true\n }\n\nTo use the node,\n[complete the Private Service Connect configuration](/blockchain-node-engine/docs/psc).\nThen construct your endpoint using the Private Service Connect static\nIP address and designated port for your chosen interaction, in place of the\nstandard DNS endpoint.\n\nFor port number references:\n\n- **Ethereum:** See [Private Service Connect Ethereum Port Guide](/blockchain-node-engine/docs/using-nodes-ethereum#psc-port-reference-guide)\n\n#### Nodes with a Public Endpoint\n\nThe blockchain URLs returned are in the `endpointInfo` and\n`additionalEndpoints` sections as shown in the following Ethereum example: \n\n {\n \"name\": \"projects/my-project-id/locations/us-central1/blockchainNodes/my-node\",\n \"createTime\": \"2023-05-05T04:24:12.432769Z\",\n \"updateTime\": \"2023-05-05T05:03:02.561240Z\",\n \"labels\": {\n \"my-label-key\": \"my-label-value\"\n },\n \"blockchainType\": \"ETHEREUM\",\n \"connectionInfo\": {\n \"ipInfo\": {\n \"rpcIpv4Address\": \"192.0.2.1\"\n },\n \"endpointInfo\": {\n \"jsonRpcApiEndpoint\": \"json-rpc.ejp4j0b1rdiq06p8lxksd5z25.blockchainnodeengine.com\",\n \"websocketsApiEndpoint\": \"ws.ejp4j0b1rdiq06p8lxksd5z25.blockchainnodeengine.com\"\n }\n },\n \"ethereumDetails\": {\n \"network\": \"MAINNET\",\n \"nodeType\": \"FULL\",\n \"executionClient\": \"GETH\",\n \"consensusClient\": \"LIGHTHOUSE\",\n \"apiEnableAdmin\": false,\n \"apiEnableDebug\": false,\n \"additionalEndpoints\": {\n \"beaconApiEndpoint\": \"beacon.ejp4j0b1rdiq06p8lxksd5z25.blockchainnodeengine.com\",\n \"beaconPrometheusMetricsApiEndpoint\": \"bc-mc.ejp4j0b1rdiq06p8lxksd5z25.blockchainnodeengine.com\"\n }\n },\n \"state\": \"RUNNING\"\n }\n\nSee also: [View blockchain node details, Using an API](/blockchain-node-engine/docs/node-details#using-an-api)\n\nQuery a blockchain node\n-----------------------\n\nNow that you know your API key and blockchain node endpoint URLs, for usage\ninstructions see the appropriate topic for each blockchain:\n\n- **Ethereum:** See [Using Ethereum blockchain nodes](/blockchain-node-engine/docs/using-nodes-ethereum)"]]