Skip to main content

create_context_handler

Function create_context_handler 

Source
pub async fn create_context_handler(
    __arg0: State<Arc<NodeState>>,
    body: Result<Json<CreateContextRequest>, JsonRejection>,
) -> impl IntoResponse
Expand description

Handler for POST /scp/dev/v1/contexts.

Parses a CreateContextRequest JSON body and registers a new broadcast context. Returns HTTP 201 Created with the newly created ContextResponse.

Validates:

  • id is non-empty, ASCII hex only, max 64 chars (32 bytes hex-encoded)
  • name (if present) is max 256 chars, no control characters
  • No duplicate context ID already registered

See spec section 18.10.3.