orbitdb-archive / orbit-db-counterstore

Counters database for OrbitDB
MIT License
10 stars 8 forks source link

Counter should support decrements #10

Open haadcode opened 8 years ago

haadcode commented 8 years ago

CounterStore currently supports only increase operations inc(value). It should also support decrements dec(value).

This can be done by implementing a PN-Counter in https://github.com/haadcode/crdts and adding appropriate interface to CounterStore.

PN-Counter works like this: https://en.wikipedia.org/wiki/Conflict-free_replicated_data_type#State-based_PN-counter

haadcode commented 6 years ago

The CRDT needed for this was implemented recently by @shamb0t. To implement it here, one can follow the G-Counter as a template.

This would be a great task for first time contributors and would be highly valuable feature!

haadcode commented 6 years ago

The code for PN-Counter is here