mirror of
https://github.com/Expand-sys/CCash
synced 2025-12-17 00:22:14 +11:00
🔥 removed md files to be rewritten later
This commit is contained in:
parent
eff2d553f5
commit
714292309e
4 changed files with 0 additions and 195 deletions
11
APIs.md
11
APIs.md
|
|
@ -1,11 +0,0 @@
|
||||||
# Language Specific APIs
|
|
||||||
|
|
||||||
## Complete
|
|
||||||
* [JS API](https://github.com/LukeeeeBennett/ccash-client-js)
|
|
||||||
* [ComputerCraft (Lua) API](https://github.com/Reactified/rpm/blob/main/packages/ccash-api/api.lua)
|
|
||||||
* [Python API](https://github.com/fearlessdoggo21/ccashpythonclient)
|
|
||||||
|
|
||||||
## In Dev
|
|
||||||
* [C API]()
|
|
||||||
* [CS API](https://github.com/Soverclysm/CCash-dotnet-api)
|
|
||||||
* [Rust API](https://git.stboyden.com/STBoyden/ccash-rs)
|
|
||||||
110
README.md
110
README.md
|
|
@ -1,110 +0,0 @@
|
||||||
# CCash
|
|
||||||
|
|
||||||
A webserver hosting a bank system for Minecraft, able to be used from web browser or from CC/OC if you're playing modded.
|
|
||||||
|
|
||||||
the currency model most Minecraft Servers adopt if any, is resource based, usually diamonds, this model is fraught with issues however:
|
|
||||||
|
|
||||||
- the primary issue is minecraft worlds are infinite leading to hyper inflation as everyone accrues more diamonds
|
|
||||||
- there is no central authority minting the currency, any consumer can introduce more diamonds to the system
|
|
||||||
- some resources are passively reapable, making the generation of currency a larger focus then of products
|
|
||||||
- locality is required for transaction
|
|
||||||
- theft is possible, ownership is possession based
|
|
||||||
|
|
||||||
CCash solves these issues and adds a level of abstraction, the main philosophy of CCash is to have fast core operations that other services build on
|
|
||||||
|
|
||||||
## Build
|
|
||||||
|
|
||||||
drogon depedencies (varies by OS/distro)
|
|
||||||
```
|
|
||||||
# Debian
|
|
||||||
sudo apt install libjsoncpp-dev uuid-dev openssl libssl-dev zlib1g-dev
|
|
||||||
|
|
||||||
# macOS
|
|
||||||
brew install jsoncpp ossp-uuid openssl zlib
|
|
||||||
```
|
|
||||||
|
|
||||||
building the project
|
|
||||||
|
|
||||||
```
|
|
||||||
git clone --recurse-submodule https://github.com/EntireTwix/CCash/
|
|
||||||
cd CCash
|
|
||||||
mkdir build
|
|
||||||
cd build
|
|
||||||
cmake ..
|
|
||||||
make -j<threads>
|
|
||||||
```
|
|
||||||
|
|
||||||
then edit config.json to include the paths to your certs for HTTPS (I use certbot), or just remove the listener for port 443.
|
|
||||||
|
|
||||||
```
|
|
||||||
vim ../config.json
|
|
||||||
```
|
|
||||||
|
|
||||||
finally, run the program
|
|
||||||
|
|
||||||
```
|
|
||||||
sudo ./bank <admin password> <saving frequency in minutes> <threads>
|
|
||||||
```
|
|
||||||
|
|
||||||
## Connected Services
|
|
||||||
|
|
||||||
Using the Bank's API allows (you/others) to (make/use) connected services that utilize the bank, a couple ideas can be found [here](services.md)
|
|
||||||
|
|
||||||
## Developing for
|
|
||||||
as a dev check out
|
|
||||||
* [APIs](https://github.com/EntireTwix/CCash/blob/main/APIs.md)
|
|
||||||
* [endpoints](https://github.com/EntireTwix/CCash/blob/main/help.md)
|
|
||||||
|
|
||||||
## FAQ
|
|
||||||
**Q:** how is money initially injected into the economy
|
|
||||||
|
|
||||||
**A:** you can take any approach you want, one that I recommend is using a one way exchange via the CC ATM above to have players mine the initial currency, this rewards early adopters and has a sunk cost effect in that the resource is promptly burned
|
|
||||||
|
|
||||||
## [Contributions](https://github.com/EntireTwix/CCash/graphs/contributors)
|
|
||||||
Thank you to the contributors
|
|
||||||
|
|
||||||
| Name | Project Work | Connected Service Work |
|
|
||||||
| :------------------------------------------ | ---------------------------------------------------------------------- | ---------------------- |
|
|
||||||
| [Expand](https://github.com/Expand-sys) | Slight docker changes | Frontend |
|
|
||||||
| [React](https://github.com/Reactified) | CC API, Logo | CC Shop, CC ATM. |
|
|
||||||
| [Doggo](https://github.com/FearlessDoggo21) | Logs loading/adding Optimized, HTTP convention suggestions, Python API | `N/A` |
|
|
||||||
| [Luke](https://github.com/LukeeeeBennett) | JS API, Docker, Slight Doc edits | `N/A` |
|
|
||||||
| [Jolly](https://github.com/STBoyden) | Slight Doc edits | `N/A` |
|
|
||||||
|
|
||||||
## Features
|
|
||||||
|
|
||||||
### Performance
|
|
||||||
- In memory database instead of on disk
|
|
||||||
- **NOT** written in Lua, like a OC/CC implementation
|
|
||||||
- written in **C++**, arguably the fastest language
|
|
||||||
- **multi-threaded**
|
|
||||||
- **parallel hashmaps** a far [superior](https://greg7mdp.github.io/parallel-hashmap/) HashMap implementation to the STD, that also benefits from multi-threaded
|
|
||||||
- **Drogon** is a very fast [web framework](https://www.techempower.com/benchmarks/#section=data-r20&hw=ph&test=composite)
|
|
||||||
- **xxHash** for the hashing of passwords, it is very fast: [graph](https://user-images.githubusercontent.com/750081/61976089-aedeab00-af9f-11e9-9239-e5375d6c080f.png)
|
|
||||||
- **Lightweight**, anecodotally I experienced (on my laptop's i7 6700K, 8 threads):
|
|
||||||
- memory usage of 8.5 MB (with 0 users)
|
|
||||||
- 0.0% CPU usage idle
|
|
||||||
- <1% CPU on average
|
|
||||||
- 1000 requests in parallel completed in 0.85s which spiked CPU usage to 7%
|
|
||||||
|
|
||||||
### Safety
|
|
||||||
|
|
||||||
- **Tamper Proof** relative to an in-game implementation
|
|
||||||
- **Auto-Saving** and Saves on close
|
|
||||||
- All passwords are **Hashed**
|
|
||||||
- **HTTPS** (OpenSSL)
|
|
||||||
|
|
||||||
### Accessibility
|
|
||||||
|
|
||||||
- **RESTful** API for connected services like a market, gambling, or anything else you can think of
|
|
||||||
- able to be used millions of blocks away, across dimensions, servers, **vanilla or modded**.
|
|
||||||
- **Logging** of all transactions, configurable in [consts.hpp](include/consts.hpp)
|
|
||||||
|
|
||||||
### Other
|
|
||||||
- **return balance on deletion**, configurable in [consts.hpp](include/consts.hpp)
|
|
||||||
|
|
||||||
## Dependencies
|
|
||||||
|
|
||||||
- [Parallel HashMap](https://github.com/greg7mdp/parallel-hashmap/tree/master)
|
|
||||||
- [Drogon](https://github.com/an-tao/drogon/tree/master)
|
|
||||||
- [XXHASH](https://github.com/Cyan4973/xxHash)
|
|
||||||
45
help.md
45
help.md
|
|
@ -1,45 +0,0 @@
|
||||||
# Error Responses
|
|
||||||
|
|
||||||
| # | meaning |
|
|
||||||
| --- | ----------------- |
|
|
||||||
| -1 | UserNotFound |
|
|
||||||
| -2 | WrongPassword |
|
|
||||||
| -3 | InvalidRequest |
|
|
||||||
| -4 | NameTooLong |
|
|
||||||
| -5 | UserAlreadyExists |
|
|
||||||
| -6 | InsufficientFunds |
|
|
||||||
|
|
||||||
# Things of Note
|
|
||||||
* all endpoints respond with **JSON** file type
|
|
||||||
* "**A**" denotes requiring Authentication in the form of a header titled "**Password**"
|
|
||||||
|
|
||||||
# Usage
|
|
||||||
| Name | Path | Method | A | Description |
|
|
||||||
| :------------: | :------------------------------------- | :----: | :---: | ------------------------------------------------------------------------------------------------------------------------------- |
|
|
||||||
| GetBal | api/{name}/bal | GET | false | returns the balance of a given user `{name}` |
|
|
||||||
| GetLog | api/{name}/log | GET | true | returns a list of last `n` number of transactions (a configurable amount when the program is compiled) of a given user `{name}` |
|
|
||||||
| SendFunds | api/{name}/send/{to}?amount={amount} | POST | true | sends `{amount}` from user `{name}` to user `{to}` |
|
|
||||||
| VerifyPassword | api/{name}/pass/verify | GET | true | returns `1` if the supplied user `{name}`'s password matches the password supplied in the header |
|
|
||||||
|
|
||||||
# Meta Usage
|
|
||||||
| Name | Path | Method | A | Description |
|
|
||||||
| :------------: | :------------------------------------- | :----: | :---: | ---------------------------------------------------------------------------------------------------------------------------------------- |
|
|
||||||
| ChangePassword | api/{name}/pass/change | PATCH | true | if the password supplied in the header matches the user `{name}`'s password, the user's password is changed to the one given in the body |
|
|
||||||
| SetBal | api/admin/{name}/bal?amount={amount} | PATCH | true | sets the balance of a give user `{name}` if the supplied password matches the admin password |
|
|
||||||
|
|
||||||
# System Usage
|
|
||||||
| Name | Path | Method | A | Description |
|
|
||||||
| :-------------: | :-------------------- | :----: | :---: | ------------------------------------------------------------------------------------- |
|
|
||||||
| Help | api/help | GET | false | the page you're looking at right now! |
|
|
||||||
| Ping | api/ping | GET | false | for pinging the server to see if its online |
|
|
||||||
| Close | api/admin/close | POST | true | saves and then closes the program if the supplied password matches the admin password |
|
|
||||||
| Contains | api/contains/{name} | GET | false | returns `1` if the supplied user `{name}` exists |
|
|
||||||
| AdminVerifyPass | api/admin/verify | GET | true | returns `1` if the password supplied in the header matches the admin password |
|
|
||||||
|
|
||||||
# User Management
|
|
||||||
| Name | Path | Method | A | Description |
|
|
||||||
| :----------: | :------------------------------------------ | :----: | :---: | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
||||||
| AddUser | api/user/{name} | POST | true | registers a user with the name `{name}`, balance of 0 and a password of the password supplied in the header |
|
|
||||||
| AdminAddUser | api/admin/user/{name}?init_bal={init_bal} | POST | true | if the password supplied in the header matches the admin password, then it registers a user with the name `{name}`, balance of `init_bal` and a password supplied by the body of the request |
|
|
||||||
| DelUser | api/user/{name} | DELETE | true | if the password supplied in the header matches the user `{name}`'s password, then the user is deleted |
|
|
||||||
| AdminDelUser | api/admin/user/{name} | DELETE | true | if the password supplied in the header matches the admin password, then the user is deleted |
|
|
||||||
29
services.md
29
services.md
|
|
@ -1,29 +0,0 @@
|
||||||
# Connected Services
|
|
||||||
|
|
||||||
### Implemented:
|
|
||||||
|
|
||||||
- [Web Frontend](https://github.com/Expand-sys/ccashfrontend)
|
|
||||||

|
|
||||||
- [CC Frontend](https://github.com/Reactified/rpm/blob/main/packages/ccash-wallet)
|
|
||||||
|
|
||||||

|
|
||||||
- [CC Shop](https://github.com/Reactified/rpm/tree/main/packages/ccash-shop)
|
|
||||||

|
|
||||||

|
|
||||||
- [CC Reverse ATM](https://github.com/Reactified/misc/tree/main/lua/ccash-bank) an ATM for economies allowing for an initial exchange to start up
|
|
||||||

|
|
||||||
|
|
||||||
### In-Dev:
|
|
||||||
|
|
||||||
- [a Market](https://github.com/STBoyden/market-api-2.0)
|
|
||||||
|
|
||||||
### Ideas:
|
|
||||||
|
|
||||||
- an API in your preferred language (if not found in [APIs.md](APIs.md))
|
|
||||||
- Gambling
|
|
||||||
- Shipping
|
|
||||||
- High-level bank operations such as loans
|
|
||||||
- Some trust based system for transactions similiar to Paypal
|
|
||||||
|
|
||||||
- a better version of one of these existing ideas
|
|
||||||
- something completely different
|
|
||||||
Loading…
Reference in a new issue