-
-
Notifications
You must be signed in to change notification settings - Fork 13.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nwaku: init at 0.16.0 #193679
base: master
Are you sure you want to change the base?
nwaku: init at 0.16.0 #193679
Conversation
52e8bdf
to
e8e2d68
Compare
I have tested this using the following {
services.nwaku = {
enable = true;
tcpPort = 8888;
protocols = ["store" "relay" "filter" "swap" "lightpush"];
nodekey = "abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234";
nat = "extip:12.34.56.78";
rest = {
enable = true;
admin = true;
port = 5052;
};
dnsDiscovery = {
enable = true;
url = "enrtree://AOGECG2SPND25EEFMAJ5WF3KSGJNSGV356DSTL2YVLLZWIV6SAYBM@prod.nodes.status.im";
};
storeMessage = {
retentionPolicy = "time:${toString (7*24*60*60)}"; # 7 days
};
};
services.getty.autologinUser = "root";
systemd.services.nwaku.serviceConfig.StandardOutput = "journal+console";
} And ran it using:
Which worked without issues. |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/prs-ready-for-review/3032/1910 |
34b5d30
to
7dd2d02
Compare
}; | ||
}; | ||
``` | ||
This node will store 30 days worth of messages it will receive under `/var/run/nwaku`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/var/run is a symlink to /run which is a tmpfs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good point. Is there any stock NixOS way of creating a /var/lib
directory for a service?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, it just works:
[root@nixos:~]# ls -l /var/lib/nwaku/
total 4648
-rw-r--r-- 1 nwaku nwaku 598016 Mar 6 22:54 store.sqlite3
-rw-r--r-- 1 nwaku nwaku 32768 Mar 6 22:57 store.sqlite3-shm
-rw-r--r-- 1 nwaku nwaku 4124152 Mar 6 22:57 store.sqlite3-wal
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We usually use tmpfiles.d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But those are not temporary files. That's the store of historical messages.
Thanks for reviewing this. Appreciate it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
linux-aarch64 fails with:
gcc: error: unrecognized command line option '-msse3'
stack trace: (most recent call last)
/nix/store/86y677haw24vwq0idczq6y340fhyrfss-nim-unwrapped-1.6.10/nim/lib/system/nimscript.nim(429, 18)
/build/source/waku.nimble(69, 15) wakunode2Task
/build/source/waku.nimble(35, 8) buildBinary
/nix/store/86y677haw24vwq0idczq6y340fhyrfss-nim-unwrapped-1.6.10/nim/lib/system/nimscript.nim(273, 7) exec
/nix/store/86y677haw24vwq0idczq6y340fhyrfss-nim-unwrapped-1.6.10/nim/lib/system/nimscript.nim:273:7 Error: unhandled exception: FAILED: nim c --out:build/wakunode2 -d:chronicles_log_level=TRACE -d:disableMarchNative --verbosity:0 --hints:off -d:git_version="v0.15.0" -d:release apps/wakunode2/wakunode2.nim [OSError]
make: *** [Makefile:144: wakunode2] Error 1
error: builder for '/nix/store/mnm84bfkbc0swfj4czs3b150i49wbxcp-nwaku-0.15.0-e12b7cb4.drv' failed with exit code 2;
Opened issue for ARM64 build issues: Will be fixed in next release, for now I'll remove support for that platform. |
Oh, we might get a |
I've upgraded to
So we can't make use of |
Waku is the communication layer for Web3. Decentralized communication that scales. Signed-off-by: Jakub Sokołowski <[email protected]>
Signed-off-by: Jakub Sokołowski <[email protected]>
Actually, since this PR was just merged: We get Nimx 1.6.12 by default, and that means the build works without having to compile the compiler again for this package. |
assert nim.version == "1.6.12"; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assert nim.version == "1.6.12"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, that is staying there. The Nim compiler version check is necessary to ensure stability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will break when nim is updated and will likely be removed by the next person because of that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then I can lock Nim version at all-packages.nix
level as I do for nimbus-beacon-node
package.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this really necessary? Are nim updates really that unstable? Nixpkgs is a distribution and normally a patch update for a compiler should not break all applications and we would normally apply that to all programs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Status as a company has probably the most Nim developers, including Nim compiler contributors, among its staff than any other organization, and yes, the use of specific Nim compiler versions is required to avoid very weird issues.
I'll get to locking it up later this week.
commit = "03f0de36"; | ||
name = "${pname}-${version}-${commit}"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
commit = "03f0de36"; | |
name = "${pname}-${version}-${commit}"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, we include the commit in the version of the node.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't add that to name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can remove it from name
, but I will keep commit
anyway for the sake of fake git for git rev-parse
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The contributing guide should mention how pname and version and name should be handled and we normally don't write commit hashes into name/version if we are using a release tag.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's fine. I can remove it, but I will still keep it for fake git rev-parse
, as I said.
|
||
buildInputs = let | ||
# Fix for Nim compiler calling 'git rev-parse' and 'lsb_release'. | ||
fakeGit = writeScriptBin "git" "echo $commit"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fakeGit = writeScriptBin "git" "echo $commit"; | |
fakeGit = writeScriptBin "git" "echo v${version}"; |
we can cheat that easily
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But I don't want the version. I want the commit. Why would I change it like that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it would be easier to update and maintain and only adds very minimal information
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to be maintaining this and I'll somehow cope with the immense burden of updating the commit
attribute.
Description of changes
Waku is the communication layer for Web3. Decentralized communication that scales.
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)nixos/doc/manual/md-to-db.sh
to update generated release notes