No description
Find a file
2021-06-23 14:20:11 -07:00
.github/workflows ci: release docker image on main branch 2021-06-16 12:02:28 +01:00
include 🐎 supplemented chrono ms for ctime time() 2021-06-23 14:20:11 -07:00
src 🐎 supplemented chrono ms for ctime time() 2021-06-23 14:20:11 -07:00
third_party added drogon 2021-04-02 01:28:19 -07:00
.dockerignore benchmarking program 2021-06-19 12:23:12 -07:00
.gitignore chore: add .dockerignore 2021-06-16 01:10:49 +01:00
.gitmodules added drogon 2021-04-02 01:28:19 -07:00
APIs.md moved Python API to done 2021-06-18 15:30:19 -07:00
benchmarking.cpp simplified 2021-06-20 13:25:53 -07:00
CMakeLists.txt 🔥 removed simdjson in pursuit of a serialization lib 2021-06-22 17:43:56 -07:00
config.json Update config.json 2021-06-14 23:25:23 -07:00
Dockerfile ci: CMD env vars, publish to GH packages 2021-06-16 02:04:07 +01:00
help.md renamed BankF->api 2021-06-22 21:00:12 -07:00
LICENSE Create LICENSE 2021-04-27 22:53:00 -07:00
main.cpp renamed bank_f->bank_api 2021-06-23 14:18:47 -07:00
README.md Update README.md 2021-06-19 10:42:31 -07:00
services.md Renamed CC ATM 2021-06-15 08:27:55 -07:00
users.json Update users.json 2021-06-14 21:24:14 -07:00

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

Go to here to see the API's endpoints. Language specific APIs can be found here.

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

Thank you to the contributors

Name Project Work Connected Service Work
Expand Slight docker changes Frontend
React CC API, Logo CC Shop, CC ATM.
Doggo Logs loading/adding Optimized, HTTP convention suggestions, Python API N/A
Luke JS API, Docker, Slight Doc edits N/A
Jolly 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 HashMap implementation to the STD, that also benefits from multi-threaded
  • Drogon is a very fast web framework
  • xxHash for the hashing of passwords, it is very fast: graph
  • 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

Dependencies