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

Update install script to work with Windows #4149

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

casey
Copy link
Collaborator

@casey casey commented Dec 23, 2024

Fixes #4124.

Tested on:

  • ARM Mac
  • x86 Mac
  • x86 Windows
  • x86 Linux

Testing on untested platforms is appreciated!

@cryptoni9n
Copy link
Collaborator

I'm unable to access the explorer on my local ord server on Windows when I run it with --https. I've only ever used http with it up till now. I don't have a cert setup so the TLS/SSL handshake is failing when I attempt the curl command. I've attempted to install a self-signed cert but haven't got it working yet. I'm wondering if maybe this is what the --acme-server flag is for? I'm not certain since I'm unable to locate any documentation on it.

Anyone have experience testing ord server --https locally on a windows machine? Will ask on Discord, also.

@casey
Copy link
Collaborator Author

casey commented Dec 29, 2024

@cryptoni9n Is this related to the install script, or just related to running ord with --https? It sounds like maybe the latter? To get ord working with --https, you'll need a domain for the computer that's running ord, have port 443 open, and pass the domain to --acme-domain.

@cryptoni9n
Copy link
Collaborator

@casey thanks for the quick response. It is an issue with accessing ord over https, but I'm only attempting this configuration because I thought testing the curl install script requires it. If I can run the curl install over http, then I could bypass this issue.

when running on http (F:\0.22.1\release>ord --datadir F:\Bitcoin --cookie-file f:\Bitcoin\.cookie --index "F:\Bitcoin\ord_index\0.22.0\index-0.22-without-874739.redb" --commit-interval 10 server):

MINGW64 /f/Bitcoin/ord_repo/ord (pr-4149)
$ curl --proto '=https' --tlsv1.2 -fsLS http://localhost/install.sh | bash -s
curl: (1) Protocol "http" not supported or disabled in libcurl

MINGW64 /f/Bitcoin/ord_repo/ord (pr-4149)
$ curl --proto '=http' --tlsv1.2 -fsLS http://localhost/install.sh | bash -s
curl: (1) Protocol "https" not supported or disabled in libcurl

MINGW64 /f/Bitcoin/ord_repo/ord (pr-4149)
$ curl --tlsv1.2 -fsLS http://localhost/install.sh | bash -s
install.sh: Could not determine target from output of `uname -m`-`uname -s`, please use `--target`: x86_64-MINGW64_NT-10.0-26100
install.sh: Target architecture is not supported by this install script.
install.sh: Consider opening an issue or building from source: https://github.com/ordinals/ord

when running on https (F:\0.22.1\release>ord --datadir F:\Bitcoin --cookie-file f:\Bitcoin\.cookie --index "F:\Bitcoin\ord_index\0.22.0\index-0.22-without-874739.redb" --commit-interval 10 server --https --acme-domain localhost)

MINGW64 /f/Bitcoin/ord_repo/ord (pr-4149)
$ curl --proto '=https' --tlsv1.2 -fsLS https://localhost/install.sh | bash -s
curl: (35) schannel: failed to receive handshake, SSL/TLS connection failed

MINGW64 /f/Bitcoin/ord_repo/ord (pr-4149)
$ curl --proto '=https' --tlsv1.2 -fsLS https://127.0.0.1:443/install.sh | bash -s
curl: (35) schannel: failed to receive handshake, SSL/TLS connection failed

MINGW64 /f/Bitcoin/ord_repo/ord (pr-4149)
$ curl --proto '=https' --tlsv1.2 -fsLS https://0.0.0.0:443/install.sh | bash -s
curl: (7) Failed to connect to 0.0.0.0 port 443 after 0 ms: Couldn't connect to server

MINGW64 /f/Bitcoin/ord_repo/ord (pr-4149)
$ curl --tlsv1.2 -fsLS https://0.0.0.0:443/install.sh | bash -s
curl: (7) Failed to connect to 0.0.0.0 port 443 after 1 ms: Couldn't connect to server

MINGW64 /f/Bitcoin/ord_repo/ord (pr-4149)
$ curl --tlsv1.2 -fsLS https://localhost/install.sh | bash -s
curl: (35) schannel: failed to receive handshake, SSL/TLS connection failed

@cryptoni9n
Copy link
Collaborator

I removed the https and tls flags and added the --target flag, as directed by the error message. now, when running this command while the server is accessible over http port 80:

MINGW64 /f/Bitcoin/ord_repo/ord (pr-4149)
$ curl -fsLS http://localhost/install.sh | bash -s -- --target x86_64-MINGW64_NT-10.0-26100
install.sh: Repository:  https://github.com/ordinals/ord
install.sh: Crate:       ord
install.sh: Tag:         0.22.1
install.sh: Target:      x86_64-MINGW64_NT-10.0-26100
install.sh: Destination: /c/Users/nine/bin
install.sh: Archive:     https://github.com/ordinals/ord/releases/download/0.22.1/ord-0.22.1-x86_64-MINGW64_NT-10.0-26100.tar.gz
curl: (22) The requested URL returned error: 404

gzip: stdin: unexpected end of file
tar: Child returned status 1
tar: Error is not recoverable: exiting now

also, when visiting https://github.com/ordinals/ord/releases/download/0.22.1/ord-0.22.1-x86_64-MINGW64_NT-10.0-26100.tar.gz, I see the response "Not Found"

@casey
Copy link
Collaborator Author

casey commented Dec 30, 2024

To test the script locally, you should only need to do ./install.sh, no need to curl it.

@cryptoni9n
Copy link
Collaborator

thanks, just gave that a try and have similar result:

$ ./install.sh
curl: (22) The requested URL returned error: 404

I'm noticing through testing with the curl command that the script seems to want to add .tar.gz to the filename, even for Windows which I think is .zip. Perhaps this is part of the issue?

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

Successfully merging this pull request may close these issues.

update install.sh to support Windows x86
2 participants