diff --git a/assets/compat/bitcoin.conf.template b/assets/compat/bitcoin.conf.template index 93a434f8..30b3bf97 100644 --- a/assets/compat/bitcoin.conf.template +++ b/assets/compat/bitcoin.conf.template @@ -15,60 +15,60 @@ rpcallowip=0.0.0.0/0 }} rpcuser={{rpc.username}} rpcpassword={{rpc.password}} -{{#FOREACH rpc.auth -rpcauth={{rpc.auth}} +{{#FOREACH rpc.advanced.auth +rpcauth={{rpc.advanced.auth}} }} -rpcservertimeout={{rpc.servertimeout}} -rpcthreads={{rpc.threads}} -rpcworkqueue={{rpc.workqueue}} +rpcservertimeout={{rpc.advanced.servertimeout}} +rpcthreads={{rpc.advanced.threads}} +rpcworkqueue={{rpc.advanced.workqueue}} ## MEMPOOL -{{#IF mempool.mempoolfullrbf +{{#IF advanced.mempool.mempoolfullrbf mempoolfullrbf=1 }} -{{#IF !mempool.mempoolfullrbf +{{#IF !advanced.mempool.mempoolfullrbf mempoolfullrbf=0 }} -{{#IF mempool.persistmempool +{{#IF advanced.mempool.persistmempool persistmempool=1 }} -{{#IF !mempool.persistmempool +{{#IF !advanced.mempool.persistmempool persistmempool=0 }} -maxmempool={{mempool.maxmempool}} -mempoolexpiry={{mempool.mempoolexpiry}} +maxmempool={{advanced.mempool.maxmempool}} +mempoolexpiry={{advanced.mempool.mempoolexpiry}} ## PEERS -{{#IF peers.listen +{{#IF advanced.peers.listen listen=1 bind=0.0.0.0:8333 }} -{{#IF !peers.listen +{{#IF !advanced.peers.listen listen=0 }} -{{#IF peers.onlyconnect -{{#FOREACH peers.addnode -{{#IF peers.addnode.port -connect={{peers.addnode.hostname}}:{{peers.addnode.port}} +{{#IF advanced.peers.onlyconnect +{{#FOREACH advanced.peers.addnode +{{#IF advanced.peers.addnode.port +connect={{advanced.peers.addnode.hostname}}:{{advanced.peers.addnode.port}} }} -{{#IF !peers.addnode.port -connect={{peers.addnode.hostname}} +{{#IF !advanced.peers.addnode.port +connect={{advanced.peers.addnode.hostname}} }} }} }} -{{#IF !peers.onlyconnect -{{#FOREACH peers.addnode -{{#IF peers.addnode.port -addnode={{peers.addnode.hostname}}:{{peers.addnode.port}} +{{#IF !advanced.peers.onlyconnect +{{#FOREACH advanced.peers.addnode +{{#IF advanced.peers.addnode.port +addnode={{advanced.peers.addnode.hostname}}:{{advanced.peers.addnode.port}} }} -{{#IF !peers.addnode.port -addnode={{peers.addnode.hostname}} +{{#IF !advanced.peers.addnode.port +addnode={{advanced.peers.addnode.hostname}} }} }} }} -{{#IF peers.onlyonion +{{#IF advanced.peers.onlyonion onlynet=onion }} @@ -102,11 +102,13 @@ avoidpartialspends=0 discardfee={{wallet.discardfee}} ## ZERO MQ +{{#IF zmq-enabled zmqpubrawblock=tcp://0.0.0.0:28332 zmqpubhashblock=tcp://0.0.0.0:28332 zmqpubrawtx=tcp://0.0.0.0:28333 zmqpubhashtx=tcp://0.0.0.0:28333 zmqpubsequence=tcp://0.0.0.0:28333 +}} ## TXINDEX {{#IF txindex diff --git a/manager/src/main.rs b/manager/src/main.rs index 393e47e1..ea177a83 100644 --- a/manager/src/main.rs +++ b/manager/src/main.rs @@ -402,7 +402,9 @@ fn inner_main(reindex: bool) -> Result<(), Box> { "-conf=/root/.bitcoin/bitcoin.conf".to_owned(), ]; if config - .get(&Value::String("peers".to_owned())) + .get(&Value::String("advanced".to_owned())) + .and_then(|v| v.as_mapping()) + .and_then(|v| v.get(&Value::String("peers".to_owned()))) .and_then(|v| v.as_mapping()) .and_then(|v| v.get(&Value::String("onlyonion".to_owned()))) .and_then(|v| v.as_bool()) @@ -453,7 +455,8 @@ fn inner_main(reindex: bool) -> Result<(), Box> { rpc_client: RpcClient::new("http://127.0.0.1:18332/".parse().unwrap()), tor: Some(TorState { proxy: format!("{}:9050", var("EMBASSY_IP")?).parse()?, - only: config[&Value::from("peers")][&Value::from("onlyonion")] + only: config[&Value::from("advanced")][&Value::from("peers")] + [&Value::from("onlyonion")] .as_bool() .unwrap(), }), diff --git a/manifest.yaml b/manifest.yaml index 6514c67a..d024970c 100644 --- a/manifest.yaml +++ b/manifest.yaml @@ -1,6 +1,6 @@ id: bitcoind title: "Bitcoin Core" -version: 25.0.0.1 +version: 25.0.0.2 eos-version: 0.3.4.3 release-notes: | * Update to latest upstream (v25.0) diff --git a/scripts/services/getConfig.ts b/scripts/services/getConfig.ts index 370ad8fc..ea24364a 100644 --- a/scripts/services/getConfig.ts +++ b/scripts/services/getConfig.ts @@ -59,55 +59,75 @@ export const getConfig: T.ExpectedExports.getConfig = async (effects) => { copyable: true, masked: true, }, - auth: { - name: "Authorization", - description: - "Username and hashed password for JSON-RPC connections. RPC clients connect using the usual http basic authentication.", - type: "list", - subtype: "string", - default: [], + advanced: { + type: "object", + name: "Advanced", + description: "Advanced RPC Settings", 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 ":$".', + auth: { + name: "Authorization", + description: + "Username and hashed password for JSON-RPC connections. RPC clients connect using the usual http basic authentication.", + type: "list", + 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 ":$".', + }, + range: "[0,*)", + }, + servertimeout: { + name: "Rpc Server Timeout", + description: + "Number of seconds after which an uncompleted RPC call will time out.", + type: "number", + nullable: false, + range: "[5,300]", + integral: true, + units: "seconds", + default: 30, + }, + threads: { + name: "Threads", + description: + "Set the number of threads for handling RPC calls. You may wish to increase this if you are making lots of calls via an integration.", + type: "number", + nullable: false, + default: 16, + range: "[1,64]", + integral: true, + units: undefined, + }, + workqueue: { + name: "Work Queue", + description: + "Set the depth of the work queue to service RPC calls. Determines how long the backlog of RPC requests can get before it just rejects new ones.", + type: "number", + nullable: false, + default: 128, + range: "[8,256]", + integral: true, + units: "requests", + }, }, - range: "[0,*)", - }, - servertimeout: { - name: "Rpc Server Timeout", - description: - "Number of seconds after which an uncompleted RPC call will time out.", - type: "number", - nullable: false, - range: "[5,300]", - integral: true, - units: "seconds", - default: 30, - }, - threads: { - name: "Threads", - description: - "Set the number of threads for handling RPC calls. You may wish to increase this if you are making lots of calls via an integration.", - type: "number", - nullable: false, - default: 16, - range: "[1,64]", - integral: true, - units: undefined, - }, - workqueue: { - name: "Work Queue", - description: - "Set the depth of the work queue to service RPC calls. Determines how long the backlog of RPC requests can get before it just rejects new ones.", - type: "number", - nullable: false, - default: 128, - range: "[8,256]", - integral: true, - units: "requests", }, }, }, + "zmq-enabled": { + type: "boolean", + name: "ZeroMQ Enabled", + description: "Enable the ZeroMQ interface", + default: true, + }, + txindex: { + type: "boolean", + name: "Transaction Index", + description: "Enable the Transaction Index (txindex)", + default: allowUnpruned, + }, wallet: { type: "object", name: "Wallet", @@ -139,121 +159,117 @@ export const getConfig: T.ExpectedExports.getConfig = async (effects) => { }, }, }, - mempool: { - type: "object", - name: "Mempool", - description: "Mempool Settings", - spec: { - persistmempool: { - type: "boolean", - name: "Persist Mempool", - description: "Save the mempool on shutdown and load on restart.", - default: true, - }, - maxmempool: { - type: "number", - nullable: false, - name: "Max Mempool Size", - description: "Keep the transaction memory pool below megabytes.", - range: "[1,*)", - integral: true, - units: "MiB", - default: 300, - }, - mempoolexpiry: { - type: "number", - nullable: false, - name: "Mempool Expiration", - description: - "Do not keep transactions in the mempool longer than hours.", - range: "[1,*)", - integral: true, - units: "Hr", - default: 336, - }, - mempoolfullrbf: { - name: "Enable Full RBF", - description: - "Policy for your node to use for relaying and mining unconfirmed transactions. For details, see https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-24.0.md#notice-of-new-option-for-transaction-replacement-policies", - type: "boolean", - default: false, - }, - }, - }, - peers: { + advanced: { type: "object", - name: "Peers", - description: "Peer Connection Settings", + name: "Advanced", + description: "Advanced Settings", spec: { - listen: { - type: "boolean", - name: "Make Public", - description: "Allow other nodes to find your server on the network.", - default: true, - }, - onlyconnect: { - type: "boolean", - name: "Disable Peer Discovery", - description: "Only connect to specified peers.", - default: false, - }, - onlyonion: { - type: "boolean", - name: "Disable Clearnet", - description: "Only connect to peers over Tor.", - default: false, + mempool: { + type: "object", + name: "Mempool", + description: "Mempool Settings", + spec: { + persistmempool: { + type: "boolean", + name: "Persist Mempool", + description: "Save the mempool on shutdown and load on restart.", + default: true, + }, + maxmempool: { + type: "number", + nullable: false, + name: "Max Mempool Size", + description: + "Keep the transaction memory pool below megabytes.", + range: "[1,*)", + integral: true, + units: "MiB", + default: 300, + }, + mempoolexpiry: { + type: "number", + nullable: false, + name: "Mempool Expiration", + description: + "Do not keep transactions in the mempool longer than hours.", + range: "[1,*)", + integral: true, + units: "Hr", + default: 336, + }, + mempoolfullrbf: { + name: "Enable Full RBF", + description: + "Policy for your node to use for relaying and mining unconfirmed transactions. For details, see https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-24.0.md#notice-of-new-option-for-transaction-replacement-policies", + type: "boolean", + default: false, + }, + }, }, - addnode: { - name: "Add Nodes", - description: "Add addresses of nodes to connect to.", - type: "list", - subtype: "object", - range: "[0,*)", - default: [], + peers: { + type: "object", + name: "Peers", + description: "Peer Connection Settings", spec: { - spec: { - hostname: { - type: "string", - nullable: false, - name: "Hostname", - description: "Domain or IP address of bitcoin peer", - pattern: - "(^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$)|((^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$)|(^[a-z2-7]{16}\\.onion$)|(^([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]$))", - "pattern-description": - "Must be either a domain name, or an IPv4 or IPv6 address. Do not include protocol scheme (eg 'http://') or port.", - }, - port: { - type: "number", - nullable: true, - name: "Port", - description: - "Port that peer is listening on for inbound p2p connections", - range: "[0,65535]", - integral: true, + listen: { + type: "boolean", + name: "Make Public", + description: + "Allow other nodes to find your server on the network.", + default: true, + }, + onlyconnect: { + type: "boolean", + name: "Disable Peer Discovery", + description: "Only connect to specified peers.", + default: false, + }, + onlyonion: { + type: "boolean", + name: "Disable Clearnet", + description: "Only connect to peers over Tor.", + default: false, + }, + addnode: { + name: "Add Nodes", + description: "Add addresses of nodes to connect to.", + type: "list", + subtype: "object", + range: "[0,*)", + default: [], + spec: { + spec: { + hostname: { + type: "string", + nullable: false, + name: "Hostname", + description: "Domain or IP address of bitcoin peer", + pattern: + "(^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$)|((^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$)|(^[a-z2-7]{16}\\.onion$)|(^([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]$))", + "pattern-description": + "Must be either a domain name, or an IPv4 or IPv6 address. Do not include protocol scheme (eg 'http://') or port.", + }, + port: { + type: "number", + nullable: true, + name: "Port", + description: + "Port that peer is listening on for inbound p2p connections", + range: "[0,65535]", + integral: true, + }, + }, }, }, }, }, - }, - }, - txindex: { - type: "boolean", - name: "Transaction Index", - description: "Enable the Transaction Index (txindex)", - default: allowUnpruned, - }, - advanced: { - type: "object", - name: "Advanced", - description: "Advanced Settings", - spec: { pruning: { type: "union", name: "Pruning Settings", 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", + "Disabling 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: { id: "mode", name: "Pruning Mode", diff --git a/scripts/services/migrations.ts b/scripts/services/migrations.ts index afcd3c42..a44b2565 100644 --- a/scripts/services/migrations.ts +++ b/scripts/services/migrations.ts @@ -180,6 +180,55 @@ export const migration: T.ExpectedExports.migration = { version: "25.0.0", type: "down" } ), }, + "25.0.0.2": { + up: compat.migrations.updateConfig( + (config: any) => { + config["zmq-enabled"] = true; + + config.rpc.advanced = { + auth: config.rpc.auth, + servertimeout: config.rpc.servertimeout, + threads: config.rpc.threads, + workqueue: config.rpc.workqueue, + }; + delete config.rpc.auth; + delete config.rpc.servertimeout; + delete config.rpc.threads; + delete config.rpc.workqueue; + + config.advanced.mempool = config.mempool; + delete config.mempool; + + config.advanced.peers = config.peers; + delete config.peers; + + return config; + }, + true, + { version: "25.0.0.2", type: "up" } + ), + down: compat.migrations.updateConfig( + (config: any) => { + delete config["zmq-enabled"]; + + config.rpc = { + ...config.rpc, + ...config.rpc.advanced, + }; + delete config.rpc.advanced; + + config.mempool = config.advanced.mempool; + delete config.advanced.mempool; + + config.peers = config.advanced.peers; + delete config.advanced.peers; + + return config; + }, + true, + { version: "25.0.0.2", type: "down" } + ), + }, }, - "25.0.0.1" + "25.0.0.2" );