There were no any news for quite a while now. I guess no one really noticed, but last week I tried to launch V2 of this project. It included following updates:
- Background computing of Proof-of-Work, so user don’t have to manually “unlock” form at all
- Preserving Proof-of-Work between page reloads. This allows to calculate proof-of-work and use it on current page or next. So for example if you read 10 pages and want to comment on last article – you most likely don’t have to wait at all, just click submit, because by that time you accumulate enough proof-of-work already to submit form.
- API to use this proof-of-work in other applications (like in-game currency)
- Better feedback for older browsers, so users could see why they can’t submit form using Internet Explorer 8 🙂
These were major targets for V2, and it does work indeed when testing locally, but totally failed when deployed to production. Here are lessons I learned:
- Ability to quickly roll-back is GREAT 🙂
- Socket.IO is totally useless with any serious number of concurrent users. I am going to use `ws` node.js module and directly browser’s WebSocket API in next release.
- I need to have two identical clusters ready and ability to slowly switch incoming users from old one to new one. Right now I have one server running few docker containers and when deploying new version all users immediately get switched to new release. While in theory it should be all good, in practice I want to have more granular and smooth control over deployment progress. My current plant is to create two identical clusters based on Deis.io and adjust config of HAProxy (this is what used as a load balancer currently) to allow changing PERCENTAGE of users going to cluster A or cluster B.
- Proof-of-work currently used is Dogecoin’s scrypt blocks hashing. The way in-browser miner works with it – uses server software to proxy `getwork` requests. The problem with this approach is that after certain number of concurrent users, `getwork` method is just not able to keep up with submitted work. I am currently working on implementing hybrid based on stratum protocol.
All in all I am moving steadily toward V2.1 which should include all changes above. Hopefully next launch will be successful 🙂