프로젝트

일반

사용자정보

Actions

이슈 #311

진행중
CP JL

17-2. 노드 상세 정보 API

이슈 #311: 17-2. 노드 상세 정보 API

Chris Park이(가) 약 7시간 전에 추가함.

상태:
해결
우선순위:
높음
담당자:
목표버전:
시작일:
2026/05/19
완료일:
2026/05/20 (약 5달 지연)
진척도:

0%

추정시간:

설명

GET /api/nodes/:id

CP Chris Park이(가) 7달 전에 변경 Actions #1

  • 프로젝트을(를) 14에서 Alphea App(으)로 변경되었습니다.
  • 목표버전을(를) 6월 중간 버전(으)로 지정되었습니다.

JL James Lee이(가) 7달 전에 변경 Actions #2

17-2. 노드 상세 정보 API 구현 완료

NodeService.GetNode RPC 를 Rust + tonic 으로 구현했습니다.

  • Repository: alphea-ai-edge
  • Commit: commit:server|7828037 — feat: add NodeService with read-only ListNodes and GetNode RPCs
  • 관련 이슈: #254 (DB 쿼리 추가), #310 (동일 커밋에 포함)

구현 내용

Proto 정의

rpc GetNode(GetNodeRequest) returns (NodeInfo);

message GetNodeRequest { string node_id = 1; }

응답은 공용 NodeInfo 메시지 (30개 필드) 그대로.

DB 쿼리 (src/store/nodes.rs::get_by_id)

SELECT {모든 컬럼} FROM nodes WHERE node_id = $1

30개 컬럼 전체를 #[derive(FromRow)] 이 붙은 NodeRow 로 읽은 뒤 row_to_proto() 로 proto NodeInfo 로 변환합니다.

핸들러 (src/handler/node.rs::get_node)

  • node_id 빈 문자열 → InvalidArgument
  • 행 없음 → NotFound ("node not found")
  • 행 있음 → 30개 필드 + JSONB device_meta 역직렬화된 NodeInfo 반환

E2E 검증 결과 (grpcurl)

존재하는 노드

$ grpcurl -plaintext -d '{"nodeId":"rn_7a72e61a_demo-device-42"}' localhost:3000 alphea.v1.NodeService/GetNode
{
  "id": "1",
  "nodeId": "rn_7a72e61a_demo-device-42",
  "name": "Mobile 7a72e61a",
  "nodeType": "NODE_TYPE_MOBILE",
  "ownerWalletAddress": "0x7a72e61aaadd48917e5845d41f0f7575831c56af",
  "authMode": "AUTH_MODE_INTERNAL",
  "status": "NODE_STATUS_ACTIVE",
  "tier": "NODE_TIER_LOW",
  "role": "NODE_ROLE_WORKER",
  "maxConcurrentJobs": 5, "throughputHint": 100, "score": 50,
  "successRate1m": 1,
  "deviceId": "demo-device-42",
  "deviceMeta": {
    "platform": "ios", "model": "iPhone 15 Pro",
    "screenResolution": "1290x2796",
    "appVersion": "0.1.0",
    "timezone": "Asia/Seoul"
  },
  "devicePlatform": "ios",
  "createdAt": "1776242428",
  "updatedAt": "1776242428"
}

존재하지 않는 노드

$ grpcurl -plaintext -d '{"nodeId":"rn_none"}' localhost:3000 alphea.v1.NodeService/GetNode
ERROR:
  Code: NotFound
  Message: node not found

알려진 한계

  • Public RPC 로 등록되어 있음 (레거시 allow-list 와 동일, 인증 불필요)
  • 삭제된 (archived) 노드는 아직 없음 — #313 에서 도입 예정

JL James Lee이(가) 7달 전에 변경 Actions #3

  • 상태을(를) 신규에서 해결(으)로 변경되었습니다.

17-2 작업 완료 — 해결 전환

  • Section 17 Step 1 에서 NodeService.GetNode RPC 구현 완료 (commit:server|7828037)
  • Section 17 Step 3 에서 archived 노드 숨김 처리 추가 (commit:server|d9668e6) — 삭제된 노드 조회 시 NotFound

E2E 검증 완료.

Actions

내보내기 PDF Atom