Proof Of Concept Zold implementation on Ruby. Zold is A Fast Cryptocurrency for Micro Payments
- Deep dig into Zold protocol and validate Zold conceptions viability in real life cases.
- Get rid of a mash of threads in official zold implementation on ruby and get more stable and easy to hack and support application.
- Validate applicability of some typical in web development solutions and design strategies to build cryptocurrency node.
- Have fun.
There are a lot of design patterns and gems and few pricipes used to get code better, application stable and development easy:
pumaA Ruby/Rack web server built for concurrency with cluster mode.sidekiqSimple, efficient background processing for Ruby. Both puma and sidekiq fully replaces direct threads usage in core application.- Wallets/Scores/Remote nodes stores are designed to be free of file-locking or mutex bottlenecks.
- Wide Rack middlewares usage
foremanto manage Procfile-based applicationsgrapeandswaggerto creating documented interactive REST-like APIs- One YAML-file settings (
./config/settings.yml) overridable by environment variables. - Protocol-based specifiactions described in one module (
./app/protocol.rb) (Hmm.. not sure) - bugsnag is used for realtime production and development bug tracking
- Interactive console (
./bin/console) to have better development and usage expirience - Separated
development,productionandtestenvironments. - Use
ActiveSupport::Dependencies.autoload_pathsinstead of inplace file requirements. Rack::Reloaderfor hot code reloadingguardfor best practices with realtime testing- Respect to
SRP(Single Responsibilty) andCQRS(Command Or Query Separation) principes of software development
- score generation - DONE
- current node emitting and remote nodes discovery - DONE
- wallets receiving - DONE
- pushing wallets to remote nodes - DONE
- wallet creation - TODO
- hosting bonus and taxes - TODO
- stress tests - TODO
- Install redis:
sudo apt-get install redis - Install rbenv/rvm (rbenv is preferrable):
https://github.com/rbenv/rbenv - Install required ruby and it's depdencies:
rbenv install; gem instal bundler - Highly recomended to install direnv to work with environment variables in
.envrcfor development
bundle
Look into ./config/settings.yml
RAKE_ENV=production
SIDEKIQ_USERNAME=sidekiq SIDEKIQ_PASSWORD=YOUPASSWORD
ZOLD_INVOICE=66Yodh14@1142c2d008235bbe
bundle exec foreman start
Where 66Yodh14@1142c2d008235bbe is your (or my) invoice.
- sidekiq - http://localhost:4096/sidekiq
- swagger API doc - http://localhost:4096/swagger
Start guard to have interactive TDD
bundle exec guard
- Redis >=3
- Ruby 2.4/2.5
- Improve API - restrict plain/text responses and requestes. Use json only. Probably use an jsonapi
