chihaya

module
v0.0.0-...-0b2e9e9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2020 License: BSD-2-Clause

README

Chihaya

CI Go Report Card Lines of Code License IRC Channel

Note: The master branch may be in an unstable or even broken state during development. Please use releases instead of the master branch in order to get stable binaries.

Chihaya is an open source BitTorrent tracker written in Go.

Differentiating features include:

  • HTTP and UDP protocols
  • IPv4 and IPv6 support
  • Pre/Post middlware hooks
  • YAML configuration
  • Metrics via Prometheus
  • High Availability via Redis
  • Kubernetes deployment via Helm

Why Chihaya?

Chihaya is built for developers looking to integrate BitTorrent into a preexisting production environment. Chihaya's pluggable architecture and middleware framework offers a simple and flexible integration point that abstracts the BitTorrent tracker protocols. The most common use case for Chihaya is enabling peer-to-peer cloud software deployments.

Development

Contributing

Long-term discussion and bug reports are maintained via GitHub Issues. Code review is done via GitHub Pull Requests. Real-time discussion is done via freenode IRC.

For more information read CONTRIBUTING.md.

Getting Started
Building from HEAD

In order to compile the project, the latest stable version of Go and knowledge of a working Go environment are required.

$ git clone git@github.com:idcm/chihaya.git
$ cd chihaya
$ go build ./cmd/chihaya
$ ./chihaya --help
Testing

The following will run all tests and benchmarks. Removing -bench will just run unit tests.

$ go test -bench $(go list ./...)

The Chihaya executable contains a command to end-to-end test a BitTorrent tracker. See

$ chihaya --help
Configuration

Configuration of Chihaya is done via one YAML configuration file. The dist/ directory contains an example configuration file. Files and directories under docs/ contain detailed information about configuring middleware, storage implementations, architecture etc.

  • BitTorrent.org: a static website containing the BitTorrent spec and all BEPs
  • OpenTracker: a popular BitTorrent tracker written in C
  • Ocelot: a private BitTorrent tracker written in C++

Directories

Path Synopsis
Package bittorrent implements all of the abstractions used to decouple the protocol of a BitTorrent tracker from the logic of handling Announces and Scrapes.
Package bittorrent implements all of the abstractions used to decouple the protocol of a BitTorrent tracker from the logic of handling Announces and Scrapes.
cmd
http
Package http implements a BitTorrent frontend via the HTTP protocol as described in BEP 3 and BEP 23.
Package http implements a BitTorrent frontend via the HTTP protocol as described in BEP 3 and BEP 23.
http/bencode
Package bencode implements bencoding of data as defined in BEP 3 using type assertion over reflection for performance.
Package bencode implements bencoding of data as defined in BEP 3 using type assertion over reflection for performance.
udp
Package udp implements a BitTorrent tracker via the UDP protocol as described in BEP 15.
Package udp implements a BitTorrent tracker via the UDP protocol as described in BEP 15.
Package middleware implements the TrackerLogic interface by executing a series of middleware hooks.
Package middleware implements the TrackerLogic interface by executing a series of middleware hooks.
clientapproval
Package clientapproval implements a Hook that fails an Announce based on a whitelist or blacklist of BitTorrent client IDs.
Package clientapproval implements a Hook that fails an Announce based on a whitelist or blacklist of BitTorrent client IDs.
jwt
Package jwt implements a Hook that fails an Announce if the client's request is missing a valid JSON Web Token.
Package jwt implements a Hook that fails an Announce if the client's request is missing a valid JSON Web Token.
pkg/random
Package random implements the XORShift PRNG and a way to derive random state from an AnnounceRequest.
Package random implements the XORShift PRNG and a way to derive random state from an AnnounceRequest.
torrentapproval
Package torrentapproval implements a Hook that fails an Announce based on a whitelist or blacklist of torrent hash.
Package torrentapproval implements a Hook that fails an Announce based on a whitelist or blacklist of torrent hash.
pkg
log
Package log adds a thin wrapper around logrus to improve non-debug logging performance.
Package log adds a thin wrapper around logrus to improve non-debug logging performance.
prometheus
Package prometheus implements a standalone HTTP server for serving a Prometheus metrics endpoint.
Package prometheus implements a standalone HTTP server for serving a Prometheus metrics endpoint.
stop
Package stop implements a pattern for shutting down a group of processes.
Package stop implements a pattern for shutting down a group of processes.
timecache
Package timecache provides a cache for the system clock, to avoid calls to time.Now().
Package timecache provides a cache for the system clock, to avoid calls to time.Now().
memory
Package memory implements the storage interface for a Chihaya BitTorrent tracker keeping peer data in memory.
Package memory implements the storage interface for a Chihaya BitTorrent tracker keeping peer data in memory.
redis
Package redis implements the storage interface for a Chihaya BitTorrent tracker keeping peer data in redis with hash.
Package redis implements the storage interface for a Chihaya BitTorrent tracker keeping peer data in redis with hash.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL