From f010aa960cc36c6d63a7380e5bd7eea151ecb00c Mon Sep 17 00:00:00 2001 From: Shadowy Super Coder Date: Wed, 5 Jul 2023 18:22:04 -0600 Subject: [PATCH 1/3] add back delete-peers action --- manifest.yaml | 17 +++++++++-------- scripts/services/action.ts | 30 +++++++++++++++++++++++++++++- scripts/services/migrations.ts | 2 +- 3 files changed, 39 insertions(+), 10 deletions(-) diff --git a/manifest.yaml b/manifest.yaml index d024970..d0e89c0 100644 --- a/manifest.yaml +++ b/manifest.yaml @@ -1,14 +1,8 @@ id: bitcoind title: "Bitcoin Core" -version: 25.0.0.2 +version: 25.0.0.3 eos-version: 0.3.4.3 -release-notes: | - * Update to latest upstream (v25.0) - * Reorganize config - * Force pruning for servers with not enough disk space - * Update services base image to alpine 3.16 - * Use ssl for base image packages download - * Optimized higher resolution Bitcoin icon +release-notes: Add back delete-peers action license: MIT wrapper-repo: https://github.com/Start9Labs/bitcoind-wrapper upstream-repo: https://github.com/bitcoin/bitcoin @@ -159,6 +153,13 @@ actions: - stopped implementation: type: script + delete-peers: + name: "Delete Peer List" + description: "Deletes the Peer List (peers.dat) in case it gets corrupted." + allowed-statuses: + - stopped + implementation: + type: script migrations: from: "*": diff --git a/scripts/services/action.ts b/scripts/services/action.ts index 8087164..85ceed8 100644 --- a/scripts/services/action.ts +++ b/scripts/services/action.ts @@ -1,4 +1,4 @@ -import { util, types as T } from "../dependencies.ts"; +import { util, exists, types as T } from "../dependencies.ts"; export const action = { async "delete-txindex"( @@ -29,4 +29,32 @@ export const action = { }, }; }, + async "delete-peers"( + effect: T.Effects, + _input?: T.Config, + ): Promise> { + const peersLocation = { + path: "peers.dat", + volumeId: "main", + }; + if (await exists(effect, peersLocation) === false) { + return { + result: { + copyable: false, + message: "peers.dat doesn't exist", + version: "0", + qr: false, + }, + }; + } + await effect.removeFile(peersLocation); + return { + result: { + copyable: false, + message: "Deleted peers.dat", + version: "0", + qr: false, + }, + }; + }, }; diff --git a/scripts/services/migrations.ts b/scripts/services/migrations.ts index a44b256..81705d2 100644 --- a/scripts/services/migrations.ts +++ b/scripts/services/migrations.ts @@ -230,5 +230,5 @@ export const migration: T.ExpectedExports.migration = ), }, }, - "25.0.0.2" + "25.0.0.3" ); From e64cf3ebfbf8750d054d87ca08f7741ddf753b5d Mon Sep 17 00:00:00 2001 From: Shadowy Super Coder Date: Wed, 5 Jul 2023 19:54:00 -0600 Subject: [PATCH 2/3] add exists --- scripts/dependencies.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/dependencies.ts b/scripts/dependencies.ts index 5c469fa..e545ba4 100644 --- a/scripts/dependencies.ts +++ b/scripts/dependencies.ts @@ -1 +1,2 @@ export * from "https://deno.land/x/embassyd_sdk@v0.3.4.3.0-alpha1/mod.ts"; +export { exists } from "https://deno.land/x/embassyd_sdk@v0.3.1.0.3/mod.ts"; \ No newline at end of file From 250afdc9245a443f50a961c85dc5d89c50d7c7e6 Mon Sep 17 00:00:00 2001 From: Aiden McClelland Date: Mon, 10 Jul 2023 10:32:09 -0600 Subject: [PATCH 3/3] remove old sdk --- scripts/dependencies.ts | 1 - scripts/services/action.ts | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/scripts/dependencies.ts b/scripts/dependencies.ts index e545ba4..5c469fa 100644 --- a/scripts/dependencies.ts +++ b/scripts/dependencies.ts @@ -1,2 +1 @@ export * from "https://deno.land/x/embassyd_sdk@v0.3.4.3.0-alpha1/mod.ts"; -export { exists } from "https://deno.land/x/embassyd_sdk@v0.3.1.0.3/mod.ts"; \ No newline at end of file diff --git a/scripts/services/action.ts b/scripts/services/action.ts index 85ceed8..2459b12 100644 --- a/scripts/services/action.ts +++ b/scripts/services/action.ts @@ -1,4 +1,4 @@ -import { util, exists, types as T } from "../dependencies.ts"; +import { util, types as T } from "../dependencies.ts"; export const action = { async "delete-txindex"( @@ -31,13 +31,13 @@ export const action = { }, async "delete-peers"( effect: T.Effects, - _input?: T.Config, + _input?: T.Config ): Promise> { const peersLocation = { path: "peers.dat", volumeId: "main", }; - if (await exists(effect, peersLocation) === false) { + if ((await util.exists(effect, peersLocation)) === false) { return { result: { copyable: false,