Closed Darecjo closed 2 months ago
does this work for you?
git clone --recurse-submodules https://github.com/PrimalHQ/primal-caching-service
cd primal-caching-service
nix --extra-experimental-features 'nix-command flakes' run github:NixOS/nixpkgs/23.11#nix -- develop -c sh -c '$start_primal_caching_service'
nop this is exactly what i tried except for the github:NixOS/nixpkgs/23.11#nix
, I will check and let you know, moreover the docker version works fine. I'm trying to run it on an ec2 instance and I'm facing difficulties with it no clue why.
Ps: the docker version works fine and caching, however I can't access the instance via wss connection.
It would be great if there is a brief guideline for the process, because this service is truly valuable.
its saying the nix-command is disabled even tho the flag is inserted.
root@vultr:~# git clone --recurse-submodules https://github.com/PrimalHQ/primal-caching-service
cd primal-caching-service
nix --extra-experimental-features 'nix-command flakes' run github:NixOS/nixpkgs/23.11#nix -- develop -c sh -c '$start_primal_caching_service'
Cloning into 'primal-caching-service'...
remote: Enumerating objects: 444, done.
remote: Counting objects: 100% (35/35), done.
remote: Compressing objects: 100% (19/19), done.
remote: Total 444 (delta 20), reused 18 (delta 16), pack-reused 409
Receiving objects: 100% (444/444), 143.38 KiB | 3.33 MiB/s, done.
Resolving deltas: 100% (293/293), done.
Submodule 'bech32' (https://github.com/sipa/bech32) registered for path 'bech32'
Submodule 'dev/HTTP.jl' (https://github.com/PrimalHQ/HTTP.jl) registered for path 'dev/HTTP.jl'
Cloning into '/root/primal-caching-service/bech32'...
remote: Enumerating objects: 340, done.
remote: Counting objects: 100% (72/72), done.
remote: Compressing objects: 100% (49/49), done.
remote: Total 340 (delta 25), reused 51 (delta 20), pack-reused 268
Receiving objects: 100% (340/340), 184.50 KiB | 6.59 MiB/s, done.
Resolving deltas: 100% (158/158), done.
Cloning into '/root/primal-caching-service/dev/HTTP.jl'...
remote: Enumerating objects: 11118, done.
remote: Counting objects: 100% (11118/11118), done.
remote: Compressing objects: 100% (3309/3309), done.
remote: Total 11118 (delta 7459), reused 11019 (delta 7422), pack-reused 0
Receiving objects: 100% (11118/11118), 3.12 MiB | 3.17 MiB/s, done.
Resolving deltas: 100% (7459/7459), done.
Submodule path 'bech32': checked out '7a7d7ab158db7078a333384e0e918c90dbc42917'
Submodule path 'dev/HTTP.jl': checked out 'a80909424ec7e6ff016df91d6df208cdbcb3a7b2'
error: experimental Nix feature 'nix-command' is disabled; use '--extra-experimental-features nix-command' to override
what about this?
nix --extra-experimental-features 'nix-command flakes' run github:NixOS/nixpkgs/23.11#nix -- --extra-experimental-features 'nix-command flakes' develop -c sh -c '$start_primal_caching_service'
Couldn't find flake.nix
/home/ubuntu/primal-caching-service# nix --extra-experimental-features 'nix-command flakes' run github:NixOS/nixpkgs/23.11#nix -- --extra-experimental-features 'nix-command flakes' develop -c sh -c '$start_primal_caching_service'
path '/' does not contain a 'flake.nix', searching up
error: could not find a flake.nix file
removed the 23.11#
part now having this
/home/ubuntu/primal-caching-service# nix --extra-experimental-features 'nix-command flakes' run github:NixOS/nixpkgs/ nix -- --extra-experimental-features 'nix-command flakes' develop -c sh -c '$start_primal_caching_service'
error: cannot find flake attribute 'github:NixOS/nixpkgs#defaultApp.x86_64-linux'
it turns out the problem was with the nix
itself I managed to get it up and running using this: curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
Ps: The latest command is the one I used.
Is there any proper configuration for nginx for the cache I can find anywhere?
I managed to run properly, however i strongly introduce providing a step-by-step guidance most people are not familiar with the setting up.
Thanks a lot @pritk I appreciate the overall guidance.
Is there any proper configuration for nginx for the cache I can find anywhere?
we are using nixos module for nginx for configuration. if you are on the same distro or are interested in that form i can share here some parts of our system configuration related to nginx.
that would be great yeah.
Is there any example on how to import a .jsonl
events file directly to the cache using the import_events
function?
i am running in a docker container true the following bash script:
Path=/mnt/bigpart/Docker_files/Nostr/Primal-Cache
cd $Path/primal-caching-service git pull
docker stop Primal-Cache docker rm Primal-Cache
docker run -d -it \
--name Primal-Cache \
-v $Path/primal-caching-service:pwd
\
-w pwd
\
-p 8801:8801 \
-e PRIMALSERVER_HOST=0.0.0.0 \
nixos/nix nix --extra-experimental-features 'nix-command flakes' develop -c sh -c '$start_primal_caching_service' \
:/mnt/bigpart/Docker_files/Nostr/Primal-Cache # docker logs Primal-Cache -f
warning: updating lock file '/mnt/bigpart/Docker_files/Nostr/Primal-Cache/primal-caching-service/flake.lock':
• Updated input 'nixpkgs':
'github:NixOS/nixpkgs/49b373958553f8b7fea8795b7bb4ede86057488c?narHash=sha256-ZvK5gZ9jtF%2BQK5VZokjqQ6y2at3WQjoXWkWQLaPWr2c%3D' (2023-05-10)
→ 'github:NixOS/nixpkgs/d272ca50d1f7424fbfcd1e6f1c9e01d92f6da167?narHash=sha256-y31s5idk3jMJMAVE4Ud9AdI7HT3CgTAeMTJ0StqKN7Y%3D' (2024-04-08)
warning: Git tree '/mnt/bigpart/Docker_files/Nostr/Primal-Cache/primal-caching-service' is dirty
gcc -shared -g -fPIC -O2 -o libbech32.so -Ibech32/ref/c bech32.c
bech32.c:5:10: fatal error: segwit_addr.c: No such file or directory
5 | #include "segwit_addr.c"
| ^~~~~~~
compilation terminated.
make: *** [Makefile:2: libbech32.so] Error 1
.
.
.
.
.
Precompiling project...
82 dependencies successfully precompiled in 119 seconds
1 dependency errored. To see a full report either run import Pkg; Pkg.precompile()
or load the package
0 dependencies successfully precompiled in 0 seconds. 82 already precompiled.
now i am stuck is it my?
did you clone git submodules too?
did you clone git submodules too?
Thanks that did the trick (never heard about submods)
I'm having the following error is there any solution for it. I'm not familiar with nix.