检测到您已登录华为云国际站账号,为了您更好的体验,建议您访问国际站服务网站 https://www.huaweicloud.com/intl/zh-cn
不再显示此消息
Creating a User and Granting NES Permissions This topic describes how to use Identity and Access Management (IAM) to implement fine-grained permissions control for your NES resources. With IAM, you can: Create IAM users for employees based on your organizational structure.
Policies that contain actions for both IAM and enterprise projects can be used and applied for both IAM and Enterprise Management. Policies that only contain actions supporting IAM projects can be assigned to user groups and only take effect for IAM.
For example, to obtain an IAM token in the AP-Singapore region, obtain the Endpoint of IAM (iam.ap-southeast-3.myhuaweicloud.com) for this region and the resource-path (/v3/auth/tokens) in the URI of the API used to obtain a user token.
With IAM, you can use your Huawei Cloud account to create IAM users, and assign permissions to the users to control their access to specific resources. For details about permission configurations, see Permissions Management.
Example 1: Creating an Ethereum Mainnet Node Call the IAM API to obtain a user token. Call the API for obtaining the network type to choose a proper network type ID (network_id). Create a node.
For security purposes, create Identity and Access Management (IAM) users and grant them permissions for routine management. User An IAM user is created by an account in IAM to use cloud services. Each IAM user has its own identity credentials (password and access keys).
Consensus Layer Request example (with credential) curl -X GET -H 'Content-Type: application/json' https://your-http-endpoint/your-credential/eth/v1/beacon/genesis Request example (with IAM token) curl -X GET -H 'Content-Type: application/json' -H 'X-Auth-Token:your-iam-token' https
Using cURL to Send HTTP API Requests Request example (with credential) curl -X GET https://your-http-endpoint/your-credential/wallet/getnowblock Request example (with IAM token) curl -X GET 'X-Auth-Token:your-iam-token' https://your-http-endpoint/wallet/getnowblock Response example
Execution Layer Request example (with credential) curl -X POST https://your-http-endpoint/your-credential \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' Request example (with IAM token) curl -X POST -H 'X-Auth-Token
Using cURL to Send JSON-RPC API Requests Request example (with credential) curl -k -X POST https://your-http-endpoint/your-credential/jsonrpc --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":64}' Request example (with IAM token) curl -k -X POST 'X-Auth-Token:your-iam-token
After you set any action, the permissions for the action will be granted to the IAM user.