Commands to install libncursesw5 in linux distros. I need help for BSD

In Debian and in debian based distros
$ sudo apt-get install libncursesw5

In Arch and arch based distros
First import key from package ncurses5-compat-libs

$ gpg --recv-keys C52048C0C0748FEE227D47A2702353E0F7E48EDB
$ git clone https://aur.archlinux.org/ncurses5-compat-libs.git
$ cd ncurses5-compat-libs
$ makepkg -si

I need help for OpenBSD. I can not run grin node.

1 Like

not sure which variant you are running: I think (double check this) but I think freebsd has better rust support. I am working up an openbsd variant myself on an old thinkpad but I haven’t been able to compile anything important because I’ve working through pfsense and getting network routing setup correctly.

Prelim research for OBSD found semarie is working porting the rustLang but check the issues section as things are on the edge here.

wish I had more for you and I’m excited to see what you end up with :heart_hands:

1 Like

Thank you. I know that libncurses is part of the OpenBSD system and that wide character variants are also provided but unfortunately it does not work.

I successfully run grin node and grin wallet in FreeBSD system. Unfortunately OpenBSD do not support rustup. From now and on my public node will run in FreeBSD. :grinning:

2 Likes

Can you please explain me what is this? And how can I fix it? I am really close to run grin in OpenBSD.

Compiling croaring-sys v0.4.6
The following warnings were emitted during compilation:

warning: In file included from CRoaring/roaring.c:2:
warning: CRoaring/roaring.h:41:10: fatal error: 'malloc.h' file not found
warning: #include <malloc.h>  // this should never be needed but there are some reports that it is needed.
warning:          ^~~~~~~~~~
warning: 1 error generated.

error: failed to run custom build command for `croaring-sys v0.4.6`
Caused by:
  process didn't exit successfully: `/home/xaos/grin/target/release/build/croaring-sys-8070fba452f235f9/build-script-build` (exit status: 1)
  --- stdout
  TARGET = Some("x86_64-unknown-openbsd")
  OPT_LEVEL = Some("3")
  HOST = Some("x86_64-unknown-openbsd")
  CC_x86_64-unknown-openbsd = None
  CC_x86_64_unknown_openbsd = None
  HOST_CC = None
  CC = None
  CFLAGS_x86_64-unknown-openbsd = None
  CFLAGS_x86_64_unknown_openbsd = None
  HOST_CFLAGS = None
  CFLAGS = None
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("false")
  CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
  CC_x86_64-unknown-openbsd = None
  CC_x86_64_unknown_openbsd = None
  HOST_CC = None
  CC = None
  CFLAGS_x86_64-unknown-openbsd = None
  CFLAGS_x86_64_unknown_openbsd = None
  HOST_CFLAGS = None
CFLAGS = None
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("false")
  CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
  CC_x86_64-unknown-openbsd = None
  CC_x86_64_unknown_openbsd = None
  HOST_CC = None
  CC = None
  CFLAGS_x86_64-unknown-openbsd = None
  CFLAGS_x86_64_unknown_openbsd = None
  HOST_CFLAGS = None
  CFLAGS = None
  CRATE_CC_NO_DEFAULTS = None
  CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
  running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-Wall" "-Wextra" "-march=native" "-o" "/home/xaos/grin/target/release/build/croaring-sys-8a1bc8993456907e/out/CRoaring/roaring.o" "-c" "CRoaring/roaring.c"
  cargo:warning=In file included from CRoaring/roaring.c:2:
  cargo:warning=CRoaring/roaring.h:41:10: fatal error: 'malloc.h' file not found
  cargo:warning=#include <malloc.h>  // this should never be needed but there are some reports that it is needed.
  cargo:warning=         ^~~~~~~~~~
  cargo:warning=1 error generated.
  exit status: 1
error occurred: Command "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-Wall" "-Wextra" "-march=native" "-o" "/home/xaos/grin/target/release/build/croaring-sys-8a1bc8993456907e/out/CRoaring/roaring.o" "-c" "CRoaring/roaring.c" with args "cc" did not execute successfully (status code exit status: 1).

I’m not an openbsd user so I can merely guess. Based on some quick googling, It might have something to do with this Re: UPDATE: security/keepassxc . If it’s not available and stdlib.h should be used instead, I’m not sure what a “quickfix” would be for it apart from perhaps forking the lib, changing the roaring code (potentially on multiple places) and then pointing to this forked dependency instead. This is just a guess and a potential direction on what to look at if you’re comfortable with these things. If you’re not, the simplest thing would be to build on a more common system i.e. a Debian derivative, which is also what I’d consider if I hit the error and this was an option.

1 Like

So here is a big progress. I built grin latest alpha version :grinning: :grinning: But here is an error. I do not know the reason.

OpenBSD$ cat grin-server.log
20221116 23:16:50.395 INFO grin_util::logger - log4rs is initialized, file level: Info, stdout level: Warn, min. level: Info
20221116 23:16:50.395 INFO grin - Using configuration file at /home/unix/.grin/main/grin-server.toml
20221116 23:16:50.395 INFO grin - This is Grin version 5.2.0-alpha.2 (git v5.2.0-alpha.2), built for x86_64-unknown-openbsd by rustc 1.63.0.
20221116 23:16:50.395 INFO grin - Chain: Mainnet
20221116 23:16:50.395 INFO grin - Accept Fee Base: 500000
20221116 23:16:50.395 INFO grin - Future Time Limit: 300
20221116 23:16:50.395 INFO grin - Feature: NRD kernel enabled: false
20221116 23:16:50.395 WARN grin::cmd::server - Starting GRIN in UI mode…
20221116 23:16:50.397 INFO grin_servers::grin::server - Starting server, genesis block: 40adad0aec27
20221116 23:16:50.412 INFO grin_store::lmdb - Resized database from 1048576 to 134217728
20221116 23:16:50.529 INFO grin_chain::chain - init: saved genesis: 40adad0aec27
20221116 23:16:50.561 ERROR grin_util::logger -
thread ‘main’ panicked at ‘called Result::unwrap() on an Err value: Chain(StoreErr(NotFoundErr(“HEAD”), “NotFoundErr("HEAD")”))’: src/bin/cmd/server.rs:65 0: grin_util::logger::send_panic_to_log::{{closure}}
1: std::panicking::rust_panic_with_hook
2: std::panicking::begin_panic_handler::{{closure}}
3: std::sys_common::backtrace::__rust_end_short_backtrace
4: rust_begin_unwind
5: core::panicking::panic_fmt
6: core::result::unwrap_failed
7: grin::cmd::server::start_server_tui
8: grin::cmd::server::server_command
9: grin::real_main
10: grin::main
11: std::sys_common::backtrace::__rust_begin_short_backtrace
12: std::rt::lang_start::{{closure}}
13: std::rt::lang_start_internal
14: main
15:

When I restart grin here are some more errors.

20221116 23:53:24.393 INFO grin_util::logger - log4rs is initialized, file level: Info, stdout level: Warn, min. level: Info
20221116 23:53:24.393 INFO grin - Using configuration file at /home/unix/.grin/main/grin-server.toml
20221116 23:53:24.393 INFO grin - This is Grin version 5.2.0-alpha.2 (git v5.2.0-alpha.2), built for x86_64-unknown-openbsd by rustc 1.63.0.
20221116 23:53:24.393 INFO grin - Chain: Mainnet
20221116 23:53:24.393 INFO grin - Accept Fee Base: 500000
20221116 23:53:24.393 INFO grin - Future Time Limit: 300
20221116 23:53:24.393 INFO grin - Feature: NRD kernel enabled: false
20221116 23:53:24.393 WARN grin::cmd::server - Starting GRIN in UI mode…
20221116 23:53:24.394 INFO grin_servers::grin::server - Starting server, genesis block: 40adad0aec27
20221116 23:53:24.483 INFO grin_servers::grin::server - Starting rest apis at: 127.0.0.1:3413
20221116 23:53:24.483 WARN grin_api::handlers - Starting HTTP Node APIs server at 127.0.0.1:3413.
20221116 23:53:24.483 WARN grin_api::handlers - HTTP Node listener started.
20221116 23:53:24.483 INFO grin_servers::grin::server - Starting dandelion monitor: 127.0.0.1:3413
20221116 23:53:24.484 WARN grin_servers::grin::server - Grin server started.
20221116 23:53:24.484 INFO grin_servers::common::types - DandelionEpoch: next_epoch: is_stem: true (90%), relay: None
20221116 23:53:30.278 INFO grin_store::lmdb - Resized database from 1048576 to 134217728
20221116 23:53:30.468 ERROR grin_p2p::peers - Could not save received peer addresses: Store(LmdbErr(Error::Code(-30798, ‘MDB_NOTFOUND: No matching key/data pair found’)))
20221116 23:53:30.506 ERROR grin_p2p::peers - Could not save connected peer address: Store(LmdbErr(Error::Code(-30798, ‘MDB_NOTFOUND: No matching key/data pair found’)))
20221116 23:53:30.506 ERROR grin_p2p::peers - Could not save connected peer address: Store(LmdbErr(Error::Code(-30798, ‘MDB_NOTFOUND: No matching key/data pair found’)))
20221116 23:53:30.512 ERROR grin_p2p::peers - Could not save connected peer address: Store(LmdbErr(Error::Code(-30798, ‘MDB_NOTFOUND: No matching key/data pair found’)))
20221116 23:53:30.513 ERROR grin_p2p::peers - Could not save connected peer address: Store(LmdbErr(Error::Code(-30798, ‘MDB_NOTFOUND: No matching key/data pair found’)))
20221116 23:53:30.513 ERROR grin_p2p::peers - Could not save connected peer address: Store(LmdbErr(Error::Code(-30798, ‘MDB_NOTFOUND: No matching key/data pair found’)))
20221116 23:53:30.603 ERROR grin_p2p::peers - Could not save received peer addresses: Store(LmdbErr(Error::Code(-30798, ‘MDB_NOTFOUND: No matching key/data pair found’)))
20221116 23:53:30.613 ERROR grin_p2p::peers - Could not save received peer addresses: Store(LmdbErr(Error::Code(-30798, ‘MDB_NOTFOUND: No matching key/data pair found’)))
20221116 23:53:30.617 ERROR grin_p2p::peers - Could not save received peer addresses: Store(LmdbErr(Error::Code(-30798, ‘MDB_NOTFOUND: No matching key/data pair found’)))
20221116 23:53:30.635 ERROR grin_p2p::peers - Could not save received peer addresses: Store(LmdbErr(Error::Code(-30798, ‘MDB_NOTFOUND: No matching key/data pair found’)))
20221116 23:53:30.638 ERROR grin_p2p::peers - Could not save received peer addresses: Store(LmdbErr(Error::Code(-30798, ‘MDB_NOTFOUND: No matching key/data pair found’)))
20221116 23:53:30.825 ERROR grin_p2p::peers - Could not save connected peer address: Store(LmdbErr(Error::Code(-30798, ‘MDB_NOTFOUND: No matching key/data pair found’)))
20221116 23:53:30.845 ERROR grin_p2p::peers - Could not save connected peer address: Store(LmdbErr(Error::Code(-30798, ‘MDB_NOTFOUND: No matching key/data pair found’)))
20221116 23:53:30.912 ERROR grin_p2p::peers - Could not save connected peer address: Store(LmdbErr(Error::Code(-30798, ‘MDB_NOTFOUND: No matching key/data pair found’)))
20221116 23:53:30.961 INFO grin_servers::common::adapters - Received 32 block headers from 213.239.217.14:3414
20221116 23:53:31.026 INFO grin_servers::common::adapters - Received 32 block headers from 213.239.217.14:3414
20221116 23:53:31.088 ERROR grin_p2p::peers - Could not save received peer addresses: Store(LmdbErr(Error::Code(-30798, ‘MDB_NOTFOUND: No matching key/data pair found’)))
20221116 23:53:31.092 ERROR grin_p2p::peers - Could not save received peer addresses: Store(LmdbErr(Error::Code(-30798, ‘MDB_NOTFOUND: No matching key/data pair found’)))
20221116 23:53:31.162 INFO grin_servers::common::adapters - Received 32 block headers from 213.239.217.14:3414
20221116 23:53:31.179 INFO grin_servers::common::adapters - Received 32 block headers from 213.239.217.14:3414
20221116 23:53:31.233 ERROR grin_p2p::peers - Could not save received peer addresses: Store(LmdbErr(Error::Code(-30798, ‘MDB_NOTFOUND: No matching key/data pair found’)))
20221116 23:53:31.246 INFO grin_servers::common::adapters - Received 32 block headers from 213.239.217.14:3414
20221116 23:53:31.330 INFO grin_servers::common::adapters - Received 32 block headers from 213.239.217.14:3414
20221116 23:53:31.408 INFO grin_servers::common::adapters - Received 32 block headers from 213.239.217.14:3414
20221116 23:53:31.469 INFO grin_servers::common::adapters - Received 32 block headers from 213.239.217.14:3414
20221116 23:53:31.494 INFO grin_servers::common::adapters - Received 32 block headers from 213.239.217.14:3414
20221116 23:53:31.555 INFO grin_servers::common::adapters - Received 32 block headers from 213.239.217.14:3414
20221116 23:53:31.575 INFO grin_servers::common::adapters - Received 32 block headers from 213.239.217.14:3414
20221116 23:53:31.635 INFO grin_servers::common::adapters - Received 32 block headers from 213.239.217.14:3414
20221116 23:53:31.690 INFO grin_servers::common::adapters - Received 32 block headers from 213.239.217.14:3414
20221116 23:53:31.713 INFO grin_servers::common::adapters - Received 32 block headers from 213.239.217.14:3414
20221116 23:53:31.769 INFO grin_servers::common::adapters - Received 32 block headers from 213.239.217.14:3414
20221116 23:53:31.800 INFO grin_servers::common::adapters - Received 32 block headers from 213.239.217.14:3414
20221116 23:53:40.681 INFO grin_servers::common::adapters - Received 32 block headers from 213.239.217.14:3414
20221116 23:53:40.723 ERROR grin_servers::grin::sync::syncer - unexpected error: StoreErr(NotFoundErr(“HEAD”), “chain head”)

I suggest you try to delete the chain data and try syncing again. It may be that you somehow got to a corrupt state.

I already did. But I get the same errors.

An OpenBSD developer answered. The message is here.

" If that’s using lmdb built from upstream source code rather than the package, it won’t have the patch to force MDB_WRITEMAP which is needed on OpenBSD where you can’t mix file and mmap access without syncs (no unified buffer cache). It has downsides too, less safety against application bugs (LMDB: LMDB API) but there’s no alternative."

1 Like

Which toolchain are you using?

I built the latest grin release $ cargo build --release
with changes in ~/.cargo/…/CRoaring/roaring.h file, Let us guard the malloc.h include with a check for glibc. (#412) · RoaringBitmap/CRoaring@4351a6c · GitHub and in ~/.cargo…/lmdb-sys/lib.rs When I start ./grin despite the connected peers I get the error “mdb not found”. That’s why I have to force MDB_WRITEMAP (I do not know how to do it) probably. Also, I have to test and this *-unknown-openbsd - The rustc book but I do not know how to do it exactly also. Do I have to configure something like this? grin/config at master · mimblewimble/grin · GitHub

Grin runs everywhere…
Next target build and run Grin++ wallet in OpenBSD

4 Likes

Check please

2 Likes