mirror of
https://github.com/Retropex/umbrel-bitcoin.git
synced 2025-05-12 19:20:49 +02:00
add full policy settings
This commit is contained in:
parent
9237fa22d1
commit
3a857b5f74
@ -40,6 +40,18 @@ const DEFAULT_ADVANCED_SETTINGS = {
|
||||
permitbaremultisig: false,
|
||||
rejectparasites: true,
|
||||
rejecttokens: false,
|
||||
minrelaytxfee: 0.00001,
|
||||
bytespersigop: 20,
|
||||
bytespersigopstrict: 20,
|
||||
limitancestorcount: 25,
|
||||
limitancestorsize: 101,
|
||||
limitdescendantcount: 25,
|
||||
limitdescendantsize: 101,
|
||||
permitbarepubkey: false,
|
||||
maxscriptsize: 1650,
|
||||
datacarriercost: 1,
|
||||
acceptnonstddatacarrier: false,
|
||||
dustrelayfee: 0.00003,
|
||||
maxorphantx: 100,
|
||||
reindex: false,
|
||||
// RPC/REST
|
||||
@ -189,6 +201,58 @@ function settingsToMultilineConfString(settings) {
|
||||
umbrelBitcoinConfig.push(`rejecttokens=1`);
|
||||
}
|
||||
|
||||
// minrelaytxfee
|
||||
umbrelBitcoinConfig.push("# Min Transaction Relay Fee");
|
||||
umbrelBitcoinConfig.push(`minrelaytxfee=${settings.minrelaytxfee}`);
|
||||
|
||||
// bytespersigop
|
||||
umbrelBitcoinConfig.push("# Equivalent bytes per sigop in transactions for relay and mining");
|
||||
umbrelBitcoinConfig.push(`bytespersigop=${settings.bytespersigop}`);
|
||||
|
||||
// bytespersigopstrict
|
||||
umbrelBitcoinConfig.push("# Minimum bytes per sigop in transactions we relay and mine");
|
||||
umbrelBitcoinConfig.push(`bytespersigopstrict=${settings.bytespersigopstrict}`);
|
||||
|
||||
// limitancestorcount
|
||||
umbrelBitcoinConfig.push("# Do not accept transactions if number of in-mempool ancestors is <n> or more");
|
||||
umbrelBitcoinConfig.push(`limitancestorcount=${settings.limitancestorcount}`);
|
||||
|
||||
// limitancestorsize
|
||||
umbrelBitcoinConfig.push("# Do not accept transactions whose size with all in-mempool ancestors exceeds <n> kilobytes");
|
||||
umbrelBitcoinConfig.push(`limitancestorsize=${settings.limitancestorsize}`);
|
||||
|
||||
// limitdescendantcount
|
||||
umbrelBitcoinConfig.push("# Do not accept transactions if any ancestor would have <n> or more in-mempool descendants");
|
||||
umbrelBitcoinConfig.push(`limitdescendantcount=${settings.limitdescendantcount}`);
|
||||
|
||||
// limitdescendantsize
|
||||
umbrelBitcoinConfig.push("# Do not accept transactions if any ancestor would have more than <n> kilobytes of in-mempool descendants");
|
||||
umbrelBitcoinConfig.push(`limitdescendantsize=${settings.limitdescendantsize}`);
|
||||
|
||||
// permitbarepubkey
|
||||
if (settings.permitbarepubkey) {
|
||||
umbrelBitcoinConfig.push("# Relay legacy pubkey outputs");
|
||||
umbrelBitcoinConfig.push('permitbarepubkey=1');
|
||||
}
|
||||
|
||||
// maxscriptsize
|
||||
umbrelBitcoinConfig.push("# Maximum size of scripts we relay and mine, in bytes");
|
||||
umbrelBitcoinConfig.push(`maxscriptsize=${settings.maxscriptsize}`);
|
||||
|
||||
// datacarriercost
|
||||
umbrelBitcoinConfig.push("# Treat extra data in transactions as at least N vbytes per actual byte");
|
||||
umbrelBitcoinConfig.push(`datacarriercost=${settings.datacarriercost}`);
|
||||
|
||||
// acceptnonstddatacarrier
|
||||
if (settings.acceptnonstddatacarrier) {
|
||||
umbrelBitcoinConfig.push("# Relay and mine non-OP_RETURN datacarrier injection");
|
||||
umbrelBitcoinConfig.push('acceptnonstddatacarrier=1');
|
||||
}
|
||||
|
||||
// dustrelayfee
|
||||
umbrelBitcoinConfig.push("# Fee rate (in BTC/kvB) used to define dust, the value of an output such that it will cost more than its value in fees at this fee rate to spend it.");
|
||||
umbrelBitcoinConfig.push(`dustrelayfee=${settings.dustrelayfee}`);
|
||||
|
||||
// maxorphantx
|
||||
umbrelBitcoinConfig.push("# Maximum number of orphan transactions to be kept in memory.");
|
||||
umbrelBitcoinConfig.push(`maxorphantx=${settings.maxorphantx}`);
|
||||
|
@ -804,6 +804,384 @@
|
||||
</div>
|
||||
</b-card-body>
|
||||
|
||||
<!-- minrelaytxfee -->
|
||||
<b-card-body class="subsetting-body px-2 px-sm-3">
|
||||
<div>
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<div class="flex-sm-grow-1">
|
||||
<label class="mb-0" for="mempool">
|
||||
<p class="subsetting-title font-weight-bold mb-0 mr-1">
|
||||
Min Transaction Relay Fee
|
||||
<span class="subsetting-config-name text-monospace font-weight-normal d-block">
|
||||
minrelaytxfee
|
||||
</span>
|
||||
</p>
|
||||
</label>
|
||||
</div>
|
||||
<div class="input-container ml-1">
|
||||
<b-input-group append="bytes">
|
||||
<b-form-input
|
||||
class="advanced-settings-input"
|
||||
id="minrelaytxfee"
|
||||
type="number"
|
||||
v-model="settings.minrelaytxfee"
|
||||
number
|
||||
></b-form-input>
|
||||
</b-input-group>
|
||||
</div>
|
||||
</div>
|
||||
<small class="w-lg-75 d-block text-muted mt-1">
|
||||
Fee rates (in BTC/kB) smaller than this are considered zero fee for relaying, mining and transaction creation
|
||||
</small>
|
||||
</div>
|
||||
</b-card-body>
|
||||
|
||||
<!-- bytespersigop -->
|
||||
<b-card-body class="subsetting-body px-2 px-sm-3">
|
||||
<div>
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<div class="flex-sm-grow-1">
|
||||
<label class="mb-0" for="mempool">
|
||||
<p class="subsetting-title font-weight-bold mb-0 mr-1">
|
||||
Bytes Per Sigop
|
||||
<span class="subsetting-config-name text-monospace font-weight-normal d-block">
|
||||
bytespersigop
|
||||
</span>
|
||||
</p>
|
||||
</label>
|
||||
</div>
|
||||
<div class="input-container ml-1">
|
||||
<b-input-group append="bytes">
|
||||
<b-form-input
|
||||
class="advanced-settings-input"
|
||||
id="bytespersigop"
|
||||
type="number"
|
||||
v-model="settings.bytespersigop"
|
||||
number
|
||||
></b-form-input>
|
||||
</b-input-group>
|
||||
</div>
|
||||
</div>
|
||||
<small class="w-lg-75 d-block text-muted mt-1">
|
||||
Equivalent bytes per sigop in transactions for relay and mining
|
||||
</small>
|
||||
</div>
|
||||
</b-card-body>
|
||||
|
||||
<!-- bytespersigopstrict -->
|
||||
<b-card-body class="subsetting-body px-2 px-sm-3">
|
||||
<div>
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<div class="flex-sm-grow-1">
|
||||
<label class="mb-0" for="mempool">
|
||||
<p class="subsetting-title font-weight-bold mb-0 mr-1">
|
||||
Bytes Per Sigop Strict
|
||||
<span class="subsetting-config-name text-monospace font-weight-normal d-block">
|
||||
bytespersigopstrict
|
||||
</span>
|
||||
</p>
|
||||
</label>
|
||||
</div>
|
||||
<div class="input-container ml-1">
|
||||
<b-input-group append="bytes">
|
||||
<b-form-input
|
||||
class="advanced-settings-input"
|
||||
id="bytespersigopstrict"
|
||||
type="number"
|
||||
v-model="settings.bytespersigopstrict"
|
||||
number
|
||||
></b-form-input>
|
||||
</b-input-group>
|
||||
</div>
|
||||
</div>
|
||||
<small class="w-lg-75 d-block text-muted mt-1">
|
||||
Minimum bytes per sigop in transactions we relay and mine
|
||||
</small>
|
||||
</div>
|
||||
</b-card-body>
|
||||
|
||||
<!-- limitancestorcount -->
|
||||
<b-card-body class="subsetting-body px-2 px-sm-3">
|
||||
<div>
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<div class="flex-sm-grow-1">
|
||||
<label class="mb-0" for="mempool">
|
||||
<p class="subsetting-title font-weight-bold mb-0 mr-1">
|
||||
Max Ancestor Count
|
||||
<span class="subsetting-config-name text-monospace font-weight-normal d-block">
|
||||
limitancestorcount
|
||||
</span>
|
||||
</p>
|
||||
</label>
|
||||
</div>
|
||||
<div class="input-container ml-1">
|
||||
<b-input-group append="bytes">
|
||||
<b-form-input
|
||||
class="advanced-settings-input"
|
||||
id="limitancestorcount"
|
||||
type="number"
|
||||
v-model="settings.limitancestorcount"
|
||||
number
|
||||
></b-form-input>
|
||||
</b-input-group>
|
||||
</div>
|
||||
</div>
|
||||
<small class="w-lg-75 d-block text-muted mt-1">
|
||||
Do not accept transactions if number of in-mempool ancestors is <n> or more
|
||||
</small>
|
||||
</div>
|
||||
</b-card-body>
|
||||
|
||||
<!-- limitancestorsize -->
|
||||
<b-card-body class="subsetting-body px-2 px-sm-3">
|
||||
<div>
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<div class="flex-sm-grow-1">
|
||||
<label class="mb-0" for="mempool">
|
||||
<p class="subsetting-title font-weight-bold mb-0 mr-1">
|
||||
Max Ancestor Size
|
||||
<span class="subsetting-config-name text-monospace font-weight-normal d-block">
|
||||
limitancestorsize
|
||||
</span>
|
||||
</p>
|
||||
</label>
|
||||
</div>
|
||||
<div class="input-container ml-1">
|
||||
<b-input-group append="bytes">
|
||||
<b-form-input
|
||||
class="advanced-settings-input"
|
||||
id="limitancestorsize"
|
||||
type="number"
|
||||
v-model="settings.limitancestorsize"
|
||||
number
|
||||
></b-form-input>
|
||||
</b-input-group>
|
||||
</div>
|
||||
</div>
|
||||
<small class="w-lg-75 d-block text-muted mt-1">
|
||||
Do not accept transactions whose size with all in-mempool ancestors exceeds <n> kilobytes
|
||||
</small>
|
||||
</div>
|
||||
</b-card-body>
|
||||
|
||||
<!-- limitdescendantcount -->
|
||||
<b-card-body class="subsetting-body px-2 px-sm-3">
|
||||
<div>
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<div class="flex-sm-grow-1">
|
||||
<label class="mb-0" for="mempool">
|
||||
<p class="subsetting-title font-weight-bold mb-0 mr-1">
|
||||
Max descendants count
|
||||
<span class="subsetting-config-name text-monospace font-weight-normal d-block">
|
||||
limitdescendantcount
|
||||
</span>
|
||||
</p>
|
||||
</label>
|
||||
</div>
|
||||
<div class="input-container ml-1">
|
||||
<b-input-group append="bytes">
|
||||
<b-form-input
|
||||
class="advanced-settings-input"
|
||||
id="limitdescendantcount"
|
||||
type="number"
|
||||
v-model="settings.limitdescendantcount"
|
||||
number
|
||||
></b-form-input>
|
||||
</b-input-group>
|
||||
</div>
|
||||
</div>
|
||||
<small class="w-lg-75 d-block text-muted mt-1">
|
||||
Do not accept transactions if any ancestor would have <n> or more in-mempool descendants
|
||||
</small>
|
||||
</div>
|
||||
</b-card-body>
|
||||
|
||||
<!-- limitdescendantsize -->
|
||||
<b-card-body class="subsetting-body px-2 px-sm-3">
|
||||
<div>
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<div class="flex-sm-grow-1">
|
||||
<label class="mb-0" for="mempool">
|
||||
<p class="subsetting-title font-weight-bold mb-0 mr-1">
|
||||
Max descendants size
|
||||
<span class="subsetting-config-name text-monospace font-weight-normal d-block">
|
||||
limitdescendantsize
|
||||
</span>
|
||||
</p>
|
||||
</label>
|
||||
</div>
|
||||
<div class="input-container ml-1">
|
||||
<b-input-group append="bytes">
|
||||
<b-form-input
|
||||
class="advanced-settings-input"
|
||||
id="limitdescendantsize"
|
||||
type="number"
|
||||
v-model="settings.limitdescendantsize"
|
||||
number
|
||||
></b-form-input>
|
||||
</b-input-group>
|
||||
</div>
|
||||
</div>
|
||||
<small class="w-lg-75 d-block text-muted mt-1">
|
||||
Do not accept transactions if any ancestor would have more than <n> kilobytes of in-mempool descendants
|
||||
</small>
|
||||
</div>
|
||||
</b-card-body>
|
||||
|
||||
<!-- permitbarepubkey -->
|
||||
<b-card-body class="subsetting-body px-2 px-sm-3">
|
||||
<div>
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<div class="flex-sm-grow-1">
|
||||
<label class="mb-0" for="mempool">
|
||||
<p class="subsetting-title font-weight-bold mb-0 mr-1">
|
||||
Permit Bare Pubkey
|
||||
<span class="subsetting-config-name text-monospace font-weight-normal d-block">
|
||||
permitbarepubkey
|
||||
</span>
|
||||
</p>
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<toggle-switch
|
||||
id="permitbarepubkey"
|
||||
class="align-self-center"
|
||||
:on="settings.permitbarepubkey"
|
||||
@toggle="status => (settings.permitbarepubkey = status)"
|
||||
></toggle-switch>
|
||||
</div>
|
||||
</div>
|
||||
<small class="w-lg-75 d-block text-muted mt-1">
|
||||
Relay legacy pubkey outputs.
|
||||
</small>
|
||||
</div>
|
||||
</b-card-body>
|
||||
|
||||
<!-- maxscriptsize -->
|
||||
<b-card-body class="subsetting-body px-2 px-sm-3">
|
||||
<div>
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<div class="flex-sm-grow-1">
|
||||
<label class="mb-0" for="mempool">
|
||||
<p class="subsetting-title font-weight-bold mb-0 mr-1">
|
||||
Max Script Size
|
||||
<span class="subsetting-config-name text-monospace font-weight-normal d-block">
|
||||
maxscriptsize
|
||||
</span>
|
||||
</p>
|
||||
</label>
|
||||
</div>
|
||||
<div class="input-container ml-1">
|
||||
<b-input-group append="bytes">
|
||||
<b-form-input
|
||||
class="advanced-settings-input"
|
||||
id="maxscriptsize"
|
||||
type="number"
|
||||
v-model="settings.maxscriptsize"
|
||||
number
|
||||
></b-form-input>
|
||||
</b-input-group>
|
||||
</div>
|
||||
</div>
|
||||
<small class="w-lg-75 d-block text-muted mt-1">
|
||||
Maximum size of scripts we relay and mine, in bytes
|
||||
</small>
|
||||
</div>
|
||||
</b-card-body>
|
||||
|
||||
<!-- datacarriercost -->
|
||||
<b-card-body class="subsetting-body px-2 px-sm-3">
|
||||
<div>
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<div class="flex-sm-grow-1">
|
||||
<label class="mb-0" for="mempool">
|
||||
<p class="subsetting-title font-weight-bold mb-0 mr-1">
|
||||
Datacarrier cost
|
||||
<span class="subsetting-config-name text-monospace font-weight-normal d-block">
|
||||
datacarriercost
|
||||
</span>
|
||||
</p>
|
||||
</label>
|
||||
</div>
|
||||
<div class="input-container ml-1">
|
||||
<b-input-group append="bytes">
|
||||
<b-form-input
|
||||
class="advanced-settings-input"
|
||||
id="datacarriercost"
|
||||
type="number"
|
||||
v-model="settings.datacarriercost"
|
||||
number
|
||||
></b-form-input>
|
||||
</b-input-group>
|
||||
</div>
|
||||
</div>
|
||||
<small class="w-lg-75 d-block text-muted mt-1">
|
||||
Treat extra data in transactions as at least N vbytes per actual byte
|
||||
</small>
|
||||
</div>
|
||||
</b-card-body>
|
||||
|
||||
<!-- acceptnonstddatacarrier -->
|
||||
<b-card-body class="subsetting-body px-2 px-sm-3">
|
||||
<div>
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<div class="flex-sm-grow-1">
|
||||
<label class="mb-0" for="mempool">
|
||||
<p class="subsetting-title font-weight-bold mb-0 mr-1">
|
||||
Datacarrier cost
|
||||
<span class="subsetting-config-name text-monospace font-weight-normal d-block">
|
||||
acceptnonstddatacarrier
|
||||
</span>
|
||||
</p>
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<toggle-switch
|
||||
id="acceptnonstddatacarrier"
|
||||
class="align-self-center"
|
||||
:on="settings.acceptnonstddatacarrier"
|
||||
@toggle="status => (settings.acceptnonstddatacarrier = status)"
|
||||
></toggle-switch>
|
||||
</div>
|
||||
</div>
|
||||
<small class="w-lg-75 d-block text-muted mt-1">
|
||||
Treat extra data in transactions as at least N vbytes per actual byte
|
||||
</small>
|
||||
</div>
|
||||
</b-card-body>
|
||||
|
||||
<!-- dustrelayfee -->
|
||||
<b-card-body class="subsetting-body px-2 px-sm-3">
|
||||
<div>
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<div class="flex-sm-grow-1">
|
||||
<label class="mb-0" for="mempool">
|
||||
<p class="subsetting-title font-weight-bold mb-0 mr-1">
|
||||
Dust Relay Fee
|
||||
<span class="subsetting-config-name text-monospace font-weight-normal d-block">
|
||||
dustrelayfee
|
||||
</span>
|
||||
</p>
|
||||
</label>
|
||||
</div>
|
||||
<div class="input-container ml-1">
|
||||
<b-input-group append="bytes">
|
||||
<b-form-input
|
||||
class="advanced-settings-input"
|
||||
id="dustrelayfee"
|
||||
type="number"
|
||||
v-model="settings.dustrelayfee"
|
||||
number
|
||||
></b-form-input>
|
||||
</b-input-group>
|
||||
</div>
|
||||
</div>
|
||||
<small class="w-lg-75 d-block text-muted mt-1">
|
||||
Fee rate (in BTC/kvB) used to define dust, the value of an output such that it will cost more than its value in fees at this fee rate to spend it.
|
||||
</small>
|
||||
</div>
|
||||
</b-card-body>
|
||||
|
||||
<!-- PRUNE -->
|
||||
<b-card-body class="subsetting-body px-2 px-sm-3">
|
||||
<div>
|
||||
|
@ -108,6 +108,42 @@ function validateSettingsRequest(settings) {
|
||||
//rejecttokens
|
||||
checkBooleanSetting({ setting: settings.rejecttokens, settingName: "rejecttokens" });
|
||||
|
||||
// minrelaytxfee
|
||||
checkNumberSetting({ setting: settings.minrelaytxfee, settingName: "minrelaytxfee", min: 0 });
|
||||
|
||||
// bytespersigopstrict
|
||||
checkNumberSetting({ setting: settings.bytespersigopstrict, settingName: "bytespersigopstrict", min: 0 });
|
||||
|
||||
// bytespersigop
|
||||
checkNumberSetting({ setting: settings.bytespersigop, settingName: "bytespersigop", min: 0 });
|
||||
|
||||
// limitancestorcount
|
||||
checkNumberSetting({ setting: settings.limitancestorcount, settingName: "limitancestorcount", min: 0 });
|
||||
|
||||
// limitancestorsize
|
||||
checkNumberSetting({ setting: settings.limitancestorsize, settingName: "limitancestorsize", min: 0 });
|
||||
|
||||
// limitdescendantcount
|
||||
checkNumberSetting({ setting: settings.limitdescendantcount, settingName: "limitdescendantcount", min: 0 });
|
||||
|
||||
// limitdescendantsize
|
||||
checkNumberSetting({ setting: settings.limitdescendantsize, settingName: "limitdescendantsize", min: 0 });
|
||||
|
||||
// permitbarepubkey
|
||||
checkBooleanSetting({ setting: settings.permitbarepubkey, settingName: "permitbarepubkey" });
|
||||
|
||||
// maxscriptsize
|
||||
checkNumberSetting({ setting: settings.maxscriptsize, settingName: "maxscriptsize", min: 0 });
|
||||
|
||||
// datacarriercost
|
||||
checkNumberSetting({ setting: settings.datacarriercost, settingName: "datacarriercost", min: 0 });
|
||||
|
||||
// dustrelayfee
|
||||
checkNumberSetting({ setting: settings.dustrelayfee, settingName: "dustrelayfee", min: 0 });
|
||||
|
||||
// acceptnonstddatacarrier
|
||||
checkBooleanSetting({ setting: settings.acceptnonstddatacarrier, settingName: "acceptnonstddatacarrier" });
|
||||
|
||||
// Max Orphan Transactions
|
||||
// No min or max specified.
|
||||
checkNumberSetting({ setting: settings.maxorphantx, settingName: "Max Orphan Transactions", min: 0 });
|
||||
|
Loading…
Reference in New Issue
Block a user