Skip to content

Uncomplicate btcblock alias and fix 301 error #593

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

Merged
merged 1 commit into from
Dec 14, 2022

Conversation

histamineblkr
Copy link
Contributor

The btcblock alias was overly complicated requiring multiple cut commands and multiple line reversals due to using wget (which wasn't even installed on debian by default, whereas curl is). Using curl with the silent flag reduces complexity. Also removing the cat command double redirection using HERE doc notation and complicated escaping is accomplished with a single echo command and simply append redirect.

Update the mainnet get block call with curl and fix the 301 error received by calling url in plain text.

The btcblock alias was overly complicated requiring multiple cut commands and multiple line reversals due to using wget (which wasn't even installed on debian by default, whereas curl is). Using curl with the silent flag reduces complexity. Also removing the cat command double redirection using HERE doc notation and complicated escaping is accomplished with a single echo command and simply append redirect.

Update the mainnet get block call with curl and fix the 301 error received by calling url in plain text.
@ChristopherA
Copy link
Collaborator

@histamineblkr Thanks for the PR! @shannona is the lead for this section, but probably will not be able to review/test it for a few weeks as we are under a crunch. It also connects to other repos (such as bitcoin-standup) to sync with their scripts. But your PR seems reasonable!

@shannona
Copy link
Collaborator

Looks very helpful, thank you! I'll need to spin up a Bitcoin instance to check it out, and as Christopher mentioned we're crunching at the moment, so hopeful able to pull this in before too long!

@histamineblkr
Copy link
Contributor Author

histamineblkr commented Dec 2, 2022

Awesome! No worries on time line since it's completely up to you and the team. I will be working through the docs slowly on my off time so I will try to update things as I go.

A couple separate things I noticed are the bitcoin standup script depends on wget being installed. For whatever reason, debian 11 bullseye doesn't come with wget so when I ran the standup.sh it "failed" once it got to the tor section. This caused various problems, some of which I have remedied, but could have duplicated or caused other various config issues.

I guess my question is, would it be helpful if I fixed this and created a different pull request? I think we can make the shell script a bit more robust and better at handling errors. Some simple best practices and error handling will go a long away. I would be happy to put something together if it would be useful and I'd use this best practices reference since it captures most things I'd do.

@ChristopherA
Copy link
Collaborator

Brandon, we would welcome your contribution, especially as a new release of Bitcoin will be out soon.

Last year some major changes to how the Bitcoin binaries are verified put us backward on our roadmap. Instead of finishing fixes to a contribution that would refactor the script to allow for other bitcoin apps to be installed, we had to focus on just keeping the old script (and Gordian Server macOS app) running.

You might want to peek at BlockchainCommons/Bitcoin-Standup-Scripts#15 — it needs some puzzling out to compleye, but would offer some nice integrations.

@histamineblkr
Copy link
Contributor Author

That is a significant refactor going on.
At a glance, it looks like it started over 2 years ago with jodobear forking master and contributing about 17 commits that cleanup and refactor various functionality into separate script files to run on a Linode VPS.
It looks like shannona was the main tester and nochiel began looking into pieces, but that died out around August of 2021. Where do you consider this work at now: on hold, abandon, waiting to be assigned, or?

I definitely have some ideas on how this could go forward. In your README.md the scripts core competencies are:

  • Install the latest stable versions of
    • Tor
    • Bitcoin Core
    • Uncomplicated Firewall (UFW)
    • Random number generator
  • Do debian updates
  • Enable automatic updates for Debian for good security practices
  • Optionally install a QR encoder and an image displayer

basically the 2 scripts (Linode and regular) do that reasonably well. Each script could be improved in their own right, but I think they mostly accomplish this.

Before I do too much work or try to refactor/fix things, I should probably understand what the goal going forward is, if there is one?
Is there a list of services/applications that want to be included?

I will try to give how I view the current implementation:
There are 2 scripts - one runs on a users server and one runs in Linode via Stackscripts. While there is a lot of overlap, these are likely different enough they should be developed differently if possible (depends of dev resources).
I will think more about it and wait for a reply.

@shannona
Copy link
Collaborator

Thanks, @histamineblkr , tested it out and this looks great.

@shannona shannona merged commit 9d1282b into BlockchainCommons:master Dec 14, 2022
@shannona
Copy link
Collaborator

Regarding the larger refactor of StandupScript:

I'd classify it as waiting-to-be-assigned. The biggest problem is that one of our interns from 2020 did some great work, but we didn't have the resources to fully test it, and then emergency updates for changes in the Bitcoin releases forced us to make changes to the scripts in advance of that, and suddenly the PR was no longer cleanly mergeable.

As for the two scripts: they're mostly parallel, but we're only putting the big additions (like new apps) into Standup, mainly because the interface for adding more services into the Linode script would get ridiculous (but I also think that Linode isn't quite the dominant force in the reasonably-priced cloud computing area that it was when we started using it 10 years ago, or so). So, if we had a fix or update I'd like to see them in both, but for making the Standup script more expansive, that's likely only going to be the shell script.

My rough TODO at this point is:

  1. Verify the new 24.0.1 scripts. I've updated the two scripts for 24.0.1, and it looks like there were no changes this time and the update was clean, but I'd love a little more testing than my running both scripts and then a couple of bitcoin-cli commands. My updated PR is 42.
  2. Verify Mac. Parallel to this is a need to update/verify Gordian Server, our Mac Standup.
  3. Integrate Any Scripting Cleanup. If you had any ideas for cleanup in the Bitcoin Scripts, similar to what you did here, we'd love to see them.
  4. Improve how CL StandupScript takes options. The current need for StandupScript.sh to put in five or something options, most of which are blank, makes it pretty inaccessible. I'd love to see a better UI for doing that.
  5. Add in new services to StandupScript per Create first draft of Chapter 15: Setting up a Bitcoin Regtest #15. The next step would then to fully integrate jodobear's updates with what's there now, plus any changes for the intervening years, plus whatever better methodology for options is created.
  6. Add in any additional services. And then the last question would be whether there are any new services to add.

So I'm going to create an issue for that first topic on the Standup repo, and you'd like to help with that, that'd be wonderful, and then let me know if you'd like to go on with the others (and/or if you have other ideas for improvement).

@shannona
Copy link
Collaborator

shannona commented Jan 4, 2023

I wanted to touch bases, @histamineblkr, to see if you were still interested in this.

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

Successfully merging this pull request may close these issues.

3 participants