From da65fb678a6b8dc654b2d0cf4906716409ae1f60 Mon Sep 17 00:00:00 2001 From: EntireTwix Date: Sat, 3 Dec 2022 23:55:20 -0800 Subject: [PATCH] :memo: MIN_API_SUPPORT --- docs/building.md | 21 +++++++++++---------- docs/connected_services/how_to/endpoints.md | 16 ++++++++-------- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/docs/building.md b/docs/building.md index aae4dfa..3628626 100644 --- a/docs/building.md +++ b/docs/building.md @@ -66,16 +66,17 @@ cd build ### CMake Flags there are multiple flags responsible configuring CCash: -| name | default | description | pros | cons | -| :--------------------- | :------------------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------- | -------------------------------------------------------- | -| USER_SAVE_LOC | "config/users.dat" | where the users are saved | `N/A` | `N/A` | -| DROGON_CONFIG_LOC | "config/config.json" | where the config is located | `N/A` | `N/A` | -| MAX_LOG_SIZE | 100 | max number of logs per user, last `n` transactions. If both this and pre log are toggled to 0 logs will not be compiled. | large history | higher memory usage | -| CONSERVATIVE_DISK_SAVE | `true` | when `true` only saves when changes are made | low # of disk operations | some atomic overhead | -| MULTI_THREADED | `true` | when `true` the program is compiled to utilize `n` threads which corresponds to how many Cores your CPU has, plus 1 for saving | speed | memory lock overhead is wasteful on single core machines | -| RETURN_ON_DEL_NAME | `N/A` | when defined, return on delete will be toggled and any accounts deleted will send their funds to the defined account, this prevent currency destruction | prevents destruction of currency | deleting accounts is made slower | -| ADD_USER_OPEN | `true` | anybody can make a new account, if set to false only admins can add accounts via `AdminAddUser()` | `N/A` | spamming new users | -| API_VERSION | 2 | api versions are backwards compatible, e.g if set to 2, v1 and v2 api endpoints will be compiled, but v3 would not. By default `API_VERSION` is set to the newest version | `N/A` | `N/A` | +| name | default | description | pros | cons | +| :--------------------- | :------------------: | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------- | -------------------------------------------------------- | +| USER_SAVE_LOC | "config/users.dat" | where the users are saved | `N/A` | `N/A` | +| DROGON_CONFIG_LOC | "config/config.json" | where the config is located | `N/A` | `N/A` | +| MAX_LOG_SIZE | 100 | max number of logs per user, last `n` transactions. If both this and pre log are toggled to 0 logs will not be compiled. | large history | higher memory usage | +| CONSERVATIVE_DISK_SAVE | `true` | when `true` only saves when changes are made | low # of disk operations | some atomic overhead | +| MULTI_THREADED | `true` | when `true` the program is compiled to utilize `n` threads which corresponds to how many Cores your CPU has, plus 1 for saving | speed | memory lock overhead is wasteful on single core machines | +| RETURN_ON_DEL_NAME | `N/A` | when defined, return on delete will be toggled and any accounts deleted will send their funds to the defined account, this prevent currency destruction | prevents destruction of currency | deleting accounts is made slower | +| ADD_USER_OPEN | `true` | anybody can make a new account, if set to false only admins can add accounts via `AdminAddUser()` | `N/A` | spamming new users | +| API_VERSION | 2 | the maximum api version's endpoints to be compiled. By default `API_VERSION` is set to the newest version | `N/A` | `N/A` | +| MIN_API_SUPPORT | 1 | the minimum api version's endpoints to be compiled. By default set to 1 for full backwards compatibility, setting to the same value as `API_VERSION` would disable backwards compatiblity | `N/A` | `N/A` | EXAMPLE: ``` diff --git a/docs/connected_services/how_to/endpoints.md b/docs/connected_services/how_to/endpoints.md index d3aabe9..8dadccf 100644 --- a/docs/connected_services/how_to/endpoints.md +++ b/docs/connected_services/how_to/endpoints.md @@ -68,14 +68,14 @@ | ImpactBal | :heavy_check_mark: | :heavy_check_mark: | ### Sytem Usage endpoints -| name | purpose | json input | path | HTTP Method | correct status | return type | return value | Jresp | Jreq | A | U | -| :----------------- | ------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------- | ------------------------------ | :---------: | :------------: | :---------: | :----------------------------------------------------------------------------------: | :----------------------: | :----------------------: | :----------------------: | :----------------------: | -| Help | redirects to GitHub projects Docs | `N/A` | api/v1/help | `GET` | 301 | `N/A` | `N/A` | :heavy_multiplication_x: | :heavy_multiplication_x: | :heavy_multiplication_x: | :heavy_multiplication_x: | -| Close | saves & closes the CCash webserver | `N/A` | api/v1/admin/shutdown | `POST` | 204 | `N/A` | `N/A` | :heavy_check_mark: | :heavy_multiplication_x: | :heavy_check_mark: | :heavy_multiplication_x: | -| Contains | checks wether a user exists | `N/A` | api/v1/user/exists?name={name} | `GET` | 204 | `N/A` | `N/A` | :heavy_check_mark: | :heavy_multiplication_x: | :heavy_multiplication_x: | :heavy_multiplication_x: | -| AdminVerifyAccount | checks wether a user is the admin | `N/A` | api/v1/admin/verify_account | `POST` | 204 | `N/A` | `N/A` | :heavy_check_mark: | :heavy_multiplication_x: | :heavy_check_mark: | :heavy_multiplication_x: | -| PruneUsers | deletes users with most recent transactions older then `{time}` (if logs are enabled) and have less money then `{amount}` | {"time":int64,"amount":uint32} or just {"amount":uint32} | api/v1/admin/prune_users | `POST` | 200 | uint64 | number of users deleted | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_multiplication_x: | -| ApiProperties | properties of the given instance | `N/A` | api/properties | `GET` | 200 | json object | {"version":uint64,"max_log":uint64} and "return_on_del":string if feature is enabled | :heavy_check_mark: | :heavy_multiplication_x: | :heavy_multiplication_x: | :heavy_multiplication_x: | +| name | purpose | json input | path | HTTP Method | correct status | return type | return value | Jresp | Jreq | A | U | +| :----------------- | ------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------- | ------------------------------ | :---------: | :------------: | :---------: | :---------------------------------------------------------------------------------------------------------: | :----------------------: | :----------------------: | :----------------------: | :----------------------: | +| Help | redirects to GitHub projects Docs | `N/A` | api/v1/help | `GET` | 301 | `N/A` | `N/A` | :heavy_multiplication_x: | :heavy_multiplication_x: | :heavy_multiplication_x: | :heavy_multiplication_x: | +| Close | saves & closes the CCash webserver | `N/A` | api/v1/admin/shutdown | `POST` | 204 | `N/A` | `N/A` | :heavy_check_mark: | :heavy_multiplication_x: | :heavy_check_mark: | :heavy_multiplication_x: | +| Contains | checks wether a user exists | `N/A` | api/v1/user/exists?name={name} | `GET` | 204 | `N/A` | `N/A` | :heavy_check_mark: | :heavy_multiplication_x: | :heavy_multiplication_x: | :heavy_multiplication_x: | +| AdminVerifyAccount | checks wether a user is the admin | `N/A` | api/v1/admin/verify_account | `POST` | 204 | `N/A` | `N/A` | :heavy_check_mark: | :heavy_multiplication_x: | :heavy_check_mark: | :heavy_multiplication_x: | +| PruneUsers | deletes users with most recent transactions older then `{time}` (if logs are enabled) and have less money then `{amount}` | {"time":int64,"amount":uint32} or just {"amount":uint32} | api/v1/admin/prune_users | `POST` | 200 | uint64 | number of users deleted | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_multiplication_x: | +| ApiProperties | properties of the given instance | `N/A` | api/properties | `GET` | 200 | json object | {"version":uint64,"min_version":uint64_t,"max_log":uint64} and "return_on_del":string if feature is enabled | :heavy_check_mark: | :heavy_multiplication_x: | :heavy_multiplication_x: | :heavy_multiplication_x: | ### System Usage endpoin errors | name | 401 | 404 | 406 |