Skip to content

feat: add assignment 3 #12

Open
Chibey-max wants to merge 1 commit intoBlockheaderWeb3-Community:as-w2-d1from
Chibey-max:assignment-03
Open

feat: add assignment 3 #12
Chibey-max wants to merge 1 commit intoBlockheaderWeb3-Community:as-w2-d1from
Chibey-max:assignment-03

Conversation

@Chibey-max
Copy link
Collaborator

JSON-RPC 2.0 Specification

A lightweight, stateless remote procedure call (RPC) protocol encoded in JSON.

Core Concepts

  • Transport Independent: Works over HTTP, WebSockets, or TCP.

  • Stateless: No session data is persisted between requests.

  • Bidirectional: Supports client-to-server and server-to-client calls.


📩 Message Structures

1. Request

JSON
{
  "jsonrpc": "2.0",
  "method": "subtract",
  "params": [42, 23],
  "id": 1
}

2. Success Response

JSON
{
  "jsonrpc": "2.0",
  "result": 19,
  "id": 1
}

3. Error Response

JSON
{
  "jsonrpc": "2.0",
  "error": { "code": -32601, "message": "Method not found" },
  "id": 1
}

🛠 Interaction Types

  • Standard: Request with an id expects a Response.

  • Notification: Request without an id. No response is sent.

  • Batch: An array of requests sent together; handled for efficiency.


⚠️ Standard Error Codes

Code | Definition -- | -- -32700 | Parse error (Invalid JSON) -32600 | Invalid Request object -32601 | Method not found -32602 | Invalid parameters -32603 | Internal server error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant