Skip to content
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

(Maybe) Replication using sodium-javascript not working #355

Open
sce9sc opened this issue Feb 2, 2023 · 4 comments
Open

(Maybe) Replication using sodium-javascript not working #355

sce9sc opened this issue Feb 2, 2023 · 4 comments

Comments

@sce9sc
Copy link

sce9sc commented Feb 2, 2023

Hi, I am not sure that this is totally correct but, I was trying to make hypercore work on a device (termux) that did not have a prebuild version of sodium-native so I had the idea of copying the sodium-javascript (expept from package.json) after installing everything onto the sodium-native folder.

The results were that I could write a hypercore but I could not replicate it.

I don't know if that hack should have worked

@sce9sc
Copy link
Author

sce9sc commented Feb 3, 2023

The error once copying or changing the sodium-universal to sodium-javascript is

replication stream error (initiator): Error: Noise handshake failed
/Users/sce9sc/Documents/Work/test-hyperdrive/node_modules/hypercore/index.js:863
        peer.extension(name, buffer)
             ^

TypeError: Cannot read properties of undefined (reading 'extension')
    at Object.send (/Users/sce9sc/Documents/Work/test-hls-hyperdrive/node_modules/hypercore/index.js:863:14)
    at main (/Users/sce9sc/Documents/Work/test-hls-hyperdrive/testHyperFile.js:214:10)

I need to point that I am using hypercore extension

@mafintosh
Copy link
Contributor

i think you need native. just build it for termux, its should be straight forward (install build deps and reinstall)

@sce9sc
Copy link
Author

sce9sc commented Feb 3, 2023

Thank you for responding so fast.

I tried to install but I get the bellow error

gyp info spawn args ]                             
gyp: Call to 'node deps/bin.js --print-include' returned exit status 1 while in binding.gyp. while trying to load binding.gyp                                        
   gyp ERR! configure error ify:sodium-native: timing reif gyp ERR! stack Error: `gyp` failed with exit code: 1   
 gyp ERR! stack     at ChildProcess.onCpExit (/data/data/com.termux/files/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:325:16) 
gyp ERR! stack     at ChildProcess.emit (node:events:513:28)                                                    gyp 
ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:293:12)                          gyp 
ERR! System Linux 4.19.157-perf-g61dd92dde17b       gyp ERR! command 
"/data/data/com.termux/files/usr/bin/node" "/data/data/com.termux/files/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" 
 gyp ERR! cwd 
/data/data/com.termux/files/home/work/test-nodemules/node_modules/sodium-native                    gyp ERR! node -v v19.4.0                                
gyp ERR! node-gyp -v v9.3.0        
  gyp ERR! not ok                                        
 npm ERR! code 1                                       
  npm ERR! path /data/data/com.termux/files/home/work/test-nodemules/node_modules/sodium-native     
npm ERR! command failed

The think is, that even thought the above is not working copying the sodium-javascript into the sodium-universal should have. Or not? It seems that secret stream is not working with the JavaScript version of sodium-universal.

Thank you, and for the excellent project

@mafintosh
Copy link
Contributor

@sce9sc oh super interesting, thanks! We’ll look into that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants