Skip to content

Commit

Permalink
Merge pull request #122 from Start9Labs/re-add_peers.dat_action
Browse files Browse the repository at this point in the history
Re add peers.dat action
  • Loading branch information
Dominion5254 authored Jul 11, 2023
2 parents b788066 + 250afdc commit 3c152a1
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 9 deletions.
17 changes: 9 additions & 8 deletions manifest.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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:
"*":
Expand Down
28 changes: 28 additions & 0 deletions scripts/services/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,32 @@ export const action = {
},
};
},
async "delete-peers"(
effect: T.Effects,
_input?: T.Config
): Promise<T.ResultType<T.ActionResult>> {
const peersLocation = {
path: "peers.dat",
volumeId: "main",
};
if ((await util.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,
},
};
},
};
2 changes: 1 addition & 1 deletion scripts/services/migrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,5 +230,5 @@ export const migration: T.ExpectedExports.migration =
),
},
},
"25.0.0.2"
"25.0.0.3"
);

0 comments on commit 3c152a1

Please sign in to comment.