Virald is a node implementation for a distributed VM cloud network. This node registers itself with the API server and can handle VM execution tasks.
virald/
├── node/
│ ├── index.ts # Virald node server handling VM execution
│ ├── client.ts # Communicates with the main API server
├── package.json
├── tsconfig.json
└── README.md
Ensure you have Node.js installed, then run:
npm install
Start the node with:
npm start
The node communicates with a central API server. The following endpoints are relevant:
POST /register
- Request Body:
{ "address": "<node_address>" }
- Response:
{ "id": "<node_id>", "message": "Node registered successfully" }
GET /nodes
- Response:
{ "nodes": { "<node_id>": { "id": "<node_id>", "address": "<node_address>", "earnings": <amount> } } }
POST /assign-vm
- Request Body:
{ "nodeId": "<node_id>", "amount": <number> }
- Response:
{ "message": "VM assigned", "node": { "id": "<node_id>", "address": "<node_address>", "earnings": <amount> } }
MIT