Update README.md

This commit is contained in:
Tanner
2023-12-05 18:31:33 -06:00
committed by GitHub
parent a1a9225152
commit 2e8a52d873

View File

@@ -11,6 +11,12 @@ Read more about [RLN](https://rate-limiting-nullifier.github.io/rln-docs/).
* Spammers are banned
* If someone tries to send messages faster than the rate limit allowed, they are automatically banned, and there is no unban.
### Endpoints
* [Rooms](https://hackmd.io/DenXCGGsT9iQznaPVSom4Q)
* [Admin](https://hackmd.io/T3HWQiL0RdewpmZH2gFyrQ)
* [Discord](https://hackmd.io/XFrd-_0iQ5W-TSV4urOwNw)
* [Ethereum](https://hackmd.io/G4KnDdTqTGmsYWr8SVNxeA)
### Getting Started
@@ -87,66 +93,5 @@ The server is hosted at ***http://localhost:3001/***
![83b3f422315da5d0c391e4dc99733d7b](https://i.imgur.com/v0OMumd.png)
* Creating invite codes for rooms
* Can be generated at **https://localhost:3001/admin/invite** or:
* Replace the Authorization with your Base64-encoded username:password
* "numCodes" is the amount of codes to create
* "rooms" takes an array of roomId's to create codes for
* "all" is a boolean that will create a code for all rooms if true
* "expiresAt" takes UNIX time to how long until a code expires. If 0 it will expire in 3 months
* "usesLeft" amount of times a code can be used. If -1 it will have unlimited uses
```
curl -i -X POST \
http://localhost:3001/admin/addcode \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic YWRtaW46cGFzc3dvcmQ=' \
-d '{
"numCodes": 1,
"rooms": [""],
"all": false,
"expiresAt": 0,
"usesLeft": -1
}'
```
* Creating rooms
* Can be made at **https://localhost:3001/admin/newroom** or:
* Replace the Authorization with your Base64-encoded username:password
* "roomName" Name of the room to be created
* "rateLimit" Length of an epoch in MS
* "userMessageLimit" Number of messages that can be sent in an epoch
* "numClaimCodes" Number of claim codes to create upon room creation
* "approxNumMockUsers" Amount of mock users to create for a room
* "type" PUBLIC or PRIVATE
**Optional Parameters**
* "adminIdentities" Admin identities in a room
* "bandadaAddress" Bandada Group address
* "bandadaGroupId" Bandada Group Id
* "bandadaAPIKey" Bandada API Key
* "membershipType" IDENTITY_LIST or BANDADA_GROUP
* "roomId" Custom Room ID
* "encrypted" AES or PLAINTEXT
```
curl -i -X POST \
http://localhost:3001/admin/newroom \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic YWRtaW46cGFzc3dvcmQ=' \
-d '{
"roomName": "Test",
"rateLimit": 10000,
"userMessageLimit": 12,
"numClaimCodes": 0,
"approxNumMockUsers": 5,
"type": "PUBLIC",
"adminIdentities": [""],
"bandadaAddress": "",
"bandadaGroupId": "",
"bandadaAPIKey": "",
"membershipType": "IDENTITY_LIST",
"roomId": "",
"encrypted": ""
}'
```