Skip to content

AMS777/nodejs-tether

Repository files navigation

The Tether challenge

This solution creates a multi peer auction room.

Run clients

The first peer is run:

pear dev .

It and publishes an auction room id:

[info] New auction room created: 707c67d26d5b983e26cdb8bea5704380ca28b650d36964d85ccb5301dbed81e4

Other peers are run with the room id to connect to it:

pear dev . 707c67d26d5b983e26cdb8bea5704380ca28b650d36964d85ccb5301dbed81e4

Actions

Once a peer is connected to an auction room, a number of actions can be performed.

Open auction

An auction can be created for an item with an initial price:

auction item01 7

Any peer can open auctions.

An auction can't have the same name as another open auction.

Bid

Peers can bid for any open auction, with the name of the item and the bid:

bid item01 9

The item must exist in an open auction.

The bid amount must be higher than the last top bid.

Close auction

An item auction can be closed:

close item01

A summary of the auction is shown to all peers.

Only the author of the auction can close it.

List auctions

Users can list the open auctions:

list

Help

A help summary with examples can be shown:

help

Improvements

  • Validations should be added for every input data
  • The solution is effemereal and peers only see the actions after they joined the auction room. I tried to add persistency in index-persistency-unfinished.js, but I didn't have time to finish it.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published