From d8b21860166d4b6e894c32f92a2df94e2fb289f8 Mon Sep 17 00:00:00 2001 From: Trolli Schmittlauch Date: Mon, 21 Sep 2020 22:14:33 +0200 Subject: [PATCH 1/5] make inclusion of HIE overlay conditional as well --- default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/default.nix b/default.nix index cea4aa3..126975a 100644 --- a/default.nix +++ b/default.nix @@ -14,13 +14,13 @@ let name = "nixpkgs-pinned"; url = https://github.com/NixOS/nixpkgs/; ref = "refs/heads/release-20.03"; - rev = "de3780b937d2984f9b5e20d191f23be4f857b3aa"; + rev = "faf5bdea5d9f0f9de26deaa7e864cdcd3b15b4e8"; }) { # Pass no config for purity config = {}; - overlays = [ + overlays = if withHIE then [ (import all-hies {}).overlay - ]; + ] else []; }; hp = pkgs.haskell.packages."${compiler}"; src = pkgs.nix-gitignore.gitignoreSource [] ./.; From d7355aa04d1cd307a83e92ddf4689b4dda5f0627 Mon Sep 17 00:00:00 2001 From: Trolli Schmittlauch Date: Tue, 22 Sep 2020 19:47:39 +0200 Subject: [PATCH 2/5] 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. --- app/Experiment.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Experiment.hs b/app/Experiment.hs index a999dea..f2fa586 100644 --- a/app/Experiment.hs +++ b/app/Experiment.hs @@ -40,7 +40,7 @@ executeSchedule :: Int -- ^ speedup factor -> IO () executeSchedule speedup events = do -- 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 _ <- forkIO $ clientPublishPost httpMan pubHost pubPort ("foobar #" <> tag) From 9d8df6d3d8b82bd78565088bf01593250d7bdcc2 Mon Sep 17 00:00:00 2001 From: Trolli Schmittlauch Date: Fri, 2 Oct 2020 02:36:02 +0200 Subject: [PATCH 3/5] make the multithread-runtime use all cores by default --- Hash2Pub.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Hash2Pub.cabal b/Hash2Pub.cabal index b343df3..1d3ac7f 100644 --- a/Hash2Pub.cabal +++ b/Hash2Pub.cabal @@ -91,7 +91,7 @@ executable Hash2Pub -- Base language which the package is written in. default-language: Haskell2010 - ghc-options: -threaded + ghc-options: -threaded -rtsopts -with-rtsopts=-N executable Experiment -- experiment runner From ea14ff9b09032a68814ccfa59c24d8f104975ae9 Mon Sep 17 00:00:00 2001 From: Trolli Schmittlauch Date: Fri, 1 Jan 2021 14:30:33 +0100 Subject: [PATCH 4/5] 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 --- Hash2Pub.cabal | 2 +- default.nix | 19 +++++-------------- shell.nix | 2 +- 3 files changed, 7 insertions(+), 16 deletions(-) diff --git a/Hash2Pub.cabal b/Hash2Pub.cabal index 1d3ac7f..376d675 100644 --- a/Hash2Pub.cabal +++ b/Hash2Pub.cabal @@ -46,7 +46,7 @@ category: Network extra-source-files: CHANGELOG.md 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 diff --git a/default.nix b/default.nix index 126975a..a3f7640 100644 --- a/default.nix +++ b/default.nix @@ -1,26 +1,18 @@ { - compiler ? "ghc865", - withHIE ? false + compiler ? "ghc884" }: 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 ( builtins.fetchGit { name = "nixpkgs-pinned"; url = https://github.com/NixOS/nixpkgs/; - ref = "refs/heads/release-20.03"; - rev = "faf5bdea5d9f0f9de26deaa7e864cdcd3b15b4e8"; + ref = "refs/heads/release-20.09"; + rev = "e065200fc90175a8f6e50e76ef10a48786126e1c"; }) { # Pass no config for purity config = {}; - overlays = if withHIE then [ - (import all-hies {}).overlay - ] else []; + overlays = []; }; hp = pkgs.haskell.packages."${compiler}"; src = pkgs.nix-gitignore.gitignoreSource [] ./.; @@ -38,7 +30,6 @@ in hlint stylish-haskell pkgs.python3Packages.asn1ate - ] - ++ (if withHIE then [ hie ] else []); + ]; }; } diff --git a/shell.nix b/shell.nix index dafd212..82fb296 100644 --- a/shell.nix +++ b/shell.nix @@ -1 +1 @@ -(import ./default.nix {withHIE = true;}).shell +(import ./default.nix {}).shell From b46f66e2c0dff72cda7723f2344a0fc68f27c411 Mon Sep 17 00:00:00 2001 From: Trolli Schmittlauch Date: Mon, 16 Aug 2021 20:12:53 +0200 Subject: [PATCH 5/5] update Readme with latest branch name and pointer to SocialHub --- Readme.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Readme.md b/Readme.md index daf9e38..e3cff3d 100644 --- a/Readme.md +++ b/Readme.md @@ -1,7 +1,7 @@ # Hash2Pub ***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. 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`. +For further questions and discussins, please refer to the **Hash2Pub topic in [SocialHub](https://socialhub.activitypub.rocks/c/software/hash2pub/48)**. + ## Building The project and its developent environment are built with [Nix](https://nixos.org/nix/).