Akasha gateway for legacy (web 2.0) applications
292
Restful HTTP API for the Akasha decentralized social network. Work in progress!
If you have a local Go development environment set up, the Akasha gateway can be downloaded and built from source with the usual go get workflow. Please note, the gateway contains certain C code too (secp256k1 crypto library) and as such requires a C compiler too.
$ go get -v github.com/karalabe/akasha-gateway
Alternatively, the Akasha gateway is also available as an automated build from Docker Hub. This is based on the Alpine Linux distribution to keep the image size small (12MB download).
$ docker pull karalabe/akasha-gateway
The Akasha gateway has 3 important options that need to be set:
localhost.80 (requires low-port privileges), defaulting to 8080.$HOME/.akasha.Using the Go binary directly, the above options can be set via command line flags:
$ akasha-gateway --host=akasha.karalabe.com --port=80 --datadir=/my/data/dir
Using docker is a bit more involved, as the port cannot be changed via a flag, rather docker needs to be told to route it differently. As for the data directory, docker needs to explicitly mount an external folder into the container to ensure the data survives a restart:
$ docker run -p 80:8080 -v /my/data/dir:/root/.akasha:rw karalabe/akasha-gateway --host=akasha.karalabe.com
For a list of flags, please consult akasha-gateway --help or docker run karalabe/akasha-gateway --help.
The Akasha gateway is a combo Ethereum and IPFS node in a single process. It attaches to both networks and serves user requests by retrieving the social network's state from Ethereum and resolves data content from IPFS.
Since IPFS data availability is questionable (posting user goes offline), the Akasha gateway constantly watches the Ethereum network for publish events (post, comment, etc) and tries to prefetch them at the moment of publication (high chance that the user is still online). Any content (prefetched or not) successfully resolved from the IPFS network gets pinned into the local datastore to avoid future resource consumption.
Content type
Image
Digest
Size
14.9 MB
Last updated
almost 9 years ago
docker pull karalabe/akasha-gateway