Updated on 2023-08-08 GMT+08:00

Creating Nodes

Description

This API is used to create nodes based on the specifications.

URI

POST /v1/{project_id}/node-provider/networks/{network_id}/nodes

Table 1 URI parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID.

Minimum length: 32 characters

Maximum length: 32 characters

network_id

Yes

String

Network ID.

Minimum length: 36 characters

Maximum length: 36 characters

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token.

Minimum length: 1 character

Maximum length: 65,535 characters

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

cpu

Yes

Long

Number of CPU cores.

Minimum value: 1

Maximum value: 1024

ram

Yes

Integer

RAM size.

Minimum value: 1

Maximum value: 1,048,576

node_type

Yes

String

Node type, which can be Full node or Full node (Staking supported).

Minimum length: 0 characters

Maximum length: 100 characters

charge_mode

Yes

String

Billing mode, which can be postPaid or prePaid.

Minimum length: 0 characters

Maximum length: 100 characters

node_mode

Yes

String

Node mode, which can be single or HA.

Minimum length: 0 characters

Maximum length: 100 characters

node_num

Yes

Integer

Number of nodes. A maximum of five nodes can be created at a time.

Minimum value: 1

Maximum value: 5

mev_boost

No

String

MEV-Boost address. If this parameter is left empty, MEV-Boost connection is disabled.

Minimum length: 0 characters

Maximum length: 100 characters

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

jobs

Array of strings

Task list.

Status code: 400

Table 5 Response body parameters

Parameter

Type

Description

code

String

Status code.

Minimum length: 3 characters

Maximum length: 3 characters

error_code

String

Error code.

Minimum length: 12 characters

Maximum length: 12 characters

error_msg

String

Error message.

Minimum length: 1 character

Maximum length: 65,535 characters

message

String

Error details.

Minimum length: 0 characters

Maximum length: 65,535 characters

Status code: 401

Table 6 Response body parameters

Parameter

Type

Description

code

String

Status code.

Minimum length: 3 characters

Maximum length: 3 characters

error_code

String

Error code.

Minimum length: 12 characters

Maximum length: 12 characters

error_msg

String

Error message.

Minimum length: 1 character

Maximum length: 65,535 characters

message

String

Error details.

Minimum length: 0 characters

Maximum length: 65,535 characters

Status code: 500

Table 7 Response body parameters

Parameter

Type

Description

code

String

Status code.

Minimum length: 3 characters

Maximum length: 3 characters

error_code

String

Error code.

Minimum length: 12 characters

Maximum length: 12 characters

error_msg

String

Error message.

Minimum length: 1 character

Maximum length: 65,535 characters

message

String

Error details.

Minimum length: 0 characters

Maximum length: 65,535 characters

Example Request

{
  "cpu" : 2,
  "ram" : 8192,
  "node_type" : "Full node",
  "charge_mode" : "postPaid",
  "node_mode" : "single",
  "node_num" : 1
}

Example Response

Status code: 200

Request successful.

{
  "jobs" : [ "c85f549f-7c80-11ed-b1f5-0242a9fe1e03" ]
}

Status code: 400

Verify parameter failed.

{
  "code" : 400,
  "error_code" : "BCS.03400001",
  "error_msg" : "Invalid request.",
  "message" : "unmarshal request data error"
}

Status code: 401

Authentication failed.

{
  "code" : 401,
  "error_code" : "BCS.03401001",
  "error_msg" : "Authorization failed.",
  "message" : "request token is not valid"
}

Status code: 500

Internal service error.

{
  "code" : 500,
  "error_code" : "BCS.03500001",
  "error_msg" : "Internal error.",
  "message" : "project [xxx] node [xxx] get service bearer user token error"
}

Status Code

Status Code

Description

200

Request successful.

400

Verify parameter failed.

401

Authentication failed.

500

Internal service error.

Error Code

For details, see Error Codes.