BTCPayServer.Vault
BTCPayServer.Vault copied to clipboard
Error when fetching device on Raspbian, Raspberry Pi
Checked out BTCPayVault v1.0.2 and built for linux-arm. The app is starting, but it fails to interface with the hardware wallet (ledger nano s).
This is the log when importing derivation scheme from the vault.
info: BTCPayServer.Vault.Hwi[0]
Permission to https://btcpay.local got granted
dbug: Microsoft.AspNetCore.Server.Kestrel[9]
Connection id "0HM0L50FT2O22" completed keep alive response.
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
Request finished in 2018.7584ms 200
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
Request starting HTTP/1.1 POST http://127.0.0.1:65092/hwi-bridge/v1 text/plain;charset=UTF-8 24
trce: Microsoft.AspNetCore.HostFiltering.HostFilteringMiddleware[2]
All hosts are allowed.
dbug: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[1]
POST requests are not supported
dbug: Microsoft.AspNetCore.Cors.Infrastructure.CorsService[2]
The request has an origin header: 'https://btcpay.local'.
info: Microsoft.AspNetCore.Cors.Infrastructure.CorsService[4]
CORS policy execution successful.
dbug: Microsoft.AspNetCore.Server.Kestrel[25]
Connection id "0HM0L50FT2O22", Request id "0HM0L50FT2O22:00000002": started reading request body.
dbug: Microsoft.AspNetCore.Server.Kestrel[26]
Connection id "0HM0L50FT2O22", Request id "0HM0L50FT2O22:00000002": done reading request body.
dbug: BTCPayServer.Vault.Hwi.Cli[0]
/home/pi/tmp/.net/BTCPayServer.Vault/udcgk2ts.1vo/hwi enumerate
fail: BTCPayServer.Vault.Hwi.Cli[0]
Failed to call hwi
System.ComponentModel.Win32Exception (8): Exec format error
at System.Diagnostics.Process.ForkAndExecProcess(String filename, String[] argv, String[] envp, String cwd, Boolean redirectStdin, Boolean redirectStdout, Boolean redirectStderr, Boolean setCredentials, UInt32 userId, UInt32 groupId, UInt32[] groups, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean usesTerminal, Boolean throwOnNoExec)
at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
at BTCPayServer.Hwi.Transports.CliTransport.StartProcess(ProcessStartInfo startInfo, CancellationToken cancel)
at BTCPayServer.Hwi.Transports.CliTransport.SendCommandAsync(String[] arguments, CancellationToken cancel)
fail: Microsoft.AspNetCore.Server.Kestrel[13]
Connection id "0HM0L50FT2O22", Request id "0HM0L50FT2O22:00000002": An unhandled exception was thrown by the application.
System.ComponentModel.Win32Exception (8): Exec format error
at System.Diagnostics.Process.ForkAndExecProcess(String filename, String[] argv, String[] envp, String cwd, Boolean redirectStdin, Boolean redirectStdout, Boolean redirectStderr, Boolean setCredentials, UInt32 userId, UInt32 groupId, UInt32[] groups, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean usesTerminal, Boolean throwOnNoExec)
at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
at BTCPayServer.Hwi.Transports.CliTransport.StartProcess(ProcessStartInfo startInfo, CancellationToken cancel)
at BTCPayServer.Hwi.Transports.CliTransport.SendCommandAsync(String[] arguments, CancellationToken cancel)
at BTCPayServer.Vault.HWI.InternalTransport.SendCommandAsync(String[] arguments, CancellationToken cancel)
at BTCPayServer.Vault.HWI.HwiServer.Handle(HttpContext ctx)
at Microsoft.Extensions.DependencyInjection.HwiServerExtensions.<>c.<<UseHwiServer>b__1_2>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.AspNetCore.Builder.Extensions.MapMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)
dbug: Microsoft.AspNetCore.Server.Kestrel[9]
Connection id "0HM0L50FT2O22" completed keep alive response.
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
Request finished in 203.2648ms 500
Any idea?
Yes, I know why. The hwi program we are using are the one distributed here: https://github.com/bitcoin-core/HWI/releases and it supports only amd64. (the one in /home/pi/tmp/.net/BTCPayServer.Vault/udcgk2ts.1vo/hwi )
What you can do is compile hwi in arm32 (or arm64 if that's what you use) and replace the hwi executable, then it should work.
If you can improve the build process of hwi project, so @achow101 can easily ship arm versions, I can take that into account to use this on arm machines.
you can also probably take the binary shipped by https://pypi.org/project/hwi/ and replace