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

Upgrade leveldown to avoid problems on M1, mobile platforms #1019

Closed
holmesworcester opened this issue Aug 31, 2022 · 3 comments
Closed

Upgrade leveldown to avoid problems on M1, mobile platforms #1019

holmesworcester opened this issue Aug 31, 2022 · 3 comments

Comments

@holmesworcester
Copy link

holmesworcester commented Aug 31, 2022

Because OrbitDB uses leveldown 5.x (leveldown is now on 6.x) a patch is required to build OrbitDB on different hardware platforms e.g. mobile.

See: TryQuiet/quiet#844 (comment)

OrbitDB should upgrade to the latest leveldown.

(I think leveldown is used in orbit-db-keystore and orbit-db-storage-adapter. If I should create issues in the respective repositories please let me know.)

@holmesworcester
Copy link
Author

holmesworcester commented Nov 22, 2022

Update: this also causes problems and requires an annoying workaround for building on M1 Macs, which are supported in later versions of leveldown.

The workaround is:

cd packages/backend/node_modules/leveldown 
wget https://github.com/Level/leveldown/releases/download/v6.1.0/darwin-x64+arm64.tar.gz 
tar -xf darwin-x64+arm64.tar.gz 
mv darwin-x64+arm64/node.napi.node prebuilds/darwin-arm64 
file prebuilds/darwin-arm64/node.napi.node

And this should return:

file prebuilds/darwin-arm64/node.napi.node: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit bundle x86_64Mach-O 64-bit bundle x86_64] [arm64:Mach-O 64-bit bundle arm64Mach-O 64-bit bundle arm64] prebuilds/darwin-arm64/node.napi.node (for architecture x86_64): Mach-O 64-bit bundle x86_64 prebuilds/darwin-arm64/node.napi.node (for architecture arm64): Mach-O 64-bit bundle arm64

@holmesworcester holmesworcester changed the title Upgrade leveldown Upgrade leveldown to avoid problems on M1, mobile platforms Nov 22, 2022
@haadcode
Copy link
Member

LevelDB was upgraded to 8.0.0 in #1044. You can try it by installing orbit-db as the "next" version, eg. npm i orbit-db@next. There will be a new semver release in the coming days.

Does using that version solve the problem?

@haydenyoung
Copy link
Member

Closing as no further information from OP. Feel free to re-open if problems persist.

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

3 participants