Semestral project for the subject B6B32DSV on FEE CTU in winter semester 2019.
Shared variable
- Implement a program to access the shared variable..
- Realize access using either a 'leader' or exclusive system-wide access.
- Individual nodes will implement at least these functions:
- read / write variable
- log off the system
- exit without logging out
- log in to the system
- Log into both the console and the file.
- Logs will be stamped with a logical timestamp.
- Each node will have a unique identification.
- A combination of IP address and port is recommended.
(Translated from Czech original)
- Written in: TypeScript (transpiled into JavaScript)
- Runtime Environment: Node.js
- Libraries used:
- ws - WebSocket server (and client)
- express - minimalist web server
- axios - HTTP client
- log4js - debugging utility
- and more... (Check package.json)
- Algorithm: Chang and Roberts - ring-based coordinator election algorithm
- Clone repository
cd DSV-Semestralka/
npm install -g yarn
andyarn install
(or just usenpm install
without installingyarn
)
- To build app into native JavaScript run
yarn run build
- To fork (start/spawn) Node run:
- To deploy Nodes to different machines:
- Edit
servers
,username
,password
variables indeploy.js
file - Run
yarn run deploy -- <tip>
(<tip> is template IP address)
- Edit
(You can always use npm
instead of yarn
)