Skip to content

Commit

Permalink
fix: fixes #76 and #77
Browse files Browse the repository at this point in the history
Now we fetch the latest release of Bitcoin Core instead of the latest tag from the github api to avoid issues of missing signatures.
  • Loading branch information
Fonta1n3 committed Dec 22, 2020
1 parent 25747bd commit 3b5b68f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions XCode/GordianServer-macOS/Helpers/UrlRequest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import Foundation
class FetchLatestRelease {

class func get(completion: @escaping ((dict:NSDictionary?, error:String?)) -> Void) {
let url = "https://api.github.com/repos/bitcoin/bitcoin/tags"
let url = "https://api.github.com/repos/bitcoin/bitcoin/releases"
guard let destination = URL(string: url) else { return }
let request = URLRequest(url: destination)
let session = URLSession.shared
Expand All @@ -22,7 +22,7 @@ class FetchLatestRelease {
if let jsonArray = try JSONSerialization.jsonObject(with: data, options: JSONSerialization.ReadingOptions.mutableContainers) as? NSArray {
if jsonArray.count > 0 {
if let latestTag = jsonArray[0] as? NSDictionary {
if let version = latestTag["name"] as? String {
if let version = latestTag["tag_name"] as? String {
let processedVersion = version.replacingOccurrences(of: "v", with: "")
let dict = [
"version":"\(processedVersion)",
Expand Down
4 changes: 2 additions & 2 deletions XCode/GordianServer-macOS/Scripts/StandUp.command
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ function installBitcoin () {

echo "Signatures do not match! Terminating..."
exit 1

fi

}

function configureBitcoin () {
Expand Down
8 changes: 4 additions & 4 deletions XCode/GordianServer-macOS/Scripts/UpgradeBitcoin.command
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ mkdir ~/.standup
mkdir ~/.standup/BitcoinCore

echo "Downloading $SHA_URL"
curl $SHA_URL -o ~/StandUp/BitcoinCore/SHA256SUMS.asc -s
echo "Saved to ~/StandUp/BitcoinCore/SHA256SUMS.asc"
curl $SHA_URL -o ~/.standup/BitcoinCore/SHA256SUMS.asc -s
echo "Saved to ~/.standup/BitcoinCore/SHA256SUMS.asc"

echo "Downloading Laanwj PGP signature from https://bitcoin.org/laanwj-releases.asc..."
curl https://bitcoin.org/laanwj-releases.asc -o ~/StandUp/BitcoinCore/laanwj-releases.asc -s
echo "Saved to ~/StandUp/BitcoinCore/laanwj-releases.asc"
curl https://bitcoin.org/laanwj-releases.asc -o ~/.standup/BitcoinCore/laanwj-releases.asc -s
echo "Saved to ~/.standup/BitcoinCore/laanwj-releases.asc"

echo "Downloading Bitcoin Core $VERSION from $MACOS_URL"
cd ~/.standup/BitcoinCore
Expand Down

0 comments on commit 3b5b68f

Please sign in to comment.