From a1bd48a955c3198834c2249f2116a1fabe656da1 Mon Sep 17 00:00:00 2001 From: Fonta1n3 Date: Wed, 4 Dec 2024 13:01:41 -0600 Subject: [PATCH] feat: set mainnet to default, add help view --- FullyNoded-Server.xcodeproj/project.pbxproj | 12 ++++-- FullyNoded-Server/Views/BitcoinCore.swift | 6 +-- FullyNoded-Server/Views/ContentView.swift | 20 +++++++-- FullyNoded-Server/Views/Help.swift | 41 +++++++++++++++++++ FullyNoded-Server/Views/JoinMarket.swift | 4 +- .../Views/JoinMarketTaggedReleases.swift | 5 +-- 6 files changed, 73 insertions(+), 15 deletions(-) create mode 100644 FullyNoded-Server/Views/Help.swift diff --git a/FullyNoded-Server.xcodeproj/project.pbxproj b/FullyNoded-Server.xcodeproj/project.pbxproj index 75a0304d..ea02d8f5 100644 --- a/FullyNoded-Server.xcodeproj/project.pbxproj +++ b/FullyNoded-Server.xcodeproj/project.pbxproj @@ -76,6 +76,7 @@ 0AD7BE212CC2B1F100428D02 /* StartJm.command in Resources */ = {isa = PBXBuildFile; fileRef = 0AD7BE202CC2B1F100428D02 /* StartJm.command */; }; 0AD7BE232CC2B47400428D02 /* LaunchJMStarter.command in Resources */ = {isa = PBXBuildFile; fileRef = 0AD7BE222CC2B47400428D02 /* LaunchJMStarter.command */; }; 0AD7BE252CC2BCEF00428D02 /* StopJm.command in Resources */ = {isa = PBXBuildFile; fileRef = 0AD7BE242CC2BCEF00428D02 /* StopJm.command */; }; + 0AF736212D00D0900026FE0A /* Help.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AF736202D00D0900026FE0A /* Help.swift */; }; 593A891F2CE28334001504F0 /* IncreaseGapLimit.command in Resources */ = {isa = PBXBuildFile; fileRef = 593A891E2CE28334001504F0 /* IncreaseGapLimit.command */; }; 593A89212CE28400001504F0 /* LaunchIncreaseGapLimit.command in Resources */ = {isa = PBXBuildFile; fileRef = 593A89202CE28400001504F0 /* LaunchIncreaseGapLimit.command */; }; 593A89232CE511F8001504F0 /* FNIcon.swift in Sources */ = {isa = PBXBuildFile; fileRef = 593A89222CE511F8001504F0 /* FNIcon.swift */; }; @@ -158,6 +159,7 @@ 0AD7BE202CC2B1F100428D02 /* StartJm.command */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = StartJm.command; sourceTree = ""; }; 0AD7BE222CC2B47400428D02 /* LaunchJMStarter.command */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = LaunchJMStarter.command; sourceTree = ""; }; 0AD7BE242CC2BCEF00428D02 /* StopJm.command */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = StopJm.command; sourceTree = ""; }; + 0AF736202D00D0900026FE0A /* Help.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Help.swift; sourceTree = ""; }; 1B8BA5D0924A1AE2EC951616 /* Pods-FullyNoded-Server.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-FullyNoded-Server.debug.xcconfig"; path = "Target Support Files/Pods-FullyNoded-Server/Pods-FullyNoded-Server.debug.xcconfig"; sourceTree = ""; }; 593A891E2CE28334001504F0 /* IncreaseGapLimit.command */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = IncreaseGapLimit.command; sourceTree = ""; }; 593A89202CE28400001504F0 /* LaunchIncreaseGapLimit.command */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = LaunchIncreaseGapLimit.command; sourceTree = ""; }; @@ -192,6 +194,7 @@ 0AD7BE0E2CB980D500428D02 /* JoinMarketTaggedReleases.swift */, 0AD7BE162CBD8DA000428D02 /* JoinMarket.swift */, 593A89222CE511F8001504F0 /* FNIcon.swift */, + 0AF736202D00D0900026FE0A /* Help.swift */, ); path = Views; sourceTree = ""; @@ -506,6 +509,7 @@ files = ( 0A573E1F2CADC5CF00899F84 /* Torrc.swift in Sources */, 0AD7BE0F2CB980D500428D02 /* JoinMarketTaggedReleases.swift in Sources */, + 0AF736212D00D0900026FE0A /* Help.swift in Sources */, 0AD7BE192CBD919600428D02 /* JMRPC.swift in Sources */, 0AA6924B2C7F89E800366192 /* Script.swift in Sources */, 0AD7BE0D2CB97F4100428D02 /* LatestJoinMarketRelease.swift in Sources */, @@ -676,7 +680,7 @@ ENABLE_USER_SCRIPT_SANDBOXING = NO; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = "FullyNoded-Server/Info.plist"; - INFOPLIST_KEY_CFBundleDisplayName = "Fully Noded - Server"; + INFOPLIST_KEY_CFBundleDisplayName = "FN Server - v0.0.1 Beta"; "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES; "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphonesimulator*]" = YES; "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphoneos*]" = YES; @@ -691,7 +695,7 @@ LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 14.0; - MARKETING_VERSION = 1.0; + MARKETING_VERSION = 0.0.1; PRODUCT_BUNDLE_IDENTIFIER = "com.dentonllc.FullyNoded-Server"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = auto; @@ -719,7 +723,7 @@ ENABLE_USER_SCRIPT_SANDBOXING = NO; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = "FullyNoded-Server/Info.plist"; - INFOPLIST_KEY_CFBundleDisplayName = "Fully Noded - Server"; + INFOPLIST_KEY_CFBundleDisplayName = "FN Server - v0.0.1 Beta"; "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES; "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphonesimulator*]" = YES; "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphoneos*]" = YES; @@ -734,7 +738,7 @@ LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 14.0; - MARKETING_VERSION = 1.0; + MARKETING_VERSION = 0.0.1; PRODUCT_BUNDLE_IDENTIFIER = "com.dentonllc.FullyNoded-Server"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = auto; diff --git a/FullyNoded-Server/Views/BitcoinCore.swift b/FullyNoded-Server/Views/BitcoinCore.swift index dda43296..0403f48e 100644 --- a/FullyNoded-Server/Views/BitcoinCore.swift +++ b/FullyNoded-Server/Views/BitcoinCore.swift @@ -514,7 +514,7 @@ struct BitcoinCore: View { } private func initialLoad() { - selectedChain = UserDefaults.standard.string(forKey: "chain") ?? "signet" + selectedChain = UserDefaults.standard.string(forKey: "chain") ?? "main" DataManager.retrieve(entityName: .bitcoinEnv) { env in guard let env = env else { return } let envValues = BitcoinEnvValues(dictionary: env) @@ -535,7 +535,7 @@ struct BitcoinCore: View { return } var onionHost = "" - let chain = UserDefaults.standard.string(forKey: "chain") ?? "signet" + let chain = UserDefaults.standard.string(forKey: "chain") ?? "main" switch chain { case "main": @@ -569,7 +569,7 @@ struct BitcoinCore: View { let url = "http://xxx:xxx@\(onionHost)" qrImage = url.qrQode - let port = UserDefaults.standard.object(forKey: "port") as? String ?? "38332" + let port = UserDefaults.standard.object(forKey: "port") as? String ?? "8332" self.fullyNodedUrl = "btcrpc://xxx:xxx@localhost:\(port)" self.unifyUrl = "unify://xxx:xxx@localhost:\(port)" } diff --git a/FullyNoded-Server/Views/ContentView.swift b/FullyNoded-Server/Views/ContentView.swift index c75d1b96..f1ca705b 100644 --- a/FullyNoded-Server/Views/ContentView.swift +++ b/FullyNoded-Server/Views/ContentView.swift @@ -57,6 +57,7 @@ struct ContentView: View { private let coreLightning = Service(name: "Core Lightning", id: UUID()) private let joinMarket = Service(name: "Join Market", id: UUID()) private let tor = Service(name: "Tor", id: UUID()) + private let help = Service(name: "Help", id: UUID()) var body: some View { @@ -144,6 +145,8 @@ struct ContentView: View { } .frame(maxWidth: .infinity, alignment: .leading) Spacer() + } else if service.name == "Help" { + Help() } } label: { HStack() { @@ -230,7 +233,18 @@ struct ContentView: View { self.torRunning = TorClient.sharedInstance.state == .connected } } - Text(service.name) + + if service.name == "Help" { + Image(systemName: "questionmark.circle") + .foregroundStyle(.secondary) + Text(service.name) + .foregroundStyle(.secondary) + } else { + Text(service.name) + } + + + } } @@ -389,7 +403,7 @@ struct ContentView: View { "CHAIN": self.bitcoinEnvValues.chain ] - services = [bitcoinCore, coreLightning, joinMarket, tor] + services = [bitcoinCore, coreLightning, joinMarket, tor, help] checkForBitcoin() } @@ -407,7 +421,7 @@ struct ContentView: View { "CHAIN": self.bitcoinEnvValues.chain ] - services = [bitcoinCore, coreLightning, joinMarket, tor] + services = [bitcoinCore, coreLightning, joinMarket, tor, help] checkForBitcoin() } } diff --git a/FullyNoded-Server/Views/Help.swift b/FullyNoded-Server/Views/Help.swift new file mode 100644 index 00000000..44cceaaa --- /dev/null +++ b/FullyNoded-Server/Views/Help.swift @@ -0,0 +1,41 @@ +// +// Help.swift +// FullyNoded-Server +// +// Created by Peter Denton on 12/4/24. +// + +import SwiftUI + +struct Help: View { + var body: some View { + VStack() { + Text("Need support?") + .frame(maxWidth: .infinity, alignment: .topLeading) + .padding([.leading, .top]) + Link("Let us know about an issue, bug, feature request or general comments here.", destination: URL(string: "https://github.com/Fonta1n3/FullyNoded-Server/issues/new")!) + .padding([.leading, .bottom]) + .frame(maxWidth: .infinity, alignment: .topLeading) + Text("Visit our website") + .frame(maxWidth: .infinity, alignment: .topLeading) + .padding([.leading]) + Link("www.FullyNoded.app", destination: URL(string: "https://www.FullyNoded.app")!) + .padding([.leading, .bottom]) + .frame(maxWidth: .infinity, alignment: .topLeading) + Text("Come chat") + .padding([.leading]) + .frame(maxWidth: .infinity, alignment: .topLeading) + Link("Join the Telegram", destination: URL(string: "https://t.me/FullyNoded")!) + .padding([.leading]) + .frame(maxWidth: .infinity, alignment: .topLeading) + Link("Join the Discord", destination: URL(string: "https://discord.gg/TVf2zb9x")!) + .frame(maxWidth: .infinity, alignment: .topLeading) + .padding([.leading]) + Spacer() + } + } +} + +#Preview { + Help() +} diff --git a/FullyNoded-Server/Views/JoinMarket.swift b/FullyNoded-Server/Views/JoinMarket.swift index 982ffaf2..69fe9f7f 100644 --- a/FullyNoded-Server/Views/JoinMarket.swift +++ b/FullyNoded-Server/Views/JoinMarket.swift @@ -312,8 +312,8 @@ struct JoinMarket: View { } private func configureJm() { - var chain = UserDefaults.standard.object(forKey: "chain") as? String ?? "signet" - let port = UserDefaults.standard.object(forKey: "port") as? String ?? "38332" + var chain = UserDefaults.standard.object(forKey: "chain") as? String ?? "main" + let port = UserDefaults.standard.object(forKey: "port") as? String ?? "8332" switch chain { case "main": chain = "mainnet" case "regtest": chain = "testnet" diff --git a/FullyNoded-Server/Views/JoinMarketTaggedReleases.swift b/FullyNoded-Server/Views/JoinMarketTaggedReleases.swift index 1578c671..746d25a0 100644 --- a/FullyNoded-Server/Views/JoinMarketTaggedReleases.swift +++ b/FullyNoded-Server/Views/JoinMarketTaggedReleases.swift @@ -115,9 +115,8 @@ struct JoinMarketTaggedReleasesView: View { private func configureJm() { - print("configureJm") - var chain = UserDefaults.standard.object(forKey: "chain") as? String ?? "signet" - let port = UserDefaults.standard.object(forKey: "port") as? String ?? "38332" + var chain = UserDefaults.standard.object(forKey: "chain") as? String ?? "main" + let port = UserDefaults.standard.object(forKey: "port") as? String ?? "8332" switch chain { case "main": chain = "mainnet" case "regtest": chain = "testnet"