Compare commits
7 commits
measuremen
...
mainline
Author | SHA1 | Date | |
---|---|---|---|
Trolli Schmittlauch | b46f66e2c0 | ||
Trolli Schmittlauch | ea14ff9b09 | ||
Trolli Schmittlauch | 9d8df6d3d8 | ||
Trolli Schmittlauch | d7355aa04d | ||
Trolli Schmittlauch | d8b2186016 | ||
Trolli Schmittlauch | b48b7a7bba | ||
Trolli Schmittlauch | 6b166ac4ca |
|
@ -46,7 +46,7 @@ category: Network
|
||||||
extra-source-files: CHANGELOG.md
|
extra-source-files: CHANGELOG.md
|
||||||
|
|
||||||
common deps
|
common deps
|
||||||
build-depends: base ^>=4.12.0.0, containers ^>=0.6.0.1, bytestring, utf8-string ^>=1.0.1.1, network ^>=2.8.0.1, time ^>=1.8.0.2, cmdargs ^>= 0.10, cryptonite ^>= 0.25, memory, async, stm, asn1-encoding, asn1-types, asn1-parse, publicsuffix, network-byte-order, safe, iproute, mtl, random, servant, servant-server, servant-client, warp, text, unordered-containers, hashable, unicode-transforms, http-client, http-types, unbounded-delays, dlist, formatting
|
build-depends: base >=4, containers ^>=0.6.0.1, bytestring, utf8-string ^>=1.0.1.1, network ^>=3.1, time, cmdargs ^>= 0.10, cryptonite, memory, async, stm, asn1-encoding, asn1-types, asn1-parse, publicsuffix, network-byte-order, safe, iproute, mtl, random, servant, servant-server, servant-client, warp, text, unordered-containers, hashable, unicode-transforms, http-client, http-types, unbounded-delays, dlist, formatting
|
||||||
ghc-options: -Wall -Wpartial-fields -O2
|
ghc-options: -Wall -Wpartial-fields -O2
|
||||||
|
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ library
|
||||||
exposed-modules: Hash2Pub.FediChord, Hash2Pub.FediChordTypes, Hash2Pub.DHTProtocol, Hash2Pub.ASN1Coding, Hash2Pub.ProtocolTypes, Hash2Pub.PostService, Hash2Pub.RingMap
|
exposed-modules: Hash2Pub.FediChord, Hash2Pub.FediChordTypes, Hash2Pub.DHTProtocol, Hash2Pub.ASN1Coding, Hash2Pub.ProtocolTypes, Hash2Pub.PostService, Hash2Pub.RingMap
|
||||||
|
|
||||||
-- Modules included in this library but not exported.
|
-- Modules included in this library but not exported.
|
||||||
other-modules: Hash2Pub.Utils
|
other-modules: Hash2Pub.Utils, Hash2Pub.PostService.API
|
||||||
|
|
||||||
-- LANGUAGE extensions used by modules in this package.
|
-- LANGUAGE extensions used by modules in this package.
|
||||||
other-extensions: GeneralizedNewtypeDeriving, DataKinds, OverloadedStrings
|
other-extensions: GeneralizedNewtypeDeriving, DataKinds, OverloadedStrings
|
||||||
|
@ -91,7 +91,7 @@ executable Hash2Pub
|
||||||
-- Base language which the package is written in.
|
-- Base language which the package is written in.
|
||||||
default-language: Haskell2010
|
default-language: Haskell2010
|
||||||
|
|
||||||
ghc-options: -threaded
|
ghc-options: -threaded -rtsopts -with-rtsopts=-N
|
||||||
|
|
||||||
executable Experiment
|
executable Experiment
|
||||||
-- experiment runner
|
-- experiment runner
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# Hash2Pub
|
# Hash2Pub
|
||||||
|
|
||||||
***This is heavily WIP and does not provide any useful functionality yet***.
|
***This is heavily WIP and does not provide any useful functionality yet***.
|
||||||
I aim for always having the master branch at a state where it builds and tests pass.
|
I aim for always having the `mainline` branch in a state where it builds and tests pass.
|
||||||
|
|
||||||
A fully-decentralised relay for global hashtag federation in [ActivityPub](https://activitypub.rocks) based on a distributed hash table.
|
A fully-decentralised relay for global hashtag federation in [ActivityPub](https://activitypub.rocks) based on a distributed hash table.
|
||||||
It allows querying and subscribing to all posts of a certain hashtag and is implemented in Haskell.
|
It allows querying and subscribing to all posts of a certain hashtag and is implemented in Haskell.
|
||||||
|
@ -10,6 +10,8 @@ This is the practical implementation of the concept presented in the paper [Dece
|
||||||
|
|
||||||
The ASN.1 module schema used for DHT messages can be found in `FediChord.asn1`.
|
The ASN.1 module schema used for DHT messages can be found in `FediChord.asn1`.
|
||||||
|
|
||||||
|
For further questions and discussins, please refer to the **Hash2Pub topic in [SocialHub](https://socialhub.activitypub.rocks/c/software/hash2pub/48)**.
|
||||||
|
|
||||||
## Building
|
## Building
|
||||||
|
|
||||||
The project and its developent environment are built with [Nix](https://nixos.org/nix/).
|
The project and its developent environment are built with [Nix](https://nixos.org/nix/).
|
||||||
|
|
|
@ -40,7 +40,7 @@ executeSchedule :: Int -- ^ speedup factor
|
||||||
-> IO ()
|
-> IO ()
|
||||||
executeSchedule speedup events = do
|
executeSchedule speedup events = do
|
||||||
-- initialise HTTP manager
|
-- initialise HTTP manager
|
||||||
httpMan <- HTTP.newManager HTTP.defaultManagerSettings
|
httpMan <- HTTP.newManager $ HTTP.defaultManagerSettings { HTTP.managerResponseTimeout = HTTP.responseTimeoutMicro 60000000 }
|
||||||
forM_ events $ \(delay, tag, (pubHost, pubPort)) -> do
|
forM_ events $ \(delay, tag, (pubHost, pubPort)) -> do
|
||||||
_ <- forkIO $
|
_ <- forkIO $
|
||||||
clientPublishPost httpMan pubHost pubPort ("foobar #" <> tag)
|
clientPublishPost httpMan pubHost pubPort ("foobar #" <> tag)
|
||||||
|
|
19
default.nix
19
default.nix
|
@ -1,26 +1,18 @@
|
||||||
{
|
{
|
||||||
compiler ? "ghc865",
|
compiler ? "ghc884"
|
||||||
withHIE ? false
|
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
# pin all-hies for getting the language server
|
|
||||||
all-hies = fetchTarball {
|
|
||||||
url = "https://github.com/infinisil/all-hies/tarball/b8fb659620b99b4a393922abaa03a1695e2ca64d";
|
|
||||||
sha256 = "sha256:0br6wsqpfk1lzz90f7zw439w1ir2p54268qilw9l2pk6yz7ganfx";
|
|
||||||
};
|
|
||||||
pkgs = import (
|
pkgs = import (
|
||||||
builtins.fetchGit {
|
builtins.fetchGit {
|
||||||
name = "nixpkgs-pinned";
|
name = "nixpkgs-pinned";
|
||||||
url = https://github.com/NixOS/nixpkgs/;
|
url = https://github.com/NixOS/nixpkgs/;
|
||||||
ref = "refs/heads/release-20.03";
|
ref = "refs/heads/release-20.09";
|
||||||
rev = "de3780b937d2984f9b5e20d191f23be4f857b3aa";
|
rev = "e065200fc90175a8f6e50e76ef10a48786126e1c";
|
||||||
}) {
|
}) {
|
||||||
# Pass no config for purity
|
# Pass no config for purity
|
||||||
config = {};
|
config = {};
|
||||||
overlays = [
|
overlays = [];
|
||||||
(import all-hies {}).overlay
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
hp = pkgs.haskell.packages."${compiler}";
|
hp = pkgs.haskell.packages."${compiler}";
|
||||||
src = pkgs.nix-gitignore.gitignoreSource [] ./.;
|
src = pkgs.nix-gitignore.gitignoreSource [] ./.;
|
||||||
|
@ -38,7 +30,6 @@ in
|
||||||
hlint
|
hlint
|
||||||
stylish-haskell
|
stylish-haskell
|
||||||
pkgs.python3Packages.asn1ate
|
pkgs.python3Packages.asn1ate
|
||||||
]
|
];
|
||||||
++ (if withHIE then [ hie ] else []);
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue