Giter Club home page Giter Club logo

auctionsystem's Introduction

Auction system

A simple auction system implemented on a P2P network. Basic APIs are described in Auction Mechanism APIs.

Basic operations

  • Create an auction with a certain end date and starting price.
  • Check the status of an auction.
  • Place a bid on an auction that has not ended yet

Extra operations

  • Create an auction with a certain end date, starting price and a "Buy it Now" option.
  • Buy an auction through the "Buy it now" option.
  • Delete an ongoing auction with no bids.

Note: The "check" now gives new information due to the "Buy it Now" option.

Project Structure

The package src/main/java/edu/ds provides four Java classes:

  • Auction, a class with all the information related to an auction.
  • AuctionMechanism, an interface that defines the auction mechanism.
  • AuctionMechanismImpl, an implementation of the AuctionMechanism interface.
  • Terminal, a terminal that allow to interact with the auction system.

The package src/tes/java provides one JUnit class:

  • AuctionMechanismTest, a Junit class with different test cases.

NOTE While doing tests through terminal be aware of date timezone.

Build app in a Docker container

Build your docker container:
docker build --no-cache -t auctionsystem .

Start the master peer

Start the master peer, in interactive mode (-i) and with two (-e) environment variables:
docker run -i --name MASTER-PEER -e MASTERIP="127.0.0.1" -e ID=0 auctionsystem

,the MASTERIP envirnoment variable is the master peer ip address and the ID environment variable is the unique id of your peer. Rember you have to run the master peer using the ID=0.

Start a generic peer

When master is started check the ip address of your container:

  • Check the docker : docker ps
  • Check the IP address: docker inspect <container ID>

Now you can start your peers varying the unique peer "id":
docker run -i --name PEER-<id> -e MASTERIP=<IP ADDRESS> -e ID=<id> auctionsystem

Example:

docker run -i --name PEER-1 -e MASTERIP="172.17.0.2" -e ID=1 auctionsystem

Technologies

The project has been implemented with:

  • Java 8
  • Apache Maven
  • Eclipse IDE
  • Tom p2p
  • JUnit4
  • Docker

auctionsystem's People

Contributors

simpetr avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.