Compare commits

...

7 commits

Author SHA1 Message Date
Trolli Schmittlauch b46f66e2c0 update Readme with latest branch name and pointer to SocialHub 2021-08-16 20:12:53 +02:00
Trolli Schmittlauch ea14ff9b09 update ghc to 8.6.4, nixpkgs base to 20.09
- relaxes some version constraints as dirty update quickfix
- removes hie integration as that project is abandoned, todo: switch to
  haskell-languageserver instead
2021-01-01 14:33:03 +01:00
Trolli Schmittlauch 9d8df6d3d8 make the multithread-runtime use all cores by default 2020-10-02 02:36:02 +02:00
Trolli Schmittlauch d7355aa04d increase HTTP timeout for initial post publication to 60 seconds
After a while, experiments made some publication events time-out.
Increasing the timeout just in case, although it i likely to be a mere symptom but the core fault.
2020-09-22 19:47:39 +02:00
Trolli Schmittlauch d8b2186016 make inclusion of HIE overlay conditional as well 2020-09-21 22:16:02 +02:00
Trolli Schmittlauch b48b7a7bba Merge branch 'measurement_logging' into mainline
closes #11, implements #60
2020-09-17 02:19:04 +02:00
Trolli Schmittlauch 6b166ac4ca fixup! Merge branch 'measurement_logging' into mainline 2020-09-07 10:32:58 +02:00
5 changed files with 13 additions and 20 deletions

View file

@ -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

View file

@ -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/).

View file

@ -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)

View file

@ -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 []);
}; };
} }

View file

@ -1 +1 @@
(import ./default.nix {withHIE = true;}).shell (import ./default.nix {}).shell