Inspiration

With the prevalent COVID-19, strong computing hardware is in high demand by scientists and researchers. Because of the disease, we are staying more at home, and consequently, using devices to browse the web a lot more. What if we could take advantage of the increased time spent at a browser and use the browser computing resources to solve the very problem that causes us to use the browser more?

What it does

Colossal Tortoise's purpose is to provide heavy processing power for scientists and researchers to run heavy parallel simulations like evolution simulations and protein folding. The processing power comes from the user browser device's cores. With many users using the browser, if the website appended the worker script tag to their website, they can join the Colossal Tortoise network and help many scientists and researchers fight diseases like COVID-19 by running many simulations and protein folding sessions.

How I built it

I built the frontend and backend using pure javascript, with the exception of some nodejs libraries.

Challenges I ran into

I ran into the issue of distributing the work. I learned to circumvent this by keeping a jobs variable and assigning a flag to see when will it finish.

Additionally, I ran into compatibility issues on iOS Safari. For some reason, the window load randomly fires on Safari iPhone 7 Plus. I figured out that document.readyState strangely is 'complete', even before loading the entire DOM. To solve this, I added an if statement for the document.readyState === 'complete' condition.

A small compatibility issue was that the iframe's onload on Safari doesn't render scrollHeight for some reason, so I had to setInterval to check for the actual 'loaded'.

Another compatibility issue was WebWorker nesting. On what platform did the compatibility issue arise? You guessed it. iOS Safari. I found out that you can WebWorker nest in Chrome but not on Safari. I solved this issue by having the WebWorker postMessage to the main thread on the request of creating another WebWorker.

Accomplishments that I'm proud of

I'm proud that this project has the potential to both utilize the idleness of the cores in our devices and support scientists and researchers at the same time, all while giving the opportunity for the user to contribute to the scientists and researchers who are working on products that change our lives.

What I learned

Worker management, distributing workloads across many remote cores, and using the express-ws library. For the workers, I learned how to use WebWorkers.

What's next for Colossal Tortoise

If the popularity of Colossal Tortoise increases, there is likely to be abusers who will send false results back to the server or spam the job creation form. To circumvent this, there will be a feature that requires captcha verification to submit a job (not to edit a job though) and a result verification function that is optional for the programmers to program in their simulations.

Potential

There is just an infinite amount of possibilities for utilizing the browser supercomputer. You could run algorithms, simulations, support a blockchain network, and anything that is supported in javascript. The limit is just two things: the developer's imagination, and the Colossal Tortoise network.

More details

All the holistic details can be found in the GitHub repo on https://github.com/scheng123/colossal-tortoise

Built With

Share this project:

Updates