App::bwk::mn - Some commands to manage Bulwark masternode
This document describes version 0.001 of App::bwk::mn (from Perl distribution App-bwk-mn), released on 2019-07-22.
Please see included script bwk-mn.
Usage:
new_zfs_snapshot() -> [status, msg, payload, meta]
Create a new ZFS snapshot.
This subcommand will:
See restore_from_zfs_snapshot for more details.
restore_from_zfs_snapshot
This function is not exported.
No arguments.
Returns an enveloped result (an array).
First element (status) is an integer containing HTTP status code (200 means OK, 4xx caller error, 5xx function error). Second element (msg) is a string containing error message, or 'OK' if status is 200. Third element (payload) is optional, the actual result. Fourth element (meta) is called result metadata and is optional, a hash that contains extra information.
Return value: (any)
restore_from_zfs_snapshot() -> [status, msg, payload, meta]
Restore broken installation from ZFS snapshot.
For this to work, a specific setup is required. First, at least the blocks/ and chainstate directory are put in a ZFS filesystem (this part is assumed and not checked) and a snapshot of that filesytem has been made. The ZFS filesystem needs to have "bulwark" or "bwk" as part of its name, and the snapshot must be named using YYYY-MM-DD. The most recent snapshot will be selected.
blocks/
chainstate
Rationale: as of this writing (2019-07-22, Bulwark version 2.2.0.0) a Bulwark masternode still from time to time gets corrupted with this message in the debug.log:
debug.log
2019-07-22 02:30:17 ERROR: VerifyDB() : *** irrecoverable inconsistency in block data at xxxxxx, hash=xxxxxxxx
(It used to happen more often prior to 2.1.0 release, and less but still happens from time to time since 2.1.0.)
Resync-ing from scratch will take at least 1-2 hours, and if this happens on each masternode every few days then resync-ing will waste a lot of time. Thus the ZFS snapshot. Snapshots will of course need to be created regularly for this setup to benefit.
status() -> [status, msg, payload, meta]
bulwark-cli getblockcount + masternode status.
This is mostly just a shortcut for running bulwark-cli getblockcount and bulwark-cli masternode status.
bulwark-cli getblockcount
bulwark-cli masternode status
Please visit the project's homepage at https://metacpan.org/release/App-bwk-mn.
Source repository is at https://github.com/perlancar/perl-App-bwk-mn.
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=App-bwk-mn
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
cryp-mn from App::cryp::mn
Other App::cryp::* modules.
App::cryp::*
perlancar <perlancar@cpan.org>
This software is copyright (c) 2019 by perlancar@cpan.org.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install App::bwk::mn, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::bwk::mn
CPAN shell
perl -MCPAN -e shell install App::bwk::mn
For more information on module installation, please visit the detailed CPAN module installation guide.