feat: add bitcoin regtest support
This commit is contained in:
parent
2625fb9f94
commit
51d10bccd2
@ -63,6 +63,7 @@ func init() {
|
|||||||
BlockChainFactories["Bitcoin"] = btc.NewBitcoinRPC
|
BlockChainFactories["Bitcoin"] = btc.NewBitcoinRPC
|
||||||
BlockChainFactories["Testnet"] = btc.NewBitcoinRPC
|
BlockChainFactories["Testnet"] = btc.NewBitcoinRPC
|
||||||
BlockChainFactories["Signet"] = btc.NewBitcoinRPC
|
BlockChainFactories["Signet"] = btc.NewBitcoinRPC
|
||||||
|
BlockChainFactories["Regtest"] = btc.NewBitcoinRPC
|
||||||
BlockChainFactories["Zcash"] = zec.NewZCashRPC
|
BlockChainFactories["Zcash"] = zec.NewZCashRPC
|
||||||
BlockChainFactories["Zcash Testnet"] = zec.NewZCashRPC
|
BlockChainFactories["Zcash Testnet"] = zec.NewZCashRPC
|
||||||
BlockChainFactories["Ethereum"] = eth.NewEthereumRPC
|
BlockChainFactories["Ethereum"] = eth.NewEthereumRPC
|
||||||
|
|||||||
36
build/templates/backend/config/bitcoin_regtest.conf
Normal file
36
build/templates/backend/config/bitcoin_regtest.conf
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
{{define "main" -}}
|
||||||
|
daemon=0
|
||||||
|
server=1
|
||||||
|
nolisten=1
|
||||||
|
txindex=1
|
||||||
|
disablewallet=0
|
||||||
|
|
||||||
|
zmqpubhashtx={{template "IPC.MessageQueueBindingTemplate" .}}
|
||||||
|
zmqpubhashblock={{template "IPC.MessageQueueBindingTemplate" .}}
|
||||||
|
|
||||||
|
rpcworkqueue=1100
|
||||||
|
maxmempool=2000
|
||||||
|
dbcache=1000
|
||||||
|
|
||||||
|
{{- if .Backend.AdditionalParams}}
|
||||||
|
# generated from additional_params
|
||||||
|
{{- range $name, $value := .Backend.AdditionalParams}}
|
||||||
|
{{- if eq $name "addnode"}}
|
||||||
|
{{- range $index, $node := $value}}
|
||||||
|
addnode={{$node}}
|
||||||
|
{{- end}}
|
||||||
|
{{- else}}
|
||||||
|
{{$name}}={{$value}}
|
||||||
|
{{- end}}
|
||||||
|
{{- end}}
|
||||||
|
{{- end}}
|
||||||
|
|
||||||
|
regtest=1
|
||||||
|
|
||||||
|
{{if .Backend.Mainnet}}[main]{{else}}[regtest]{{end}}
|
||||||
|
rpcallowip=0.0.0.0/0
|
||||||
|
rpcbind=0.0.0.0
|
||||||
|
{{generateRPCAuth .IPC.RPCUser .IPC.RPCPass -}}
|
||||||
|
rpcport={{.Ports.BackendRPC}}
|
||||||
|
|
||||||
|
{{end}}
|
||||||
69
configs/coins/bitcoin_regtest.json
Normal file
69
configs/coins/bitcoin_regtest.json
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
{
|
||||||
|
"coin": {
|
||||||
|
"name": "Regtest",
|
||||||
|
"shortcut": "rBTC",
|
||||||
|
"label": "Bitcoin Regtest",
|
||||||
|
"alias": "bitcoin_regtest"
|
||||||
|
},
|
||||||
|
"ports": {
|
||||||
|
"backend_rpc": 18021,
|
||||||
|
"backend_message_queue": 48321,
|
||||||
|
"blockbook_internal": 19021,
|
||||||
|
"blockbook_public": 19121
|
||||||
|
},
|
||||||
|
"ipc": {
|
||||||
|
"rpc_url_template": "http://127.0.0.1:{{.Ports.BackendRPC}}",
|
||||||
|
"rpc_user": "rpc",
|
||||||
|
"rpc_pass": "rpc",
|
||||||
|
"rpc_timeout": 25,
|
||||||
|
"message_queue_binding_template": "tcp://127.0.0.1:{{.Ports.BackendMessageQueue}}"
|
||||||
|
},
|
||||||
|
"backend": {
|
||||||
|
"package_name": "backend-bitcoin-regtest",
|
||||||
|
"package_revision": "satoshilabs-1",
|
||||||
|
"system_user": "bitcoin",
|
||||||
|
"version": "0.21.1",
|
||||||
|
"binary_url": "https://bitcoincore.org/bin/bitcoin-core-0.21.1/bitcoin-0.21.1-x86_64-linux-gnu.tar.gz",
|
||||||
|
"verification_type": "gpg-sha256",
|
||||||
|
"verification_source": "https://bitcoincore.org/bin/bitcoin-core-0.21.1/SHA256SUMS.asc",
|
||||||
|
"extract_command": "tar -C backend --strip 1 -xf",
|
||||||
|
"exclude_files": [
|
||||||
|
"bin/bitcoin-qt"
|
||||||
|
],
|
||||||
|
"exec_command_template": "{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/bin/bitcoind -datadir={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend -conf={{.Env.BackendInstallPath}}/{{.Coin.Alias}}/{{.Coin.Alias}}.conf -pid=/run/{{.Coin.Alias}}/{{.Coin.Alias}}.pid",
|
||||||
|
"logrotate_files_template": "{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/regtest3/*.log",
|
||||||
|
"postinst_script_template": "",
|
||||||
|
"service_type": "forking",
|
||||||
|
"service_additional_params_template": "",
|
||||||
|
"mainnet": false,
|
||||||
|
"protect_memory": true,
|
||||||
|
"server_config_file": "bitcoin_regtest.conf",
|
||||||
|
"client_config_file": "bitcoin_client.conf",
|
||||||
|
"additional_params": {
|
||||||
|
"deprecatedrpc": "estimatefee"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"blockbook": {
|
||||||
|
"package_name": "blockbook-bitcoin-regtest",
|
||||||
|
"system_user": "blockbook-bitcoin",
|
||||||
|
"internal_binding_template": ":{{.Ports.BlockbookInternal}}",
|
||||||
|
"public_binding_template": ":{{.Ports.BlockbookPublic}}",
|
||||||
|
"explorer_url": "",
|
||||||
|
"additional_params": "",
|
||||||
|
"block_chain": {
|
||||||
|
"parse": true,
|
||||||
|
"mempool_workers": 8,
|
||||||
|
"mempool_sub_workers": 2,
|
||||||
|
"block_addresses_to_keep": 300,
|
||||||
|
"xpub_magic": 70617039,
|
||||||
|
"xpub_magic_segwit_p2sh": 71979618,
|
||||||
|
"xpub_magic_segwit_native": 73342198,
|
||||||
|
"slip44": 1,
|
||||||
|
"additional_params": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"meta": {
|
||||||
|
"package_maintainer": "IT",
|
||||||
|
"package_maintainer_email": "it@satoshilabs.com"
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -46,6 +46,7 @@
|
|||||||
| BitZeny | 9095 | 9195 | 8095 | 38395 |
|
| BitZeny | 9095 | 9195 | 8095 | 38395 |
|
||||||
| Trezarcoin | 9096 | 9196 | 8096 | 38396 |
|
| Trezarcoin | 9096 | 9196 | 8096 | 38396 |
|
||||||
| Bitcoin Signet | 19020 | 19120 | 18020 | 48320 |
|
| Bitcoin Signet | 19020 | 19120 | 18020 | 48320 |
|
||||||
|
| Bitcoin Regtest | 19021 | 19121 | 18021 | 48321 |
|
||||||
| Ethereum Goerli | 19026 | 19126 | 18026 | 48326 p2p |
|
| Ethereum Goerli | 19026 | 19126 | 18026 | 48326 p2p |
|
||||||
| Bitcoin Testnet | 19030 | 19130 | 18030 | 48330 |
|
| Bitcoin Testnet | 19030 | 19130 | 18030 | 48330 |
|
||||||
| Bitcoin Cash Testnet | 19031 | 19131 | 18031 | 48331 |
|
| Bitcoin Cash Testnet | 19031 | 19131 | 18031 | 48331 |
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user