- Cheng-Yu Chung
- chengyuc@usc.edu
You can check out the file in the root directory.
- Box:
"ubuntu/bionic64"
- OS: Ubuntu 18.04 LTS
- Provision: N/A
Note: You can either follow the steps below or run the shell script setup.sh
in the root directory (This script requires root permission).
$ [sudo] apt update
$ [sudo] apt install gcc g++ make
Dependency
$ [sudo] apt install build-essential autoconf libtool pkg-config
Clone the gRPC repository (including submodules)
$ git clone -b $(curl -L https://grpc.io/release) https://github.com/grpc/grpc ~/grpc
$ cd ~/grpc
$ git submodule update --init
Make and install gRPC
$ make
$ [sudo] make install
Protoc
$ cd ~/grpc/third_party/protobuf
$ [sudo] make install
Installation
$ [sudo] apt install libgflags-dev
Installation
$ [sudo] apt install libgtest-dev cmake
$ cd /usr/src/gtest
$ [sudo] cmake CMakeLists.txt
$ [sudo] make
$ [sudo] cp *.a /usr/lib
Installation
$ [sudo] apt install libgoogle-glog-dev
Server
$ make backend_server
$ ./backend_server
Unit test
$ make backend_test
$ ./backend_test
Server
$ make service_server
$ ./service_server
Unit Test
$ make service_test
$ ./service_test
Tool
$ make command_line_tool
$ ./chirp
This program uses glog to log. All the logging will be stored in the folder ./log
. If this folder does not exist, give the following command
$ make check_log_folder
./chirp operations <arguments> [options arguments]
Operations:
--register <username>
--chirp <chirp text>
--follow <username>
--read <chirp id>
--monitor
Options:
--user <username>
--reply <reply chirp id>
Register a user
$ ./chirp --register user
Post a chirp as a user
$ ./chirp --chirp text --user user
Post chirp with tag(s):
Tags start with a "#", don't require space before the "#", must be followed by one or more spaces unless at the end of content.
"#tagone#tagtwo" will be recognized as one tag with content "tagone#tagtwo".
Read a chirp with id 1
$ ./chirp --read 1
Reply a chirp with id 1
$ ./chirp --chirp text --user user --reply 1
Follow a user
$ ./chirp --follow another_user --user user
Monitor as user
$ ./chirp --monitor --user user
Stream (don't require login as a registered user)
$ ./chirp --stream "#tagtext"
Shouldn't include any space between ""