Go implementation of the ptt.ai framework
Latest commit 6763c23 Dec 19, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.cc gptt-testnet, gptt-testnet2, gptt-ipfs Dec 17, 2018
account Dealing with failed-create-object Dec 3, 2018
build auto updater for windows Dec 14, 2018
cmd defensive programming in blockInfo.GetIsGood Dec 18, 2018
common Implementing sync-with-limited-size. Dec 13, 2018
content Fixed bugs in update-article. Dec 14, 2018
crypto Integrating libp2p as the underlying p2p mechanism. Nov 30, 2018
e2e pass article-friend4, article-friend5, article-friend6 Dec 19, 2018
event basic-setup for the development. able to do p2p connection and basic … Oct 23, 2018
friend save-last-seen in create-object only when I am the creator Dec 5, 2018
internal travis-ci Oct 24, 2018
log basic-setup for the development. able to do p2p connection and basic … Oct 23, 2018
me Dealing with failed-create-object Dec 3, 2018
metrics basic-setup for the development. able to do p2p connection and basic … Oct 23, 2018
node Integrating libp2p as the underlying p2p mechanism. Nov 30, 2018
p2p GetLastAnnounceP2PTS Dec 4, 2018
params Integrating libp2p as the underlying p2p mechanism. Nov 30, 2018
pttai.js @ 8b7a251 update pttai.js to 8b7a2515 Dec 19, 2018
pttdb Dealing with failed-create-object Dec 3, 2018
ptthttp Implementing comment and media. Nov 22, 2018
raft Adding profile. A major revision of the code. Nov 12, 2018
rlp basic-setup for the development. able to do p2p connection and basic … Oct 23, 2018
rpc This implements multi-device setup (with separated accounts). including: Nov 5, 2018
service defensive programming in blockInfo.GetIsGood Dec 18, 2018
static update pttai.js to 8b7a2515 Dec 19, 2018
vendor Implementing p2pbootnode. Nov 29, 2018
.dockerignore basic-setup for the development. able to do p2p connection and basic … Oct 23, 2018
.gitignore auto updater for windows Dec 14, 2018
.gitmodules Implementing http-server (default-port: 9774) Nov 21, 2018
.travis.yml travis-ci Oct 24, 2018
AUTHORS AUTHORS add Danny Wu Oct 23, 2018
Dockerfile update docker for libp2p Dec 19, 2018
Dockerfile.test basic-setup for the development. able to do p2p connection and basic … Oct 23, 2018
ISSUE_TEMPLATE.md defensive programming in blockInfo.GetIsGood Dec 18, 2018
LICENSE Update LICENSE Oct 26, 2018
Makefile Implementing p2pbootnode. Nov 29, 2018
NameComponent.plist basic-setup for the development. able to do p2p connection and basic … Oct 23, 2018
README.md update pttai.js to 369bbf17 Dec 6, 2018
VERSION init the repo Oct 23, 2018
interfaces.go ptt restart and shutdown Oct 24, 2018
scripts add scripts Oct 23, 2018

README.md

GPtt

Official golang implementation of the Ptt.ai Framework.

API Reference Travis

The architecture of Ptt.ai can be found in the link (中文版)

More documents can be found in PIPs

Install

go get github.com/ailabstw/go-pttai
go install github.com/ailabstw/go-pttai/cmd/gptt
${GOPATH}/bin/gptt

Docker Environment

./scripts/docker_build.sh
./scripts/docker.sh
./scripts/docker_stop.sh

Docker with customized storage

./sciprts/docker_with_storage.sh -s [dir]

Unit-Test

make test

Testing for specific dir:

./scripts/test.sh [dir]
(ex: ./scripts/test.sh common)

E2E-Test

Testing for specific e2e-test

./scripts/e2e.sh [any test in the e2e dir]

ex: ./scripts/e2e.sh friend_basic runs TestFriendBasic

Running Godoc

./scripts/doc.sh

Development

The code-structure is based on go-ethereum. The following is the general guide for the development.

go get github.com/ailabstw/go-pttai; cd ${GOPATH}/src/github.com/ailabstw/go-pttai; ./scripts/init_cookiecutter.sh; source __/bin/activate

./scripts/gptt-testnet.sh
  • follow gofmt / goimports
  • follow gotests
  • coding style (in-general):
    1. Each struct file (generated from ./scripts/dev_struct.sh) represents 1 struct
    2. Each module file (generated from ./scripts/dev_module.sh) represents 1 public function
    3. Struct is always CapitalizedCamelCase
    4. Public constants / variables / functions / member variables / member functions are CapitalizedCamelCase
    5. local constants / variables / functions / member variables / member functions are lowerCamelCase
    6. Global variables are in globals.go
    7. Global test variables are in globals_test.go
    8. Errors are in errors.go
  • Naming:
    • Full name: Pttai, pttai
    • cmd: gptt, Gptt (go-ptt)
  • Default ports:
    • http-connection: 9774
    • api-connection: 14779
    • p2p-connection: 9487