Skip to content

Commit da27d6d

Browse files
authored
Merge pull request #58 from GalaxyPay/dev
chore: release version 3.2.4
2 parents 5bfa16f + 266d6f2 commit da27d6d

File tree

16 files changed

+89
-130
lines changed

16 files changed

+89
-130
lines changed

Diff for: .github/workflows/go.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -266,5 +266,5 @@ jobs:
266266
uses: ncipollo/release-action@v1
267267
with:
268268
allowUpdates: true
269-
tag: v3.2.3
269+
tag: v3.2.4
270270
artifacts: "Output/*"

Diff for: FUNC.iss

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
33

44
#define MyAppName "FUNC"
5-
#define MyAppVersion "3.2.3"
5+
#define MyAppVersion "3.2.4"
66
#define MyAppPublisher "Galaxy Pay, LLC"
77
#define MyAppPublisherURL "https://galaxy-pay.com"
88
#define MyPublishPath "publish"

Diff for: FUNC/Models/NodeStatus.cs

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ public class NodeStatus
55
public required string ServiceStatus { get; set; }
66
public required int Port { get; set; }
77
public required string Token { get; set; }
8-
public required bool P2p { get; set; }
98
public string? TelemetryStatus { get; set; }
109
public RetiStatus? RetiStatus { get; set; }
1110
}

Diff for: FUNC/Node.cs

-7
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ public static async Task<NodeStatus> Get(string name)
1818
int port = 0;
1919
string token = string.Empty;
2020
try { token = File.ReadAllText(Path.Combine(Utils.NodeDataParent(name), name, "algod.admin.token")); } catch { }
21-
bool p2p = false;
2221
string? configText = null;
2322
try { configText = File.ReadAllText(Path.Combine(Utils.NodeDataParent(name), name, "config.json")); } catch { }
2423
if (configText != null)
@@ -27,11 +26,6 @@ public static async Task<NodeStatus> Get(string name)
2726
var endpointAddressToken = config.GetValue("EndpointAddress");
2827
string endpointAddress = endpointAddressToken?.Value<string>() ?? ":0";
2928
port = int.Parse(endpointAddress[(endpointAddress.IndexOf(":") + 1)..]);
30-
var enableP2PToken = config.GetValue("EnableP2P");
31-
var enableP2PHybridModeToken = config.GetValue("EnableP2PHybridMode");
32-
bool enableP2P = enableP2PToken != null && enableP2PToken.Value<bool>();
33-
bool enableP2PHybridMode = enableP2PHybridModeToken != null && enableP2PHybridModeToken.Value<bool>();
34-
if (enableP2P || enableP2PHybridMode) p2p = true;
3529
}
3630

3731
string sc = string.Empty;
@@ -56,7 +50,6 @@ public static async Task<NodeStatus> Get(string name)
5650
ServiceStatus = serviceStatus,
5751
Port = port,
5852
Token = token,
59-
P2p = p2p,
6053
};
6154

6255
if (name == "algorand")

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ sudo rm -rf /usr/share/func
9595

9696
### Configure
9797

98-
- Change your node's Port, DNS Bootstrap, and P2P settings
98+
- Change your node's Port, DNS Bootstrap, and BaseLoggerDebugLevel
9999

100100
### Enable/Disable Telemetry
101101

Diff for: create-package-deb.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
rm -r Output
22

3-
PKG=Output/func_3.2.3_linux-$1
3+
PKG=Output/func_3.2.4_linux-$1
44

55
mkdir -p $PKG/lib/systemd/system
66
mkdir -p $PKG/opt/func

Diff for: create-package-pkg.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ pkgbuild --root publish \
55
--install-location /opt/func \
66
--scripts pkg/scripts \
77
--identifier func.app \
8-
Output/func_3.2.3_darwin-$1.pkg
8+
Output/func_3.2.4_darwin-$1.pkg

Diff for: deb/amd64/control

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Package: func
2-
Version: 3.2.3
2+
Version: 3.2.4
33
Section: base
44
Priority: optional
55
Architecture: amd64

Diff for: deb/arm64/control

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Package: func
2-
Version: 3.2.3
2+
Version: 3.2.4
33
Section: base
44
Priority: optional
55
Architecture: arm64

Diff for: webui/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "func-webui",
3-
"version": "3.2.3",
3+
"version": "3.2.4",
44
"scripts": {
55
"dev": "vite",
66
"build": "vite build",

Diff for: webui/src/components/Config.vue

+6-1
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,15 @@
2828
v-model="config.DNSBootstrapID"
2929
rows="2"
3030
/>
31-
<v-checkbox-btn v-model="enableP2P" label="Enable P2P" />
31+
<v-checkbox-btn
32+
v-model="enableP2P"
33+
label="Enable P2P"
34+
:disabled="!enableP2P"
35+
/>
3236
<v-checkbox-btn
3337
v-model="enableP2PHybridMode"
3438
label="Enable P2P Hybrid Mode"
39+
:disabled="!enableP2PHybridMode"
3540
/>
3641
</v-container>
3742
<v-card-actions>

Diff for: webui/src/components/Manage.vue

-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
/>
4949
<template
5050
v-if="
51-
store.isIncentiveReady &&
5251
nodeStatus.retiStatus &&
5352
(status === 'Running' ||
5453
['Running', 'Stopped'].includes(

Diff for: webui/src/components/Node.vue

+50-88
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
class="mt-4"
6868
:name="name"
6969
:node-status="nodeStatus"
70-
@get-status="getNodeStatus()"
70+
@get-status="getAllStatus()"
7171
/>
7272
</v-col>
7373
<template v-if="nodeStatus.serviceStatus === 'Running'">
@@ -194,35 +194,6 @@
194194
@part-details="(val) => (partDetails = val)"
195195
@generating-key="(val) => (generatingKey = val)"
196196
/>
197-
<v-container fluid v-if="peers">
198-
<v-divider />
199-
<v-card-title>Peers ({{ peers.length }})</v-card-title>
200-
<v-card-text>
201-
<div v-for="item in peers">
202-
{{ item.address }}
203-
<span>
204-
<v-icon
205-
v-if="item.network === 'p2p'"
206-
class="ml-1"
207-
size="small"
208-
color="primary"
209-
:icon="mdiLanConnect"
210-
/>
211-
<v-tooltip activator="parent" location="right" text="P2P" />
212-
</span>
213-
<span>
214-
<v-icon
215-
v-if="!item.outgoing"
216-
class="ml-1"
217-
size="small"
218-
color="success"
219-
:icon="mdiArrowLeft"
220-
/>
221-
<v-tooltip activator="parent" location="right" text="Inbound" />
222-
</span>
223-
</div>
224-
</v-card-text>
225-
</v-container>
226197
<v-container
227198
class="text-caption text-grey text-center"
228199
v-show="nodeStatus?.serviceStatus === 'Running'"
@@ -235,17 +206,12 @@
235206

236207
<script setup lang="ts">
237208
import FUNC from "@/services/api";
238-
import { NodeStatus, Peer } from "@/types";
209+
import { NodeStatus } from "@/types";
239210
import { checkCatchup, delay } from "@/utils";
240-
import {
241-
mdiArrowLeft,
242-
mdiInformation,
243-
mdiLanConnect,
244-
mdiOpenInNew,
245-
mdiRefresh,
246-
} from "@mdi/js";
211+
import { mdiInformation, mdiOpenInNew, mdiRefresh } from "@mdi/js";
247212
import { Algodv2 } from "algosdk";
248213
214+
const FuncApi = FUNC.api;
249215
const store = useAppStore();
250216
const props = defineProps({ name: { type: String, required: true } });
251217
const nodeStatus = ref<NodeStatus>();
@@ -324,76 +290,68 @@ const status = computed(() =>
324290
: "Unknown"
325291
);
326292
327-
const algodClient = computed(() => {
328-
if (!nodeStatus.value?.token) return undefined;
329-
return new Algodv2(
330-
nodeStatus.value.token,
331-
`http://${location.hostname}`,
332-
nodeStatus.value.port
333-
);
334-
});
335-
336-
watch(
337-
() => algodStatus.value,
338-
(val) => {
339-
if (props.name === "Algorand" && val?.["last-round"] >= 46512890)
340-
store.isIncentiveReady = true;
341-
}
342-
);
293+
const algodClient = ref<Algodv2>();
343294
344295
onBeforeMount(async () => {
345-
await getNodeStatus();
296+
await getAllStatus();
346297
});
347298
348-
const isMounted = ref(true);
349299
onBeforeUnmount(() => {
350-
isMounted.value = false;
300+
refreshing = false;
351301
});
352302
353303
let refreshing = false;
354304
355305
async function autoRefresh() {
356306
if (refreshing) return;
357307
refreshing = true;
358-
while (nodeStatus.value?.serviceStatus === "Running") {
308+
while (refreshing) {
309+
await getAlgodStatus();
359310
await delay(1200);
360-
if (!isMounted.value) return;
361-
await getNodeStatus();
362311
}
363-
refreshing = false;
364312
}
365313
366-
let restartAttempted = false;
367-
368-
const peers = ref<Peer[]>();
314+
async function getAllStatus() {
315+
await getNodeStatus();
316+
await getAlgodStatus();
317+
}
369318
370319
async function getNodeStatus() {
371320
try {
372-
const resp = await FUNC.api.get(props.name);
321+
const oldStatus: NodeStatus | undefined = nodeStatus.value
322+
? JSON.parse(JSON.stringify(nodeStatus.value))
323+
: undefined;
324+
const resp = await FuncApi.get(props.name);
373325
nodeStatus.value = resp.data;
326+
if (nodeStatus.value?.serviceStatus !== "Running") {
327+
refreshing = false;
328+
}
329+
if (
330+
nodeStatus.value &&
331+
(oldStatus?.port !== nodeStatus.value.port ||
332+
oldStatus?.token !== nodeStatus.value.token)
333+
) {
334+
algodClient.value = new Algodv2(
335+
nodeStatus.value.token,
336+
`http://${location.hostname}`,
337+
nodeStatus.value.port
338+
);
339+
await delay(500);
340+
}
341+
} catch (err: any) {
342+
console.error(err);
343+
store.setSnackbar(err?.response?.data || err.message, "error");
344+
}
345+
}
346+
347+
let restartAttempted = false;
348+
349+
async function getAlgodStatus() {
350+
try {
374351
if (nodeStatus.value?.serviceStatus === "Running") {
375-
if (algodClient.value) {
376-
algodStatus.value = await algodClient.value?.status().do();
377-
if (nodeStatus.value.p2p) {
378-
try {
379-
const response = (
380-
await axios({
381-
url: `http://${location.hostname}:${nodeStatus.value.port}/v2/status/peers`,
382-
headers: { "X-Algo-Api-Token": nodeStatus.value.token },
383-
})
384-
).data as Peer[];
385-
peers.value = response.sort((a, b) =>
386-
a.address.localeCompare(b.address)
387-
);
388-
} catch {}
389-
} else {
390-
peers.value = undefined;
391-
}
392-
}
393-
if (!refreshing) autoRefresh();
352+
algodStatus.value = await algodClient.value?.status().do();
394353
} else {
395354
algodStatus.value = undefined;
396-
peers.value = undefined;
397355
}
398356
if (nodeStatus.value?.retiStatus?.version && !retiLatest.value) {
399357
const releases = await axios({
@@ -409,8 +367,12 @@ async function getNodeStatus() {
409367
) {
410368
restartAttempted = true;
411369
console.error("reti not running - attempting restart");
412-
await FUNC.api.put("reti/stop");
413-
await FUNC.api.put("reti/start");
370+
await FuncApi.put("reti/stop");
371+
await FuncApi.put("reti/start");
372+
}
373+
if (nodeStatus.value?.serviceStatus === "Running" && !refreshing) {
374+
await delay(1200);
375+
autoRefresh();
414376
}
415377
} catch (err: any) {
416378
console.error(err);
@@ -458,7 +420,7 @@ async function updateReti() {
458420
try {
459421
if (!retiUpdate.value) return;
460422
loading.value = true;
461-
await FUNC.api.post("reti/update");
423+
await FuncApi.post("reti/update");
462424
await getNodeStatus();
463425
store.setSnackbar("Reti Updated", "success");
464426
} catch (err: any) {

0 commit comments

Comments
 (0)