mirror of
https://github.com/nostr-protocol/nips.git
synced 2024-09-19 22:35:50 -04:00
add NIP-87: Relay Management API.
This commit is contained in:
parent
4aa18e329a
commit
48dca26344
51
87.md
Normal file
51
87.md
Normal file
|
@ -0,0 +1,51 @@
|
|||
NIP-87
|
||||
======
|
||||
|
||||
Relay Management API
|
||||
--------------------
|
||||
|
||||
`draft` `optional`
|
||||
|
||||
Relays may provide an API for performing management tasks. This is made available as a JSON-RPC-like request-response protocol over HTTP, on the same URI as the relay's websocket.
|
||||
|
||||
When a relay receives an HTTP(s) request with an `Authorization` header and a `Content-Type` header of `application/nostr+json+rpc` to a URI supporting WebSocket upgrades, it should parse the request as a JSON document with the following fields:
|
||||
|
||||
```json
|
||||
{
|
||||
"method": "<method-name>",
|
||||
"params": ["<array>", "<of>", "<parameters>"]
|
||||
}
|
||||
```
|
||||
|
||||
Then it should return a response in the format
|
||||
|
||||
```json
|
||||
{
|
||||
"result": {"<arbitrary>": "<value>"},
|
||||
"error": "<optional error message, if the call has errored>"
|
||||
}
|
||||
```
|
||||
|
||||
This is the list of **methods** that may be supported:
|
||||
|
||||
* `supportedmethods`:
|
||||
- params: `[]`
|
||||
- result: `["<method-name>", "<method-name>", ...]` (an array with the names of all the other supported methods)
|
||||
* `banpubkey`:
|
||||
- params: `["<a 32-byte hex public key>", "<optional reason>"]`
|
||||
- result: `true` (a boolean always set to `true`)
|
||||
* `listbannedpubkeys`:
|
||||
- params: `[]`
|
||||
- result: `[{"pubkey": "<32-byte hex>", "reason": "<optional reason>"}, ...]`, an array of objects
|
||||
* `allowpubkey`:
|
||||
- params: `["<a 32-byte hex public key>", "<optional reason>"]`
|
||||
- result: `true` (a boolean always set to `true`)
|
||||
* `listallowedpubkeys`:
|
||||
- params: `[]`
|
||||
- result: `[{"pubkey": "<32-byte hex>", "reason": "<optional reason>"}, ...]`, an array of objects
|
||||
* `banevent`:
|
||||
- params: `["<a 32-byte hex event id>", "<optional reason>"]`
|
||||
- result: `true` (a boolean always set to `true`)
|
||||
* `listbannedevents`:
|
||||
- params: `[]`
|
||||
- result: `[{"id": "<32-byte hex>", "reason": "<optional reason>"}, ...]`, an array of objects
|
|
@ -79,6 +79,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
|
|||
- [NIP-75: Zap Goals](75.md)
|
||||
- [NIP-78: Application-specific data](78.md)
|
||||
- [NIP-84: Highlights](84.md)
|
||||
- [NIP-87: Relay Management API](87.md)
|
||||
- [NIP-89: Recommended Application Handlers](89.md)
|
||||
- [NIP-90: Data Vending Machines](90.md)
|
||||
- [NIP-92: Media Attachments](92.md)
|
||||
|
|
Loading…
Reference in New Issue
Block a user