(nodes)
Nodes Management
- nodesCreate - Create node
- nodesCreateLock - Create a node lock for confidential compute
This endpoint allows nodes to register or update their public address in the system. When a node comes online or changes its address, it can use this endpoint to ensure the system has its current address for routing requests.
Returns various AtomaProxyError variants:
MissingHeader- If the signature header is missingInvalidHeader- If the signature header is malformedInvalidBody- If:- The request body cannot be read
- The signature is invalid
- The body cannot be parsed
- The sui address doesn't match the signature
InternalError- If:- The state manager channel is closed
- The registration event cannot be sent
- Node Sui address lookup fails
import { AtomaSDK } from "atoma-sdk";
const atomaSDK = new AtomaSDK({
bearerAuth: process.env["ATOMASDK_BEARER_AUTH"] ?? "",
});
async function run() {
const result = await atomaSDK.nodes.nodesCreate({
data: {
country: "Andorra",
nodeSmallId: 3665,
publicAddress: "<value>",
},
signature: "<value>",
});
// Handle the result
console.log(result);
}
run();The standalone function version of this method:
import { AtomaSDKCore } from "atoma-sdk/core.js";
import { nodesNodesCreate } from "atoma-sdk/funcs/nodesNodesCreate.js";
// Use `AtomaSDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const atomaSDK = new AtomaSDKCore({
bearerAuth: process.env["ATOMASDK_BEARER_AUTH"] ?? "",
});
async function run() {
const res = await nodesNodesCreate(atomaSDK, {
data: {
country: "Andorra",
nodeSmallId: 3665,
publicAddress: "<value>",
},
signature: "<value>",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
components.NodesCreateRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<components.NodesCreateResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
This endpoint attempts to find a suitable node and retrieve its public key for encryption through a two-step process:
- First, it tries to select an existing node with a public key directly.
- If no node is immediately available, it falls back to finding the cheapest compatible node and acquiring a new stack entry for it.
This endpoint is specifically designed for confidential compute scenarios where requests need to be encrypted before being processed by nodes.
INTERNAL_SERVER_ERROR- Communication errors or missing node public keysSERVICE_UNAVAILABLE- No nodes available for confidential compute
import { AtomaSDK } from "atoma-sdk";
const atomaSDK = new AtomaSDK({
bearerAuth: process.env["ATOMASDK_BEARER_AUTH"] ?? "",
});
async function run() {
const result = await atomaSDK.nodes.nodesCreateLock({
model: "Focus",
});
// Handle the result
console.log(result);
}
run();The standalone function version of this method:
import { AtomaSDKCore } from "atoma-sdk/core.js";
import { nodesNodesCreateLock } from "atoma-sdk/funcs/nodesNodesCreateLock.js";
// Use `AtomaSDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const atomaSDK = new AtomaSDKCore({
bearerAuth: process.env["ATOMASDK_BEARER_AUTH"] ?? "",
});
async function run() {
const res = await nodesNodesCreateLock(atomaSDK, {
model: "Focus",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
components.NodesCreateLockRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<components.NodesCreateLockResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |