chore: charlie 14

This commit is contained in:
BluJ
2023-04-11 15:50:01 -06:00
parent d8d36be5e2
commit f3c1cea0b9
5 changed files with 64 additions and 29 deletions

View File

@@ -14,8 +14,14 @@ import { TypeFromProps } from "../util/propertiesMatcher";
export function setupConfigExports<A extends InputSpec, ConfigType>(options: {
spec: Config<A>;
dependsOn: DependsOn;
write(options: { effects: Effects; input: TypeFromProps<A> }): Promise<ConfigType>;
read(options: { effects: Effects; config: ConfigType }): Promise<null | DeepPartial<TypeFromProps<A>>>;
write(options: {
effects: Effects;
input: TypeFromProps<A>;
}): Promise<ConfigType>;
read(options: {
effects: Effects;
config: ConfigType;
}): Promise<null | DeepPartial<TypeFromProps<A>>>;
}) {
const validator = options.spec.validator();
return {
@@ -30,7 +36,9 @@ export function setupConfigExports<A extends InputSpec, ConfigType>(options: {
getConfig: (async ({ effects, config }) => {
return {
spec: options.spec.build(),
config: nullIfEmpty(await options.read({ effects, config: config as ConfigType })),
config: nullIfEmpty(
await options.read({ effects, config: config as ConfigType })
),
};
}) as ExpectedExports.getConfig,
};

View File

@@ -19,7 +19,8 @@ writeConvertedFile(
tag: {
id: "type",
name: "Type",
description: "- LND: Lightning Network Daemon from Lightning Labs\n- CLN: Core Lightning from Blockstream\n",
description:
"- LND: Lightning Network Daemon from Lightning Labs\n- CLN: Core Lightning from Blockstream\n",
"variant-names": {
lnd: "Lightning Network Daemon (LND)",
"c-lightning": "Core Lightning (CLN)",
@@ -58,7 +59,8 @@ writeConvertedFile(
default: "bitcoin",
masked: true,
pattern: "^[a-zA-Z0-9_]+$",
"pattern-description": "Must be alphanumeric (can contain underscore).",
"pattern-description":
"Must be alphanumeric (can contain underscore).",
},
password: {
type: "string",
@@ -70,7 +72,8 @@ writeConvertedFile(
len: 20,
},
pattern: '^[^\\n"]*$',
"pattern-description": "Must not contain newline or quote characters.",
"pattern-description":
"Must not contain newline or quote characters.",
copyable: true,
masked: true,
},
@@ -82,7 +85,8 @@ writeConvertedFile(
default: "bitcoin",
masked: true,
pattern: "^[a-zA-Z0-9_]+$",
"pattern-description": "Must be alphanumeric (can contain underscore).",
"pattern-description":
"Must be alphanumeric (can contain underscore).",
textarea: true,
},
advanced: {
@@ -98,15 +102,18 @@ writeConvertedFile(
subtype: "string",
default: [],
spec: {
pattern: "^[a-zA-Z0-9_-]+:([0-9a-fA-F]{2})+\\$([0-9a-fA-F]{2})+$",
"pattern-description": 'Each item must be of the form "<USERNAME>:<SALT>$<HASH>".',
pattern:
"^[a-zA-Z0-9_-]+:([0-9a-fA-F]{2})+\\$([0-9a-fA-F]{2})+$",
"pattern-description":
'Each item must be of the form "<USERNAME>:<SALT>$<HASH>".',
masked: false,
},
range: "[0,*)",
},
serialversion: {
name: "Serialization Version",
description: "Return raw transaction or block hex with Segwit or non-SegWit serialization.",
description:
"Return raw transaction or block hex with Segwit or non-SegWit serialization.",
type: "enum",
values: ["non-segwit", "segwit"],
"value-names": {},
@@ -114,7 +121,8 @@ writeConvertedFile(
},
servertimeout: {
name: "Rpc Server Timeout",
description: "Number of seconds after which an uncompleted RPC call will time out.",
description:
"Number of seconds after which an uncompleted RPC call will time out.",
type: "number",
nullable: false,
range: "[5,300]",
@@ -217,7 +225,8 @@ writeConvertedFile(
type: "number",
nullable: false,
name: "Max Mempool Size",
description: "Keep the transaction memory pool below <n> megabytes.",
description:
"Keep the transaction memory pool below <n> megabytes.",
range: "[1,*)",
integral: true,
units: "MiB",
@@ -227,7 +236,8 @@ writeConvertedFile(
type: "number",
nullable: false,
name: "Mempool Expiration",
description: "Do not keep transactions in the mempool longer than <n> hours.",
description:
"Do not keep transactions in the mempool longer than <n> hours.",
range: "[1,*)",
integral: true,
units: "Hr",
@@ -243,7 +253,8 @@ writeConvertedFile(
listen: {
type: "boolean",
name: "Make Public",
description: "Allow other nodes to find your server on the network.",
description:
"Allow other nodes to find your server on the network.",
default: true,
},
onlyconnect: {
@@ -283,7 +294,8 @@ writeConvertedFile(
type: "number",
nullable: true,
name: "Port",
description: "Port that peer is listening on for inbound p2p connections",
description:
"Port that peer is listening on for inbound p2p connections",
range: "[0,65535]",
integral: true,
},
@@ -307,7 +319,8 @@ writeConvertedFile(
pruning: {
type: "union",
name: "Pruning Settings",
description: "Blockchain Pruning Options\nReduce the blockchain size on disk\n",
description:
"Blockchain Pruning Options\nReduce the blockchain size on disk\n",
warning:
"If you set pruning to Manual and your disk is smaller than the total size of the blockchain, you MUST have something running that prunes these blocks or you may overfill your disk!\nDisabling pruning will convert your node into a full archival node. This requires a resync of the entire blockchain, a process that may take several days. Make sure you have enough free disk space or you may fill up your disk.\n",
tag: {
@@ -329,7 +342,8 @@ writeConvertedFile(
nullable: false,
name: "Max Chain Size",
description: "Limit of blockchain size on disk.",
warning: "Increasing this value will require re-syncing your node.",
warning:
"Increasing this value will require re-syncing your node.",
default: 550,
range: "[550,1000000)",
integral: true,

View File

@@ -12,11 +12,14 @@ export const name = Value.string({
patternDescription: null,
});
export const lnd = Config.of({ name: name });
export const lightningNodesVariants = Variants.of({ lnd: { name: "lnd", spec: lnd } });
export const lightningNodesVariants = Variants.of({
lnd: { name: "lnd", spec: lnd },
});
export const lightningNodesUnion = Value.union(
{
name: "Type",
description: "- LND: Lightning Network Daemon from Lightning Labs\n- CLN: Core Lightning from Blockstream\n",
description:
"- LND: Lightning Network Daemon from Lightning Labs\n- CLN: Core Lightning from Blockstream\n",
warning: null,
required: true,
default: "lnd",
@@ -92,13 +95,15 @@ export const authorizationList = List.string(
masked: false,
placeholder: null,
pattern: "^[a-zA-Z0-9_-]+:([0-9a-fA-F]{2})+\\$([0-9a-fA-F]{2})+$",
patternDescription: 'Each item must be of the form "<USERNAME>:<SALT>$<HASH>".',
patternDescription:
'Each item must be of the form "<USERNAME>:<SALT>$<HASH>".',
}
);
export const auth = Value.list(authorizationList);
export const serialversion = Value.select({
name: "Serialization Version",
description: "Return raw transaction or block hex with Segwit or non-SegWit serialization.",
description:
"Return raw transaction or block hex with Segwit or non-SegWit serialization.",
warning: null,
default: "segwit",
required: true,
@@ -110,7 +115,8 @@ export const serialversion = Value.select({
export const servertimeout = Value.number({
name: "Rpc Server Timeout",
default: 30,
description: "Number of seconds after which an uncompleted RPC call will time out.",
description:
"Number of seconds after which an uncompleted RPC call will time out.",
warning: null,
required: true,
range: "[5,300]",
@@ -200,7 +206,8 @@ export const avoidpartialspends = Value.boolean({
export const discardfee = Value.number({
name: "Discard Change Tolerance",
default: 0.0001,
description: "The fee rate (in BTC/kB) that indicates your tolerance for discarding change by adding it to the fee.",
description:
"The fee rate (in BTC/kB) that indicates your tolerance for discarding change by adding it to the fee.",
warning: null,
required: true,
range: "[0,.01]",
@@ -410,7 +417,10 @@ export const peerblockfilters = Value.boolean({
"Serve Compact Block Filters as a peer service to other nodes on the network. This is useful if you wish to connect an SPV client to your node to make it efficient to scan transactions without having to download all block data. 'Compute Compact Block Filters (BIP158)' is required.",
warning: null,
});
export const blockFiltersSpec = Config.of({ blockfilterindex: blockfilterindex, peerblockfilters: peerblockfilters });
export const blockFiltersSpec = Config.of({
blockfilterindex: blockfilterindex,
peerblockfilters: peerblockfilters,
});
export const blockfilters = Value.object(
{
name: "Block Filters",
@@ -424,9 +434,12 @@ export const peerbloomfilters = Value.boolean({
default: false,
description:
"Peers have the option of setting filters on each connection they make after the version handshake has completed. Bloom filters are for clients implementing SPV (Simplified Payment Verification) that want to check that block headers connect together correctly, without needing to verify the full blockchain. The client must trust that the transactions in the chain are in fact valid. It is highly recommended AGAINST using for anything except Bisq integration.",
warning: "This is ONLY for use with Bisq integration, please use Block Filters for all other applications.",
warning:
"This is ONLY for use with Bisq integration, please use Block Filters for all other applications.",
});
export const bloomFiltersBip37Spec = Config.of({
peerbloomfilters: peerbloomfilters,
});
export const bloomFiltersBip37Spec = Config.of({ peerbloomfilters: peerbloomfilters });
export const bloomfilters = Value.object(
{
name: "Bloom Filters (BIP37)",

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "start-sdk",
"version": "0.4.0-lib0.charlie13",
"version": "0.4.0-lib0.charlie14",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "start-sdk",
"version": "0.4.0-lib0.charlie13",
"version": "0.4.0-lib0.charlie14",
"license": "MIT",
"dependencies": {
"@iarna/toml": "^2.2.5",

View File

@@ -1,6 +1,6 @@
{
"name": "start-sdk",
"version": "0.4.0-lib0.charlie13",
"version": "0.4.0-lib0.charlie14",
"description": "For making the patterns that are wanted in making services for the startOS.",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",