12. Supporting multiple bank customers.

March 18, 2019 ยท View on GitHub

Congrats on making it this far! We now have a bank, a threat model and a bunch of crypto that secures it. Our bank needs more functionality in order to be useful and not just secure.

One of those features is supporting multiple customers per bank instead of just a single one.

Problem

Make a new command {cmd: 'register', customerId: someId} that creates a new customer in the bank.

The customer should send the customerId on every withdraw/deposit/balance operation it does with the bank. and the bank should add the customer id on every entry in its transaction log to support multiple customers.

Expand the teller.js program to require a customerId and to support to register command

Solution

Spin up bank.js and use teller.js to register some customers and deposit/withdraw some money. The two customers operations should not collide, but the bank should still only have one transaction log.

Continue to problem 13