Skip to content

Commit

Permalink
feat: general fixes and improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Fonta1n3 committed Dec 2, 2024
1 parent 78d78b7 commit 0d1e203
Show file tree
Hide file tree
Showing 24 changed files with 206 additions and 175 deletions.
14 changes: 10 additions & 4 deletions FullyNoded-Server.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
0AA6924B2C7F89E800366192 /* Script.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AA6924A2C7F89E800366192 /* Script.swift */; };
0AA6925E2C7F8EC700366192 /* CheckForBitcoinCore.command in Resources */ = {isa = PBXBuildFile; fileRef = 0AA6924C2C7F8EC700366192 /* CheckForBitcoinCore.command */; };
0AA6925F2C7F8EC700366192 /* CheckXCodeSelect.command in Resources */ = {isa = PBXBuildFile; fileRef = 0AA6924D2C7F8EC700366192 /* CheckXCodeSelect.command */; };
0AA692602C7F8EC700366192 /* DeleteWallet.command in Resources */ = {isa = PBXBuildFile; fileRef = 0AA6924E2C7F8EC700366192 /* DeleteWallet.command */; };
0AA692612C7F8EC700366192 /* InstallBrew.command in Resources */ = {isa = PBXBuildFile; fileRef = 0AA6924F2C7F8EC700366192 /* InstallBrew.command */; };
0AA692622C7F8EC700366192 /* InstallXcode.command in Resources */ = {isa = PBXBuildFile; fileRef = 0AA692502C7F8EC700366192 /* InstallXcode.command */; };
0AA692632C7F8EC700366192 /* IsProcessRunning.command in Resources */ = {isa = PBXBuildFile; fileRef = 0AA692512C7F8EC700366192 /* IsProcessRunning.command */; };
Expand All @@ -63,6 +62,8 @@
0AA6926E2C7F8EC700366192 /* Verify.command in Resources */ = {isa = PBXBuildFile; fileRef = 0AA6925C2C7F8EC700366192 /* Verify.command */; };
0AA692702C7F962A00366192 /* Home.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AA6926F2C7F962A00366192 /* Home.swift */; };
0AA692722C80B01A00366192 /* BitcoinRPC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AA692712C80B01A00366192 /* BitcoinRPC.swift */; };
0AC92C2B2CFE5F4600F10EC6 /* UpdateLightning.command in Resources */ = {isa = PBXBuildFile; fileRef = 0AC92C2A2CFE5F4600F10EC6 /* UpdateLightning.command */; };
0AC92C2D2CFE5FC300F10EC6 /* LaunchUpdateLightning.command in Resources */ = {isa = PBXBuildFile; fileRef = 0AC92C2C2CFE5FC300F10EC6 /* LaunchUpdateLightning.command */; };
0AD7BE0D2CB97F4100428D02 /* LatestJoinMarketRelease.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AD7BE0C2CB97F4100428D02 /* LatestJoinMarketRelease.swift */; };
0AD7BE0F2CB980D500428D02 /* JoinMarketTaggedReleases.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AD7BE0E2CB980D500428D02 /* JoinMarketTaggedReleases.swift */; };
0AD7BE112CBD6AA500428D02 /* InstallJoinMarket.command in Resources */ = {isa = PBXBuildFile; fileRef = 0AD7BE102CBD6AA500428D02 /* InstallJoinMarket.command */; };
Expand Down Expand Up @@ -127,7 +128,6 @@
0AA6924A2C7F89E800366192 /* Script.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Script.swift; sourceTree = "<group>"; };
0AA6924C2C7F8EC700366192 /* CheckForBitcoinCore.command */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = CheckForBitcoinCore.command; sourceTree = "<group>"; };
0AA6924D2C7F8EC700366192 /* CheckXCodeSelect.command */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = CheckXCodeSelect.command; sourceTree = "<group>"; };
0AA6924E2C7F8EC700366192 /* DeleteWallet.command */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = DeleteWallet.command; sourceTree = "<group>"; };
0AA6924F2C7F8EC700366192 /* InstallBrew.command */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = InstallBrew.command; sourceTree = "<group>"; };
0AA692502C7F8EC700366192 /* InstallXcode.command */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = InstallXcode.command; sourceTree = "<group>"; };
0AA692512C7F8EC700366192 /* IsProcessRunning.command */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = IsProcessRunning.command; sourceTree = "<group>"; };
Expand All @@ -144,6 +144,8 @@
0AA6925C2C7F8EC700366192 /* Verify.command */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = Verify.command; sourceTree = "<group>"; };
0AA6926F2C7F962A00366192 /* Home.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Home.swift; sourceTree = "<group>"; };
0AA692712C80B01A00366192 /* BitcoinRPC.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BitcoinRPC.swift; sourceTree = "<group>"; };
0AC92C2A2CFE5F4600F10EC6 /* UpdateLightning.command */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = UpdateLightning.command; sourceTree = "<group>"; };
0AC92C2C2CFE5FC300F10EC6 /* LaunchUpdateLightning.command */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = LaunchUpdateLightning.command; sourceTree = "<group>"; };
0AD7BE0C2CB97F4100428D02 /* LatestJoinMarketRelease.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LatestJoinMarketRelease.swift; sourceTree = "<group>"; };
0AD7BE0E2CB980D500428D02 /* JoinMarketTaggedReleases.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JoinMarketTaggedReleases.swift; sourceTree = "<group>"; };
0AD7BE102CBD6AA500428D02 /* InstallJoinMarket.command */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = InstallJoinMarket.command; sourceTree = "<group>"; };
Expand Down Expand Up @@ -289,7 +291,6 @@
children = (
0AA6924C2C7F8EC700366192 /* CheckForBitcoinCore.command */,
0AA6924D2C7F8EC700366192 /* CheckXCodeSelect.command */,
0AA6924E2C7F8EC700366192 /* DeleteWallet.command */,
0AA6924F2C7F8EC700366192 /* InstallBrew.command */,
0AA692502C7F8EC700366192 /* InstallXcode.command */,
0AA692512C7F8EC700366192 /* IsProcessRunning.command */,
Expand Down Expand Up @@ -324,6 +325,8 @@
593A89202CE28400001504F0 /* LaunchIncreaseGapLimit.command */,
593A89242CE519B3001504F0 /* LaunchObWatcher.command */,
593A89262CE51A35001504F0 /* ObWatcher.command */,
0AC92C2A2CFE5F4600F10EC6 /* UpdateLightning.command */,
0AC92C2C2CFE5FC300F10EC6 /* LaunchUpdateLightning.command */,
);
path = Scripts;
sourceTree = "<group>";
Expand Down Expand Up @@ -413,12 +416,12 @@
0AA692422C7F831F00366192 /* Preview Assets.xcassets in Resources */,
0AA692632C7F8EC700366192 /* IsProcessRunning.command in Resources */,
0AA692672C7F8EC700366192 /* LaunchVerifier.command in Resources */,
0AC92C2D2CFE5FC300F10EC6 /* LaunchUpdateLightning.command in Resources */,
593A89272CE51A35001504F0 /* ObWatcher.command in Resources */,
0AA692612C7F8EC700366192 /* InstallBrew.command in Resources */,
0AA6926C2C7F8EC700366192 /* StopBitcoin.command in Resources */,
0AD7BE152CBD7AC100428D02 /* LaunchJMInstaller.command in Resources */,
0AA692642C7F8EC700366192 /* LaunchBrewInstall.command in Resources */,
0AA692602C7F8EC700366192 /* DeleteWallet.command in Resources */,
0AA6926D2C7F8EC700366192 /* Strap.command in Resources */,
0AD7BE212CC2B1F100428D02 /* StartJm.command in Resources */,
0AA6926B2C7F8EC700366192 /* StartBitcoin.command in Resources */,
Expand Down Expand Up @@ -446,6 +449,7 @@
0AA6925E2C7F8EC700366192 /* CheckForBitcoinCore.command in Resources */,
0A573E312CB577D100899F84 /* GetRune.command in Resources */,
0AA692682C7F8EC700366192 /* LaunchXcodeInstall.command in Resources */,
0AC92C2B2CFE5F4600F10EC6 /* UpdateLightning.command in Resources */,
0AA692652C7F8EC700366192 /* LaunchInstaller.command in Resources */,
0A5CE8E02C8A2ADE00534A8D /* CheckForLightning.command in Resources */,
);
Expand Down Expand Up @@ -661,6 +665,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
CODE_SIGN_ENTITLEMENTS = "FullyNoded-Server/FullyNoded_Server.entitlements";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
Expand Down Expand Up @@ -702,6 +707,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
CODE_SIGN_ENTITLEMENTS = "FullyNoded-Server/FullyNoded_Server.entitlements";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
21 changes: 0 additions & 21 deletions FullyNoded-Server/Assets.xcassets/1024.imageset/Contents.json

This file was deleted.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 13 additions & 2 deletions FullyNoded-Server/Assets.xcassets/AppIcon.appiconset/Contents.json
Original file line number Diff line number Diff line change
@@ -1,56 +1,67 @@
{
"images" : [
{
"idiom" : "universal",
"platform" : "ios",
"filename" : "1024-mac.png",
"idiom" : "ios-marketing",
"scale" : "1x",
"size" : "1024x1024"
},
{
"filename" : "16-mac.png",
"idiom" : "mac",
"scale" : "1x",
"size" : "16x16"
},
{
"filename" : "32-mac.png",
"idiom" : "mac",
"scale" : "2x",
"size" : "16x16"
},
{
"filename" : "32-mac.png",
"idiom" : "mac",
"scale" : "1x",
"size" : "32x32"
},
{
"filename" : "64-mac.png",
"idiom" : "mac",
"scale" : "2x",
"size" : "32x32"
},
{
"filename" : "128-mac.png",
"idiom" : "mac",
"scale" : "1x",
"size" : "128x128"
},
{
"filename" : "256-mac.png",
"idiom" : "mac",
"scale" : "2x",
"size" : "128x128"
},
{
"filename" : "256-mac.png",
"idiom" : "mac",
"scale" : "1x",
"size" : "256x256"
},
{
"filename" : "512-mac.png",
"idiom" : "mac",
"scale" : "2x",
"size" : "256x256"
},
{
"filename" : "512-mac.png",
"idiom" : "mac",
"scale" : "1x",
"size" : "512x512"
},
{
"filename" : "1024-mac.png",
"idiom" : "mac",
"scale" : "2x",
"size" : "512x512"
Expand Down
9 changes: 5 additions & 4 deletions FullyNoded-Server/Helpers/InstallBtcCore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -120,18 +120,19 @@ class CreateFNDirConfigureCore {
}
}

static let fnServerDir = "/Users/\(NSUserName())/.fullynoded"

class func setFullyNodedDirectory(completion: @escaping (Bool) -> Void) {
createDirectory("/Users/\(NSUserName())/.fullynoded", completion: completion)

if writeFile("/Users/\(NSUserName())/.fullynoded/fullynoded.log", "") {
createDirectory(fnServerDir, completion: completion)
if writeFile("\(fnServerDir)/fullynoded.log", "") {
createBitcoinCoreDirectory(completion: completion)
} else {
completion((false))
}
}

class func createBitcoinCoreDirectory(completion: @escaping (Bool) -> Void) {
let path = "/Users/\(NSUserName())/.fullynoded/BitcoinCore"
let path = "\(fnServerDir)/BitcoinCore"
do {
let fileManager = FileManager.default
if fileManager.fileExists(atPath: path) {
Expand Down
37 changes: 24 additions & 13 deletions FullyNoded-Server/Helpers/Script.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import Foundation

public enum SCRIPT: String {
case launchUpdateLightning
case updateLightning
case obWatcher
case launchObWatcher
case launchIncreaseGapLimit
Expand Down Expand Up @@ -40,14 +42,18 @@ public enum SCRIPT: String {
case checkForBitcoin
case installBitcoin
case checkXcodeSelect
case getStrapped
case launchStrap
case isBitcoinOn
case deleteWallet
//case getStrapped
//case launchStrap
//case isBitcoinOn
//case deleteWallet
case startBitcoin

var stringValue:String {
switch self {
case .launchUpdateLightning:
return "LaunchUpdateLightning"
case .updateLightning:
return "UpdateLightning"
case .obWatcher:
return "ObWatcher"
case .launchObWatcher:
Expand Down Expand Up @@ -108,14 +114,14 @@ public enum SCRIPT: String {
return "InstallBitcoin"
case .checkXcodeSelect:
return "CheckXCodeSelect"
case .getStrapped:
return "Strap"
case .launchStrap:
return "LaunchStrap"
case .isBitcoinOn:
return "IsBitcoinOn"
case .deleteWallet:
return "DeleteWallet"
// case .getStrapped:
// return "Strap"
// case .launchStrap:
// return "LaunchStrap"
// case .isBitcoinOn:
// return "IsBitcoinOn"
// case .deleteWallet:
// return "DeleteWallet"
case .startBitcoin:
return "StartBitcoin"
}
Expand Down Expand Up @@ -162,7 +168,12 @@ public enum ScriptUtil {
let errData = stdErr.fileHandleForReading.readDataToEndOfFile()
let output = String(data: data, encoding: .utf8)
let errorOutput = String(data: errData, encoding: .utf8)
completion((output, data, errorOutput))
if errorOutput == "" {
completion((output, data, nil))
} else {
completion((output, data, errorOutput))
}

}
}
}
Expand Down
3 changes: 1 addition & 2 deletions FullyNoded-Server/Scripts/CheckForBitcoinCore.command
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#!/bin/sh


if [ -d ~/.fullynoded/BitcoinCore ]; then
sudo -u $(whoami) ~/.fullynoded/BitcoinCore/$PREFIX/bin/bitcoind -version
sudo -u $(whoami) "/Users/$(whoami)/.fullynoded/BitcoinCore/$PREFIX/bin/bitcoind" -version
else
echo "Bitcoin not installed"
fi
Expand Down
58 changes: 0 additions & 58 deletions FullyNoded-Server/Scripts/DeleteWallet.command

This file was deleted.

1 change: 0 additions & 1 deletion FullyNoded-Server/Scripts/LaunchInstaller.command
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/bin/sh


INSTALL_SCRIPT_PATH="/Users/$(whoami)/.fullynoded/installBitcoin.sh"
LOG="/Users/$(whoami)/.fullynoded/fullynoded.log"
touch $INSTALL_SCRIPT_PATH
Expand Down
14 changes: 14 additions & 0 deletions FullyNoded-Server/Scripts/LaunchUpdateLightning.command
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh

# LaunchUpdateLightning.command
# FullyNoded-Server
#
# Created by Peter Denton on 12/2/24.
#
INSTALL_SCRIPT_PATH="/Users/$(whoami)/.fullynoded/updateLightning.sh"
LOG="/Users/$(whoami)/.fullynoded/fullynoded.log"
touch $INSTALL_SCRIPT_PATH
echo "\"$(cd "$(dirname "$0")"; pwd)/UpdateLightning.command\" $RPC_USER $RPC_PASSWORD $DATA_DIR $PREFIX $NETWORK | tee -a $LOG" > $INSTALL_SCRIPT_PATH
chmod +x $INSTALL_SCRIPT_PATH
open -a Terminal $INSTALL_SCRIPT_PATH
exit 1
9 changes: 9 additions & 0 deletions FullyNoded-Server/Scripts/UpdateLightning.command
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh

# UpdateLightning.command
# FullyNoded-Server
#
# Created by Peter Denton on 12/2/24.
#
export BREW_PATH=/opt/homebrew/bin/brew
sudo -u $(whoami) $BREW_PATH upgrade core-lightning
Loading

0 comments on commit 0d1e203

Please sign in to comment.