From 8d22752beceb93b2a06f5712abb44be97e7fb548 Mon Sep 17 00:00:00 2001 From: JoHnY Date: Mon, 1 Jul 2024 16:46:54 +0000 Subject: [PATCH 01/56] =?UTF-8?q?prysm=205.0.2=20=E2=86=92=205.0.4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- configs/coins/ethereum_archive_consensus.json | 10 +++++----- configs/coins/ethereum_consensus.json | 6 +++--- .../ethereum_testnet_holesky_archive_consensus.json | 12 ++++++------ .../coins/ethereum_testnet_holesky_consensus.json | 12 ++++++------ .../ethereum_testnet_sepolia_archive_consensus.json | 12 ++++++------ .../coins/ethereum_testnet_sepolia_consensus.json | 2 +- 6 files changed, 27 insertions(+), 27 deletions(-) diff --git a/configs/coins/ethereum_archive_consensus.json b/configs/coins/ethereum_archive_consensus.json index c57f2207..6534e3f6 100644 --- a/configs/coins/ethereum_archive_consensus.json +++ b/configs/coins/ethereum_archive_consensus.json @@ -19,10 +19,10 @@ "package_name": "backend-ethereum-archive-consensus", "package_revision": "satoshilabs-1", "system_user": "ethereum", - "version": "5.0.2", - "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.0.2/beacon-chain-v5.0.2-linux-amd64", + "version": "5.0.4", + "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.0.4/beacon-chain-v5.0.4-linux-amd64", "verification_type": "sha256", - "verification_source": "f3515bdd216a34e54b178d03ced311e4c86cee1a1d0f84fb8bffa682244916b4", + "verification_source": "5e51589ea9e53d90690dd26aaad9f7ee01f8c760082521438f7a4f05028dfc9f", "extract_command": "mv ${ARCHIVE} backend/beacon-chain && chmod +x backend/beacon-chain && echo", "exclude_files": [], "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/beacon-chain --mainnet --accept-terms-of-use --execution-endpoint=http://localhost:{{.Ports.BackendAuthRpc}} --grpc-gateway-port=7516 --rpc-port=7517 --monitoring-port=7518 --p2p-tcp-port=3516 --p2p-udp-port=2516 --datadir={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend --jwt-secret={{.Env.BackendDataPath}}/ethereum_archive/backend/erigon/jwt.hex 2>>{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", @@ -36,8 +36,8 @@ "client_config_file": "", "platforms": { "arm64": { - "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.0.2/beacon-chain-v5.0.2-linux-arm64", - "verification_source": "dcabf9ecd9e6835f04d81d8317d640fdb3a223cb462c8764f0ea167a3ff3230e" + "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.0.4/beacon-chain-v5.0.4-linux-arm64", + "verification_source": "2d8c925d35aebd193f29f763dca879c190db9567a12f03f6ca17f471378104df" } } }, diff --git a/configs/coins/ethereum_consensus.json b/configs/coins/ethereum_consensus.json index 971e2635..42383b53 100644 --- a/configs/coins/ethereum_consensus.json +++ b/configs/coins/ethereum_consensus.json @@ -19,10 +19,10 @@ "package_name": "backend-ethereum-consensus", "package_revision": "satoshilabs-1", "system_user": "ethereum", - "version": "5.0.2", - "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.0.2/beacon-chain-v5.0.2-linux-amd64", + "version": "5.0.4", + "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.0.4/beacon-chain-v5.0.4-linux-amd64", "verification_type": "sha256", - "verification_source": "f3515bdd216a34e54b178d03ced311e4c86cee1a1d0f84fb8bffa682244916b4", + "verification_source": "5e51589ea9e53d90690dd26aaad9f7ee01f8c760082521438f7a4f05028dfc9f", "extract_command": "mv ${ARCHIVE} backend/beacon-chain && chmod +x backend/beacon-chain && echo", "exclude_files": [], "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/beacon-chain --mainnet --accept-terms-of-use --execution-endpoint=http://localhost:{{.Ports.BackendAuthRpc}} --grpc-gateway-port=7536 --rpc-port=7537 --monitoring-port=7538 --p2p-tcp-port=3536 --p2p-udp-port=2536 --datadir={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend --jwt-secret={{.Env.BackendDataPath}}/ethereum/backend/erigon/jwt.hex 2>>{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", diff --git a/configs/coins/ethereum_testnet_holesky_archive_consensus.json b/configs/coins/ethereum_testnet_holesky_archive_consensus.json index e2db51d5..2c5ec441 100644 --- a/configs/coins/ethereum_testnet_holesky_archive_consensus.json +++ b/configs/coins/ethereum_testnet_holesky_archive_consensus.json @@ -23,15 +23,15 @@ "package_name": "backend-ethereum-testnet-holesky-archive-consensus", "package_revision": "satoshilabs-1", "system_user": "ethereum", - "version": "5.0.2", - "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.0.2/beacon-chain-v5.0.2-linux-amd64", + "version": "5.0.4", + "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.0.4/beacon-chain-v5.0.4-linux-amd64", "verification_type": "sha256", - "verification_source": "f3515bdd216a34e54b178d03ced311e4c86cee1a1d0f84fb8bffa682244916b4", + "verification_source": "5e51589ea9e53d90690dd26aaad9f7ee01f8c760082521438f7a4f05028dfc9f", "extract_command": "mv ${ARCHIVE} backend/beacon-chain && chmod +x backend/beacon-chain && echo", "exclude_files": [], "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/beacon-chain --holesky --accept-terms-of-use --execution-endpoint=http://localhost:{{.Ports.BackendAuthRpc}} --grpc-gateway-port=17536 --rpc-port=17537 --monitoring-port=17538 --p2p-tcp-port=13636 --p2p-udp-port=12636 --datadir={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend --jwt-secret={{.Env.BackendDataPath}}/ethereum_testnet_holesky_archive/backend/erigon/jwt.hex --genesis-state={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/genesis.ssz 2>>{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", "logrotate_files_template": "{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log", - "postinst_script_template": "wget https://github.com/eth-clients/holesky/raw/main/custom_config_data/genesis.ssz -O {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/genesis.ssz", + "postinst_script_template": "wget https://github.com/eth-clients/holesky/raw/main/metadata/genesis.ssz -O {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/genesis.ssz", "service_type": "simple", "service_additional_params_template": "", "protect_memory": true, @@ -40,8 +40,8 @@ "client_config_file": "", "platforms": { "arm64": { - "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.0.2/beacon-chain-v5.0.2-linux-arm64", - "verification_source": "dcabf9ecd9e6835f04d81d8317d640fdb3a223cb462c8764f0ea167a3ff3230e" + "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.0.4/beacon-chain-v5.0.4-linux-arm64", + "verification_source": "2d8c925d35aebd193f29f763dca879c190db9567a12f03f6ca17f471378104df" } } }, diff --git a/configs/coins/ethereum_testnet_holesky_consensus.json b/configs/coins/ethereum_testnet_holesky_consensus.json index 461d4172..8f113d85 100644 --- a/configs/coins/ethereum_testnet_holesky_consensus.json +++ b/configs/coins/ethereum_testnet_holesky_consensus.json @@ -23,15 +23,15 @@ "package_name": "backend-ethereum-testnet-holesky-consensus", "package_revision": "satoshilabs-1", "system_user": "ethereum", - "version": "5.0.2", - "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.0.2/beacon-chain-v5.0.2-linux-amd64", + "version": "5.0.4", + "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.0.4/beacon-chain-v5.0.4-linux-amd64", "verification_type": "sha256", - "verification_source": "f3515bdd216a34e54b178d03ced311e4c86cee1a1d0f84fb8bffa682244916b4", + "verification_source": "5e51589ea9e53d90690dd26aaad9f7ee01f8c760082521438f7a4f05028dfc9f", "extract_command": "mv ${ARCHIVE} backend/beacon-chain && chmod +x backend/beacon-chain && echo", "exclude_files": [], "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/beacon-chain --holesky --accept-terms-of-use --execution-endpoint=http://localhost:{{.Ports.BackendAuthRpc}} --grpc-gateway-port=17516 --rpc-port=17517 --monitoring-port=17518 --p2p-tcp-port=13516 --p2p-udp-port=12516 --datadir={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend --jwt-secret={{.Env.BackendDataPath}}/ethereum_testnet_holesky/backend/erigon/jwt.hex --genesis-state={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/genesis.ssz 2>>{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", "logrotate_files_template": "{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log", - "postinst_script_template": "wget https://github.com/eth-clients/holesky/raw/main/custom_config_data/genesis.ssz -O {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/genesis.ssz", + "postinst_script_template": "wget https://github.com/eth-clients/holesky/raw/main/metadata/genesis.ssz -O {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/genesis.ssz", "service_type": "simple", "service_additional_params_template": "", "protect_memory": true, @@ -40,8 +40,8 @@ "client_config_file": "", "platforms": { "arm64": { - "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.0.2/beacon-chain-v5.0.2-linux-arm64", - "verification_source": "dcabf9ecd9e6835f04d81d8317d640fdb3a223cb462c8764f0ea167a3ff3230e" + "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.0.4/beacon-chain-v5.0.4-linux-arm64", + "verification_source": "2d8c925d35aebd193f29f763dca879c190db9567a12f03f6ca17f471378104df" } } }, diff --git a/configs/coins/ethereum_testnet_sepolia_archive_consensus.json b/configs/coins/ethereum_testnet_sepolia_archive_consensus.json index c18afa41..5279e8fe 100644 --- a/configs/coins/ethereum_testnet_sepolia_archive_consensus.json +++ b/configs/coins/ethereum_testnet_sepolia_archive_consensus.json @@ -23,15 +23,15 @@ "package_name": "backend-ethereum-testnet-sepolia-archive-consensus", "package_revision": "satoshilabs-1", "system_user": "ethereum", - "version": "5.0.2", - "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.0.2/beacon-chain-v5.0.2-linux-amd64", + "version": "5.0.4", + "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.0.4/beacon-chain-v5.0.4-linux-amd64", "verification_type": "sha256", - "verification_source": "f3515bdd216a34e54b178d03ced311e4c86cee1a1d0f84fb8bffa682244916b4", + "verification_source": "5e51589ea9e53d90690dd26aaad9f7ee01f8c760082521438f7a4f05028dfc9f", "extract_command": "mv ${ARCHIVE} backend/beacon-chain && chmod +x backend/beacon-chain && echo", "exclude_files": [], "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/beacon-chain --sepolia --accept-terms-of-use --execution-endpoint=http://localhost:{{.Ports.BackendAuthRpc}} --grpc-gateway-port=17586 --rpc-port=17587 --monitoring-port=17548 --p2p-tcp-port=13676 --p2p-udp-port=12676 --datadir={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend --jwt-secret={{.Env.BackendDataPath}}/ethereum_testnet_sepolia_archive/backend/erigon/jwt.hex --genesis-state={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/genesis.ssz 2>>{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", "logrotate_files_template": "{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log", - "postinst_script_template": "wget https://github.com/eth-clients/merge-testnets/raw/302fe27afdc7a9d15b1766a0c0a9d64319140255/sepolia/genesis.ssz -O {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/genesis.ssz", + "postinst_script_template": "wget https://github.com/eth-clients/sepolia/raw/main/metadata/genesis.ssz -O {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/genesis.ssz", "service_type": "simple", "service_additional_params_template": "", "protect_memory": true, @@ -40,8 +40,8 @@ "client_config_file": "", "platforms": { "arm64": { - "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.0.2/beacon-chain-v5.0.2-linux-arm64", - "verification_source": "dcabf9ecd9e6835f04d81d8317d640fdb3a223cb462c8764f0ea167a3ff3230e" + "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.0.4/beacon-chain-v5.0.4-linux-arm64", + "verification_source": "2d8c925d35aebd193f29f763dca879c190db9567a12f03f6ca17f471378104df" } } }, diff --git a/configs/coins/ethereum_testnet_sepolia_consensus.json b/configs/coins/ethereum_testnet_sepolia_consensus.json index 03e82589..623f0a5b 100644 --- a/configs/coins/ethereum_testnet_sepolia_consensus.json +++ b/configs/coins/ethereum_testnet_sepolia_consensus.json @@ -31,7 +31,7 @@ "exclude_files": [], "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/beacon-chain --sepolia --accept-terms-of-use --execution-endpoint=http://localhost:{{.Ports.BackendAuthRpc}} --grpc-gateway-port=17576 --rpc-port=17577 --monitoring-port=17578 --p2p-tcp-port=13576 --p2p-udp-port=12576 --datadir={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend --jwt-secret={{.Env.BackendDataPath}}/ethereum_testnet_sepolia/backend/erigon/jwt.hex --genesis-state={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/genesis.ssz 2>>{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", "logrotate_files_template": "{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log", - "postinst_script_template": "wget https://github.com/eth-clients/merge-testnets/raw/302fe27afdc7a9d15b1766a0c0a9d64319140255/sepolia/genesis.ssz -O {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/genesis.ssz", + "postinst_script_template": "wget https://github.com/eth-clients/holesky/raw/main/metadata/genesis.ssz -O {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/genesis.ssz", "service_type": "simple", "service_additional_params_template": "", "protect_memory": true, From 6f170e07b0cb8ee22f78f72422beeff492163dd7 Mon Sep 17 00:00:00 2001 From: Martin Boehm Date: Fri, 7 Jun 2024 16:54:58 +0200 Subject: [PATCH 02/56] Delay loading 5minute and hourly tickers to avoid unnecessary calls to Coingecko --- fiat/fiat_rates.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fiat/fiat_rates.go b/fiat/fiat_rates.go index a9a37979..13e7168f 100644 --- a/fiat/fiat_rates.go +++ b/fiat/fiat_rates.go @@ -419,8 +419,8 @@ func (fr *FiatRates) RunDownloader() error { } } - // load hourly tickers, give about 30 minutes to prepare the tickers - if time.Now().UTC().Unix() >= fr.hourlyTickersTo+secondsInHour+secondsInHour/2 { + // load hourly tickers, it is necessary to wait about 1 hour to prepare the tickers + if time.Now().UTC().Unix() >= fr.hourlyTickersTo+secondsInHour+secondsInHour { hourlyTickers, err := fr.downloader.HourlyTickers() if err != nil || hourlyTickers == nil { glog.Error("FiatRatesDownloader: HourlyTickers error ", err) @@ -430,8 +430,8 @@ func (fr *FiatRates) RunDownloader() error { } } - // load five minute tickers, give about 5 minutes to prepare the tickers - if time.Now().UTC().Unix() >= fr.fiveMinutesTickersTo+2*secondsInFiveMinutes { + // load five minute tickers, it is necessary to wait about 10 minutes to prepare the tickers + if time.Now().UTC().Unix() >= fr.fiveMinutesTickersTo+3*secondsInFiveMinutes { fiveMinutesTickers, err := fr.downloader.FiveMinutesTickers() if err != nil || fiveMinutesTickers == nil { glog.Error("FiatRatesDownloader: FiveMinutesTickers error ", err) From f0dd0e80b0b8da25699719478d67fc7b204a900f Mon Sep 17 00:00:00 2001 From: kaladinlight <35275952+kaladinlight@users.noreply.github.com> Date: Wed, 22 Mar 2023 15:15:56 -0600 Subject: [PATCH 03/56] add optimism support --- api/types.go | 4 + api/worker.go | 21 +- bchain/coins/blockchain.go | 3 + bchain/coins/eth/ethparser.go | 66 ++- bchain/coins/eth/ethrpc.go | 14 +- bchain/coins/eth/ethtx.pb.go | 549 +++++++++++++----- bchain/coins/eth/ethtx.proto | 62 +- bchain/coins/optimism/evm.go | 45 ++ bchain/coins/optimism/optimismrpc.go | 83 +++ bchain/types_ethereum_type.go | 10 +- build/docker/deb/Dockerfile | 2 +- build/templates/backend/scripts/optimism.sh | 44 ++ .../backend/scripts/optimism_archive.sh | 48 ++ .../scripts/optimism_archive_legacy_geth.sh | 40 ++ configs/coins/optimism.json | 66 +++ configs/coins/optimism_archive.json | 69 +++ .../coins/optimism_archive_legacy_geth.json | 40 ++ configs/coins/optimism_archive_op_node.json | 37 ++ configs/coins/optimism_op_node.json | 37 ++ docs/ports.md | 158 ++--- static/templates/tx.html | 18 + 21 files changed, 1138 insertions(+), 278 deletions(-) create mode 100644 bchain/coins/optimism/evm.go create mode 100644 bchain/coins/optimism/optimismrpc.go create mode 100644 build/templates/backend/scripts/optimism.sh create mode 100644 build/templates/backend/scripts/optimism_archive.sh create mode 100644 build/templates/backend/scripts/optimism_archive_legacy_geth.sh create mode 100644 configs/coins/optimism.json create mode 100644 configs/coins/optimism_archive.json create mode 100644 configs/coins/optimism_archive_legacy_geth.json create mode 100644 configs/coins/optimism_archive_op_node.json create mode 100644 configs/coins/optimism_op_node.json diff --git a/api/types.go b/api/types.go index 0bc2f53a..6f5bb80f 100644 --- a/api/types.go +++ b/api/types.go @@ -232,6 +232,10 @@ type EthereumSpecific struct { GasLimit *big.Int `json:"gasLimit"` GasUsed *big.Int `json:"gasUsed,omitempty"` GasPrice *Amount `json:"gasPrice,omitempty"` + L1Fee *big.Int `json:"l1Fee,omitempty"` + L1FeeScalar string `json:"l1FeeScalar,omitempty"` + L1GasPrice *Amount `json:"l1GasPrice,omitempty"` + L1GasUsed *big.Int `json:"l1GasUsed,omitempty"` Data string `json:"data,omitempty"` ParsedData *bchain.EthereumParsedInputData `json:"parsedData,omitempty"` InternalTransfers []EthereumInternalTransfer `json:"internalTransfers,omitempty"` diff --git a/api/worker.go b/api/worker.go index 448885aa..ed5a76da 100644 --- a/api/worker.go +++ b/api/worker.go @@ -429,18 +429,25 @@ func (w *Worker) getTransactionFromBchainTx(bchainTx *bchain.Tx, height int, spe // mempool txs do not have fees yet if ethTxData.GasUsed != nil { feesSat.Mul(ethTxData.GasPrice, ethTxData.GasUsed) + if ethTxData.L1Fee != nil { + feesSat.Add(&feesSat, ethTxData.L1Fee) + } } if len(bchainTx.Vout) > 0 { valOutSat = bchainTx.Vout[0].ValueSat } ethSpecific = &EthereumSpecific{ - GasLimit: ethTxData.GasLimit, - GasPrice: (*Amount)(ethTxData.GasPrice), - GasUsed: ethTxData.GasUsed, - Nonce: ethTxData.Nonce, - Status: ethTxData.Status, - Data: ethTxData.Data, - ParsedData: parsedInputData, + GasLimit: ethTxData.GasLimit, + GasPrice: (*Amount)(ethTxData.GasPrice), + GasUsed: ethTxData.GasUsed, + L1Fee: ethTxData.L1Fee, + L1FeeScalar: ethTxData.L1FeeScalar, + L1GasPrice: (*Amount)(ethTxData.L1GasPrice), + L1GasUsed: ethTxData.L1GasUsed, + Nonce: ethTxData.Nonce, + Status: ethTxData.Status, + Data: ethTxData.Data, + ParsedData: parsedInputData, } if internalData != nil { ethSpecific.Type = internalData.Type diff --git a/bchain/coins/blockchain.go b/bchain/coins/blockchain.go index 31de7876..dcb51667 100644 --- a/bchain/coins/blockchain.go +++ b/bchain/coins/blockchain.go @@ -42,6 +42,7 @@ import ( "github.com/trezor/blockbook/bchain/coins/namecoin" "github.com/trezor/blockbook/bchain/coins/nuls" "github.com/trezor/blockbook/bchain/coins/omotenashicoin" + "github.com/trezor/blockbook/bchain/coins/optimism" "github.com/trezor/blockbook/bchain/coins/pivx" "github.com/trezor/blockbook/bchain/coins/polis" "github.com/trezor/blockbook/bchain/coins/polygon" @@ -138,6 +139,8 @@ func init() { BlockChainFactories["BNB Smart Chain Archive"] = bsc.NewBNBSmartChainRPC BlockChainFactories["Polygon"] = polygon.NewPolygonRPC BlockChainFactories["Polygon Archive"] = polygon.NewPolygonRPC + BlockChainFactories["Optimism"] = optimism.NewOptimismRPC + BlockChainFactories["Optimism Archive"] = optimism.NewOptimismRPC } // NewBlockChain creates bchain.BlockChain and bchain.Mempool for the coin passed by the parameter coin diff --git a/bchain/coins/eth/ethparser.go b/bchain/coins/eth/ethparser.go index 975b8374..161c14ad 100644 --- a/bchain/coins/eth/ethparser.go +++ b/bchain/coins/eth/ethparser.go @@ -7,10 +7,10 @@ import ( "strings" "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/golang/protobuf/proto" "github.com/juju/errors" "github.com/trezor/blockbook/bchain" "golang.org/x/crypto/sha3" + "google.golang.org/protobuf/proto" ) // EthereumTypeAddressDescriptorLen - the AddressDescriptor of EthereumType has fixed length @@ -331,6 +331,24 @@ func (p *EthereumParser) PackTx(tx *bchain.Tx, height uint32, blockTime int64) ( } pt.Receipt.Log = ptLogs + if r.Receipt.L1Fee != "" { + if pt.Receipt.L1Fee, err = hexDecodeBig(r.Receipt.L1Fee); err != nil { + return nil, errors.Annotatef(err, "L1Fee %v", r.Receipt.L1Fee) + } + } + if r.Receipt.L1FeeScalar != "" { + pt.Receipt.L1FeeScalar = []byte(r.Receipt.L1FeeScalar) + } + if r.Receipt.L1GasPrice != "" { + if pt.Receipt.L1GasPrice, err = hexDecodeBig(r.Receipt.L1GasPrice); err != nil { + return nil, errors.Annotatef(err, "L1GasPrice %v", r.Receipt.L1GasPrice) + } + } + if r.Receipt.L1GasUsed != "" { + if pt.Receipt.L1GasUsed, err = hexDecodeBig(r.Receipt.L1GasUsed); err != nil { + return nil, errors.Annotatef(err, "L1GasUsed %v", r.Receipt.L1GasUsed) + } + } } return proto.Marshal(pt) } @@ -359,27 +377,37 @@ func (p *EthereumParser) UnpackTx(buf []byte) (*bchain.Tx, uint32, error) { } var rr *bchain.RpcReceipt if pt.Receipt != nil { - logs := make([]*bchain.RpcLog, len(pt.Receipt.Log)) + rr = &bchain.RpcReceipt{ + GasUsed: hexEncodeBig(pt.Receipt.GasUsed), + Status: "", + Logs: make([]*bchain.RpcLog, len(pt.Receipt.Log)), + } for i, l := range pt.Receipt.Log { topics := make([]string, len(l.Topics)) for j, t := range l.Topics { topics[j] = hexutil.Encode(t) } - logs[i] = &bchain.RpcLog{ + rr.Logs[i] = &bchain.RpcLog{ Address: EIP55Address(l.Address), Data: hexutil.Encode(l.Data), Topics: topics, } } - status := "" // handle a special value []byte{'U'} as unknown state if len(pt.Receipt.Status) != 1 || pt.Receipt.Status[0] != 'U' { - status = hexEncodeBig(pt.Receipt.Status) + rr.Status = hexEncodeBig(pt.Receipt.Status) } - rr = &bchain.RpcReceipt{ - GasUsed: hexEncodeBig(pt.Receipt.GasUsed), - Status: status, - Logs: logs, + if len(pt.Receipt.L1Fee) > 0 { + rr.L1Fee = hexEncodeBig(pt.Receipt.L1Fee) + } + if len(pt.Receipt.L1FeeScalar) > 0 { + rr.L1FeeScalar = string(pt.Receipt.L1FeeScalar) + } + if len(pt.Receipt.L1GasPrice) > 0 { + rr.L1GasPrice = hexEncodeBig(pt.Receipt.L1GasPrice) + } + if len(pt.Receipt.L1GasUsed) > 0 { + rr.L1GasUsed = hexEncodeBig(pt.Receipt.L1GasUsed) } } // TODO handle internal transactions @@ -477,12 +505,16 @@ const ( // EthereumTxData contains ethereum specific transaction data type EthereumTxData struct { - Status TxStatus `json:"status"` // 1 OK, 0 Fail, -1 pending, -2 unknown - Nonce uint64 `json:"nonce"` - GasLimit *big.Int `json:"gaslimit"` - GasUsed *big.Int `json:"gasused"` - GasPrice *big.Int `json:"gasprice"` - Data string `json:"data"` + Status TxStatus `json:"status"` // 1 OK, 0 Fail, -1 pending, -2 unknown + Nonce uint64 `json:"nonce"` + GasLimit *big.Int `json:"gaslimit"` + GasUsed *big.Int `json:"gasused"` + GasPrice *big.Int `json:"gasprice"` + L1Fee *big.Int `json:"l1Fee,omitempty"` + L1FeeScalar string `json:"l1FeeScalar,omitempty"` + L1GasPrice *big.Int `json:"l1GasPrice,omitempty"` + L1GasUsed *big.Int `json:"L1GasUsed,omitempty"` + Data string `json:"data"` } // GetEthereumTxData returns EthereumTxData from bchain.Tx @@ -511,6 +543,10 @@ func GetEthereumTxDataFromSpecificData(coinSpecificData interface{}) *EthereumTx etd.Status = TxStatusFailure } etd.GasUsed, _ = hexutil.DecodeBig(csd.Receipt.GasUsed) + etd.L1Fee, _ = hexutil.DecodeBig(csd.Receipt.L1Fee) + etd.L1GasPrice, _ = hexutil.DecodeBig(csd.Receipt.L1GasPrice) + etd.L1GasUsed, _ = hexutil.DecodeBig(csd.Receipt.L1GasUsed) + etd.L1FeeScalar = csd.Receipt.L1FeeScalar } } return &etd diff --git a/bchain/coins/eth/ethrpc.go b/bchain/coins/eth/ethrpc.go index 1405ea3b..b9eb843e 100644 --- a/bchain/coins/eth/ethrpc.go +++ b/bchain/coins/eth/ethrpc.go @@ -4,7 +4,7 @@ import ( "context" "encoding/json" "fmt" - "io/ioutil" + "io" "math/big" "net/http" "strconv" @@ -377,7 +377,7 @@ func (b *EthereumRPC) getConsensusVersion() string { glog.Error("getConsensusVersion ", err) return "" } - body, err := ioutil.ReadAll(resp.Body) + body, err := io.ReadAll(resp.Body) if err != nil { glog.Error("getConsensusVersion ", err) return "" @@ -623,6 +623,9 @@ func (b *EthereumRPC) getCreationContractInfo(contract string, height uint32) *b func (b *EthereumRPC) processCallTrace(call *rpcCallTrace, d *bchain.EthereumInternalData, contracts []bchain.ContractInfo, blockHeight uint32) []bchain.ContractInfo { value, err := hexutil.DecodeBig(call.Value) + if err != nil { + value = new(big.Int) + } if call.Type == "CREATE" || call.Type == "CREATE2" { d.Transfers = append(d.Transfers, bchain.EthereumInternalTransfer{ Type: bchain.CREATE, @@ -834,12 +837,13 @@ func (b *EthereumRPC) GetTransactionForMempool(txid string) (*bchain.Tx, error) func (b *EthereumRPC) GetTransaction(txid string) (*bchain.Tx, error) { ctx, cancel := context.WithTimeout(context.Background(), b.Timeout) defer cancel() - var tx *bchain.RpcTransaction + tx := &bchain.RpcTransaction{} hash := ethcommon.HexToHash(txid) - err := b.RPC.CallContext(ctx, &tx, "eth_getTransactionByHash", hash) + err := b.RPC.CallContext(ctx, tx, "eth_getTransactionByHash", hash) if err != nil { return nil, err - } else if tx == nil { + } + if *tx == (bchain.RpcTransaction{}) { if b.mempoolInitialized { b.Mempool.RemoveTransactionFromMempool(txid) } diff --git a/bchain/coins/eth/ethtx.pb.go b/bchain/coins/eth/ethtx.pb.go index 6023a259..0174ab9b 100644 --- a/bchain/coins/eth/ethtx.pb.go +++ b/bchain/coins/eth/ethtx.pb.go @@ -1,261 +1,530 @@ // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.21.12 // source: bchain/coins/eth/ethtx.proto -/* -Package eth is a generated protocol buffer package. - -It is generated from these files: - bchain/coins/eth/ethtx.proto - -It has these top-level messages: - ProtoCompleteTransaction -*/ package eth -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) type ProtoCompleteTransaction struct { - BlockNumber uint32 `protobuf:"varint,1,opt,name=BlockNumber" json:"BlockNumber,omitempty"` - BlockTime uint64 `protobuf:"varint,2,opt,name=BlockTime" json:"BlockTime,omitempty"` - Tx *ProtoCompleteTransaction_TxType `protobuf:"bytes,3,opt,name=Tx" json:"Tx,omitempty"` - Receipt *ProtoCompleteTransaction_ReceiptType `protobuf:"bytes,4,opt,name=Receipt" json:"Receipt,omitempty"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + BlockNumber uint32 `protobuf:"varint,1,opt,name=BlockNumber,proto3" json:"BlockNumber,omitempty"` + BlockTime uint64 `protobuf:"varint,2,opt,name=BlockTime,proto3" json:"BlockTime,omitempty"` + Tx *ProtoCompleteTransaction_TxType `protobuf:"bytes,3,opt,name=Tx,proto3" json:"Tx,omitempty"` + Receipt *ProtoCompleteTransaction_ReceiptType `protobuf:"bytes,4,opt,name=Receipt,proto3" json:"Receipt,omitempty"` } -func (m *ProtoCompleteTransaction) Reset() { *m = ProtoCompleteTransaction{} } -func (m *ProtoCompleteTransaction) String() string { return proto.CompactTextString(m) } -func (*ProtoCompleteTransaction) ProtoMessage() {} -func (*ProtoCompleteTransaction) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } +func (x *ProtoCompleteTransaction) Reset() { + *x = ProtoCompleteTransaction{} + if protoimpl.UnsafeEnabled { + mi := &file_bchain_coins_eth_ethtx_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} -func (m *ProtoCompleteTransaction) GetBlockNumber() uint32 { - if m != nil { - return m.BlockNumber +func (x *ProtoCompleteTransaction) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProtoCompleteTransaction) ProtoMessage() {} + +func (x *ProtoCompleteTransaction) ProtoReflect() protoreflect.Message { + mi := &file_bchain_coins_eth_ethtx_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ProtoCompleteTransaction.ProtoReflect.Descriptor instead. +func (*ProtoCompleteTransaction) Descriptor() ([]byte, []int) { + return file_bchain_coins_eth_ethtx_proto_rawDescGZIP(), []int{0} +} + +func (x *ProtoCompleteTransaction) GetBlockNumber() uint32 { + if x != nil { + return x.BlockNumber } return 0 } -func (m *ProtoCompleteTransaction) GetBlockTime() uint64 { - if m != nil { - return m.BlockTime +func (x *ProtoCompleteTransaction) GetBlockTime() uint64 { + if x != nil { + return x.BlockTime } return 0 } -func (m *ProtoCompleteTransaction) GetTx() *ProtoCompleteTransaction_TxType { - if m != nil { - return m.Tx +func (x *ProtoCompleteTransaction) GetTx() *ProtoCompleteTransaction_TxType { + if x != nil { + return x.Tx } return nil } -func (m *ProtoCompleteTransaction) GetReceipt() *ProtoCompleteTransaction_ReceiptType { - if m != nil { - return m.Receipt +func (x *ProtoCompleteTransaction) GetReceipt() *ProtoCompleteTransaction_ReceiptType { + if x != nil { + return x.Receipt } return nil } type ProtoCompleteTransaction_TxType struct { - AccountNonce uint64 `protobuf:"varint,1,opt,name=AccountNonce" json:"AccountNonce,omitempty"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AccountNonce uint64 `protobuf:"varint,1,opt,name=AccountNonce,proto3" json:"AccountNonce,omitempty"` GasPrice []byte `protobuf:"bytes,2,opt,name=GasPrice,proto3" json:"GasPrice,omitempty"` - GasLimit uint64 `protobuf:"varint,3,opt,name=GasLimit" json:"GasLimit,omitempty"` + GasLimit uint64 `protobuf:"varint,3,opt,name=GasLimit,proto3" json:"GasLimit,omitempty"` Value []byte `protobuf:"bytes,4,opt,name=Value,proto3" json:"Value,omitempty"` Payload []byte `protobuf:"bytes,5,opt,name=Payload,proto3" json:"Payload,omitempty"` Hash []byte `protobuf:"bytes,6,opt,name=Hash,proto3" json:"Hash,omitempty"` To []byte `protobuf:"bytes,7,opt,name=To,proto3" json:"To,omitempty"` From []byte `protobuf:"bytes,8,opt,name=From,proto3" json:"From,omitempty"` - TransactionIndex uint32 `protobuf:"varint,9,opt,name=TransactionIndex" json:"TransactionIndex,omitempty"` + TransactionIndex uint32 `protobuf:"varint,9,opt,name=TransactionIndex,proto3" json:"TransactionIndex,omitempty"` } -func (m *ProtoCompleteTransaction_TxType) Reset() { *m = ProtoCompleteTransaction_TxType{} } -func (m *ProtoCompleteTransaction_TxType) String() string { return proto.CompactTextString(m) } -func (*ProtoCompleteTransaction_TxType) ProtoMessage() {} +func (x *ProtoCompleteTransaction_TxType) Reset() { + *x = ProtoCompleteTransaction_TxType{} + if protoimpl.UnsafeEnabled { + mi := &file_bchain_coins_eth_ethtx_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ProtoCompleteTransaction_TxType) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProtoCompleteTransaction_TxType) ProtoMessage() {} + +func (x *ProtoCompleteTransaction_TxType) ProtoReflect() protoreflect.Message { + mi := &file_bchain_coins_eth_ethtx_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ProtoCompleteTransaction_TxType.ProtoReflect.Descriptor instead. func (*ProtoCompleteTransaction_TxType) Descriptor() ([]byte, []int) { - return fileDescriptor0, []int{0, 0} + return file_bchain_coins_eth_ethtx_proto_rawDescGZIP(), []int{0, 0} } -func (m *ProtoCompleteTransaction_TxType) GetAccountNonce() uint64 { - if m != nil { - return m.AccountNonce +func (x *ProtoCompleteTransaction_TxType) GetAccountNonce() uint64 { + if x != nil { + return x.AccountNonce } return 0 } -func (m *ProtoCompleteTransaction_TxType) GetGasPrice() []byte { - if m != nil { - return m.GasPrice +func (x *ProtoCompleteTransaction_TxType) GetGasPrice() []byte { + if x != nil { + return x.GasPrice } return nil } -func (m *ProtoCompleteTransaction_TxType) GetGasLimit() uint64 { - if m != nil { - return m.GasLimit +func (x *ProtoCompleteTransaction_TxType) GetGasLimit() uint64 { + if x != nil { + return x.GasLimit } return 0 } -func (m *ProtoCompleteTransaction_TxType) GetValue() []byte { - if m != nil { - return m.Value +func (x *ProtoCompleteTransaction_TxType) GetValue() []byte { + if x != nil { + return x.Value } return nil } -func (m *ProtoCompleteTransaction_TxType) GetPayload() []byte { - if m != nil { - return m.Payload +func (x *ProtoCompleteTransaction_TxType) GetPayload() []byte { + if x != nil { + return x.Payload } return nil } -func (m *ProtoCompleteTransaction_TxType) GetHash() []byte { - if m != nil { - return m.Hash +func (x *ProtoCompleteTransaction_TxType) GetHash() []byte { + if x != nil { + return x.Hash } return nil } -func (m *ProtoCompleteTransaction_TxType) GetTo() []byte { - if m != nil { - return m.To +func (x *ProtoCompleteTransaction_TxType) GetTo() []byte { + if x != nil { + return x.To } return nil } -func (m *ProtoCompleteTransaction_TxType) GetFrom() []byte { - if m != nil { - return m.From +func (x *ProtoCompleteTransaction_TxType) GetFrom() []byte { + if x != nil { + return x.From } return nil } -func (m *ProtoCompleteTransaction_TxType) GetTransactionIndex() uint32 { - if m != nil { - return m.TransactionIndex +func (x *ProtoCompleteTransaction_TxType) GetTransactionIndex() uint32 { + if x != nil { + return x.TransactionIndex } return 0 } type ProtoCompleteTransaction_ReceiptType struct { - GasUsed []byte `protobuf:"bytes,1,opt,name=GasUsed,proto3" json:"GasUsed,omitempty"` - Status []byte `protobuf:"bytes,2,opt,name=Status,proto3" json:"Status,omitempty"` - Log []*ProtoCompleteTransaction_ReceiptType_LogType `protobuf:"bytes,3,rep,name=Log" json:"Log,omitempty"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + GasUsed []byte `protobuf:"bytes,1,opt,name=GasUsed,proto3" json:"GasUsed,omitempty"` + Status []byte `protobuf:"bytes,2,opt,name=Status,proto3" json:"Status,omitempty"` + Log []*ProtoCompleteTransaction_ReceiptType_LogType `protobuf:"bytes,3,rep,name=Log,proto3" json:"Log,omitempty"` + L1Fee []byte `protobuf:"bytes,4,opt,name=L1Fee,proto3,oneof" json:"L1Fee,omitempty"` + L1FeeScalar []byte `protobuf:"bytes,5,opt,name=L1FeeScalar,proto3,oneof" json:"L1FeeScalar,omitempty"` + L1GasPrice []byte `protobuf:"bytes,6,opt,name=L1GasPrice,proto3,oneof" json:"L1GasPrice,omitempty"` + L1GasUsed []byte `protobuf:"bytes,7,opt,name=L1GasUsed,proto3,oneof" json:"L1GasUsed,omitempty"` } -func (m *ProtoCompleteTransaction_ReceiptType) Reset() { *m = ProtoCompleteTransaction_ReceiptType{} } -func (m *ProtoCompleteTransaction_ReceiptType) String() string { return proto.CompactTextString(m) } -func (*ProtoCompleteTransaction_ReceiptType) ProtoMessage() {} +func (x *ProtoCompleteTransaction_ReceiptType) Reset() { + *x = ProtoCompleteTransaction_ReceiptType{} + if protoimpl.UnsafeEnabled { + mi := &file_bchain_coins_eth_ethtx_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ProtoCompleteTransaction_ReceiptType) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProtoCompleteTransaction_ReceiptType) ProtoMessage() {} + +func (x *ProtoCompleteTransaction_ReceiptType) ProtoReflect() protoreflect.Message { + mi := &file_bchain_coins_eth_ethtx_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ProtoCompleteTransaction_ReceiptType.ProtoReflect.Descriptor instead. func (*ProtoCompleteTransaction_ReceiptType) Descriptor() ([]byte, []int) { - return fileDescriptor0, []int{0, 1} + return file_bchain_coins_eth_ethtx_proto_rawDescGZIP(), []int{0, 1} } -func (m *ProtoCompleteTransaction_ReceiptType) GetGasUsed() []byte { - if m != nil { - return m.GasUsed +func (x *ProtoCompleteTransaction_ReceiptType) GetGasUsed() []byte { + if x != nil { + return x.GasUsed } return nil } -func (m *ProtoCompleteTransaction_ReceiptType) GetStatus() []byte { - if m != nil { - return m.Status +func (x *ProtoCompleteTransaction_ReceiptType) GetStatus() []byte { + if x != nil { + return x.Status } return nil } -func (m *ProtoCompleteTransaction_ReceiptType) GetLog() []*ProtoCompleteTransaction_ReceiptType_LogType { - if m != nil { - return m.Log +func (x *ProtoCompleteTransaction_ReceiptType) GetLog() []*ProtoCompleteTransaction_ReceiptType_LogType { + if x != nil { + return x.Log + } + return nil +} + +func (x *ProtoCompleteTransaction_ReceiptType) GetL1Fee() []byte { + if x != nil { + return x.L1Fee + } + return nil +} + +func (x *ProtoCompleteTransaction_ReceiptType) GetL1FeeScalar() []byte { + if x != nil { + return x.L1FeeScalar + } + return nil +} + +func (x *ProtoCompleteTransaction_ReceiptType) GetL1GasPrice() []byte { + if x != nil { + return x.L1GasPrice + } + return nil +} + +func (x *ProtoCompleteTransaction_ReceiptType) GetL1GasUsed() []byte { + if x != nil { + return x.L1GasUsed } return nil } type ProtoCompleteTransaction_ReceiptType_LogType struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + Address []byte `protobuf:"bytes,1,opt,name=Address,proto3" json:"Address,omitempty"` Data []byte `protobuf:"bytes,2,opt,name=Data,proto3" json:"Data,omitempty"` Topics [][]byte `protobuf:"bytes,3,rep,name=Topics,proto3" json:"Topics,omitempty"` } -func (m *ProtoCompleteTransaction_ReceiptType_LogType) Reset() { - *m = ProtoCompleteTransaction_ReceiptType_LogType{} +func (x *ProtoCompleteTransaction_ReceiptType_LogType) Reset() { + *x = ProtoCompleteTransaction_ReceiptType_LogType{} + if protoimpl.UnsafeEnabled { + mi := &file_bchain_coins_eth_ethtx_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *ProtoCompleteTransaction_ReceiptType_LogType) String() string { - return proto.CompactTextString(m) + +func (x *ProtoCompleteTransaction_ReceiptType_LogType) String() string { + return protoimpl.X.MessageStringOf(x) } + func (*ProtoCompleteTransaction_ReceiptType_LogType) ProtoMessage() {} + +func (x *ProtoCompleteTransaction_ReceiptType_LogType) ProtoReflect() protoreflect.Message { + mi := &file_bchain_coins_eth_ethtx_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ProtoCompleteTransaction_ReceiptType_LogType.ProtoReflect.Descriptor instead. func (*ProtoCompleteTransaction_ReceiptType_LogType) Descriptor() ([]byte, []int) { - return fileDescriptor0, []int{0, 1, 0} + return file_bchain_coins_eth_ethtx_proto_rawDescGZIP(), []int{0, 1, 0} } -func (m *ProtoCompleteTransaction_ReceiptType_LogType) GetAddress() []byte { - if m != nil { - return m.Address +func (x *ProtoCompleteTransaction_ReceiptType_LogType) GetAddress() []byte { + if x != nil { + return x.Address } return nil } -func (m *ProtoCompleteTransaction_ReceiptType_LogType) GetData() []byte { - if m != nil { - return m.Data +func (x *ProtoCompleteTransaction_ReceiptType_LogType) GetData() []byte { + if x != nil { + return x.Data } return nil } -func (m *ProtoCompleteTransaction_ReceiptType_LogType) GetTopics() [][]byte { - if m != nil { - return m.Topics +func (x *ProtoCompleteTransaction_ReceiptType_LogType) GetTopics() [][]byte { + if x != nil { + return x.Topics } return nil } -func init() { - proto.RegisterType((*ProtoCompleteTransaction)(nil), "eth.ProtoCompleteTransaction") - proto.RegisterType((*ProtoCompleteTransaction_TxType)(nil), "eth.ProtoCompleteTransaction.TxType") - proto.RegisterType((*ProtoCompleteTransaction_ReceiptType)(nil), "eth.ProtoCompleteTransaction.ReceiptType") - proto.RegisterType((*ProtoCompleteTransaction_ReceiptType_LogType)(nil), "eth.ProtoCompleteTransaction.ReceiptType.LogType") +var File_bchain_coins_eth_ethtx_proto protoreflect.FileDescriptor + +var file_bchain_coins_eth_ethtx_proto_rawDesc = []byte{ + 0x0a, 0x1c, 0x62, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0x2f, 0x65, + 0x74, 0x68, 0x2f, 0x65, 0x74, 0x68, 0x74, 0x78, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xdd, + 0x06, 0x0a, 0x18, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, + 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x0b, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1c, 0x0a, + 0x09, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x09, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x30, 0x0a, 0x02, 0x54, + 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x43, + 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x2e, 0x54, 0x78, 0x54, 0x79, 0x70, 0x65, 0x52, 0x02, 0x54, 0x78, 0x12, 0x3f, 0x0a, + 0x07, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, + 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x72, + 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, + 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x07, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x1a, 0xf8, + 0x01, 0x0a, 0x06, 0x54, 0x78, 0x54, 0x79, 0x70, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x41, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x0c, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x1a, 0x0a, + 0x08, 0x47, 0x61, 0x73, 0x50, 0x72, 0x69, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x08, 0x47, 0x61, 0x73, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x47, 0x61, 0x73, + 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x47, 0x61, 0x73, + 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x50, + 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x50, 0x61, + 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x48, 0x61, 0x73, 0x68, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x04, 0x48, 0x61, 0x73, 0x68, 0x12, 0x0e, 0x0a, 0x02, 0x54, 0x6f, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x02, 0x54, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x46, 0x72, 0x6f, + 0x6d, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x46, 0x72, 0x6f, 0x6d, 0x12, 0x2a, 0x0a, + 0x10, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x64, 0x65, + 0x78, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x10, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x92, 0x03, 0x0a, 0x0b, 0x52, 0x65, + 0x63, 0x65, 0x69, 0x70, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x47, 0x61, 0x73, + 0x55, 0x73, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x47, 0x61, 0x73, 0x55, + 0x73, 0x65, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x3f, 0x0a, 0x03, 0x4c, + 0x6f, 0x67, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x54, 0x79, 0x70, 0x65, 0x2e, + 0x4c, 0x6f, 0x67, 0x54, 0x79, 0x70, 0x65, 0x52, 0x03, 0x4c, 0x6f, 0x67, 0x12, 0x19, 0x0a, 0x05, + 0x4c, 0x31, 0x46, 0x65, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x05, 0x4c, + 0x31, 0x46, 0x65, 0x65, 0x88, 0x01, 0x01, 0x12, 0x25, 0x0a, 0x0b, 0x4c, 0x31, 0x46, 0x65, 0x65, + 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x01, 0x52, 0x0b, + 0x4c, 0x31, 0x46, 0x65, 0x65, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x88, 0x01, 0x01, 0x12, 0x23, + 0x0a, 0x0a, 0x4c, 0x31, 0x47, 0x61, 0x73, 0x50, 0x72, 0x69, 0x63, 0x65, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x0c, 0x48, 0x02, 0x52, 0x0a, 0x4c, 0x31, 0x47, 0x61, 0x73, 0x50, 0x72, 0x69, 0x63, 0x65, + 0x88, 0x01, 0x01, 0x12, 0x21, 0x0a, 0x09, 0x4c, 0x31, 0x47, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x03, 0x52, 0x09, 0x4c, 0x31, 0x47, 0x61, 0x73, 0x55, + 0x73, 0x65, 0x64, 0x88, 0x01, 0x01, 0x1a, 0x4f, 0x0a, 0x07, 0x4c, 0x6f, 0x67, 0x54, 0x79, 0x70, + 0x65, 0x12, 0x18, 0x0a, 0x07, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x07, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x44, + 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x44, 0x61, 0x74, 0x61, 0x12, + 0x16, 0x0a, 0x06, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x52, + 0x06, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x73, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x4c, 0x31, 0x46, 0x65, + 0x65, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x4c, 0x31, 0x46, 0x65, 0x65, 0x53, 0x63, 0x61, 0x6c, 0x61, + 0x72, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x4c, 0x31, 0x47, 0x61, 0x73, 0x50, 0x72, 0x69, 0x63, 0x65, + 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x4c, 0x31, 0x47, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x42, 0x12, + 0x5a, 0x10, 0x62, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0x2f, 0x65, + 0x74, 0x68, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } -func init() { proto.RegisterFile("bchain/coins/eth/ethtx.proto", fileDescriptor0) } +var ( + file_bchain_coins_eth_ethtx_proto_rawDescOnce sync.Once + file_bchain_coins_eth_ethtx_proto_rawDescData = file_bchain_coins_eth_ethtx_proto_rawDesc +) -var fileDescriptor0 = []byte{ - // 409 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xdf, 0x8a, 0xd4, 0x30, - 0x18, 0xc5, 0xe9, 0x9f, 0x99, 0xd9, 0xfd, 0xa6, 0x8a, 0x04, 0x91, 0x30, 0xec, 0x45, 0x59, 0xbc, - 0x18, 0xbd, 0xe8, 0xe2, 0xea, 0x0b, 0xac, 0x23, 0xae, 0xc2, 0xb0, 0x0e, 0x31, 0x7a, 0x9f, 0x49, - 0xc3, 0x36, 0x38, 0x6d, 0x4a, 0x93, 0x42, 0xf7, 0x8d, 0x7c, 0x21, 0xdf, 0xc5, 0x4b, 0xc9, 0xd7, - 0x74, 0x1d, 0x11, 0x65, 0x2f, 0x0a, 0xf9, 0x9d, 0x7e, 0xa7, 0x39, 0x27, 0x29, 0x9c, 0xed, 0x65, - 0x25, 0x74, 0x73, 0x21, 0x8d, 0x6e, 0xec, 0x85, 0x72, 0x95, 0x7f, 0xdc, 0x50, 0xb4, 0x9d, 0x71, - 0x86, 0x24, 0xca, 0x55, 0xe7, 0xdf, 0x67, 0x40, 0x77, 0x1e, 0x37, 0xa6, 0x6e, 0x0f, 0xca, 0x29, - 0xde, 0x89, 0xc6, 0x0a, 0xe9, 0xb4, 0x69, 0x48, 0x0e, 0xcb, 0xb7, 0x07, 0x23, 0xbf, 0xdd, 0xf4, - 0xf5, 0x5e, 0x75, 0x34, 0xca, 0xa3, 0xf5, 0x23, 0x76, 0x2c, 0x91, 0x33, 0x38, 0x45, 0xe4, 0xba, - 0x56, 0x34, 0xce, 0xa3, 0x75, 0xca, 0x7e, 0x0b, 0xe4, 0x0d, 0xc4, 0x7c, 0xa0, 0x49, 0x1e, 0xad, - 0x97, 0x97, 0xcf, 0x0b, 0xe5, 0xaa, 0xe2, 0x5f, 0x5b, 0x15, 0x7c, 0xe0, 0x77, 0xad, 0x62, 0x31, - 0x1f, 0xc8, 0x06, 0x16, 0x4c, 0x49, 0xa5, 0x5b, 0x47, 0x53, 0xb4, 0xbe, 0xf8, 0xbf, 0x35, 0x0c, - 0xa3, 0x7f, 0x72, 0xae, 0x7e, 0x46, 0x30, 0x1f, 0xbf, 0x49, 0xce, 0x21, 0xbb, 0x92, 0xd2, 0xf4, - 0x8d, 0xbb, 0x31, 0x8d, 0x54, 0x58, 0x23, 0x65, 0x7f, 0x68, 0x64, 0x05, 0x27, 0xd7, 0xc2, 0xee, - 0x3a, 0x2d, 0xc7, 0x1a, 0x19, 0xbb, 0xe7, 0xf0, 0x6e, 0xab, 0x6b, 0xed, 0xb0, 0x4b, 0xca, 0xee, - 0x99, 0x3c, 0x85, 0xd9, 0x57, 0x71, 0xe8, 0x15, 0x26, 0xcd, 0xd8, 0x08, 0x84, 0xc2, 0x62, 0x27, - 0xee, 0x0e, 0x46, 0x94, 0x74, 0x86, 0xfa, 0x84, 0x84, 0x40, 0xfa, 0x41, 0xd8, 0x8a, 0xce, 0x51, - 0xc6, 0x35, 0x79, 0x0c, 0x31, 0x37, 0x74, 0x81, 0x4a, 0xcc, 0x8d, 0x9f, 0x79, 0xdf, 0x99, 0x9a, - 0x9e, 0x8c, 0x33, 0x7e, 0x4d, 0x5e, 0xc2, 0x93, 0xa3, 0xca, 0x1f, 0x9b, 0x52, 0x0d, 0xf4, 0x14, - 0xaf, 0xe3, 0x2f, 0x7d, 0xf5, 0x23, 0x82, 0xe5, 0xd1, 0x99, 0xf8, 0x34, 0xd7, 0xc2, 0x7e, 0xb1, - 0xaa, 0xc4, 0xea, 0x19, 0x9b, 0x90, 0x3c, 0x83, 0xf9, 0x67, 0x27, 0x5c, 0x6f, 0x43, 0xe7, 0x40, - 0x64, 0x03, 0xc9, 0xd6, 0xdc, 0xd2, 0x24, 0x4f, 0xd6, 0xcb, 0xcb, 0x57, 0x0f, 0x3e, 0xfd, 0x62, - 0x6b, 0x6e, 0xf1, 0x16, 0xbc, 0x7b, 0xf5, 0x09, 0x16, 0x81, 0x7d, 0x82, 0xab, 0xb2, 0xec, 0x94, - 0xb5, 0x53, 0x82, 0x80, 0xbe, 0xeb, 0x3b, 0xe1, 0x44, 0xd8, 0x1f, 0xd7, 0x3e, 0x15, 0x37, 0xad, - 0x96, 0x16, 0x03, 0x64, 0x2c, 0xd0, 0x7e, 0x8e, 0xbf, 0xed, 0xeb, 0x5f, 0x01, 0x00, 0x00, 0xff, - 0xff, 0xc2, 0x69, 0x8d, 0xdf, 0xd6, 0x02, 0x00, 0x00, +func file_bchain_coins_eth_ethtx_proto_rawDescGZIP() []byte { + file_bchain_coins_eth_ethtx_proto_rawDescOnce.Do(func() { + file_bchain_coins_eth_ethtx_proto_rawDescData = protoimpl.X.CompressGZIP(file_bchain_coins_eth_ethtx_proto_rawDescData) + }) + return file_bchain_coins_eth_ethtx_proto_rawDescData +} + +var file_bchain_coins_eth_ethtx_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_bchain_coins_eth_ethtx_proto_goTypes = []interface{}{ + (*ProtoCompleteTransaction)(nil), // 0: ProtoCompleteTransaction + (*ProtoCompleteTransaction_TxType)(nil), // 1: ProtoCompleteTransaction.TxType + (*ProtoCompleteTransaction_ReceiptType)(nil), // 2: ProtoCompleteTransaction.ReceiptType + (*ProtoCompleteTransaction_ReceiptType_LogType)(nil), // 3: ProtoCompleteTransaction.ReceiptType.LogType +} +var file_bchain_coins_eth_ethtx_proto_depIdxs = []int32{ + 1, // 0: ProtoCompleteTransaction.Tx:type_name -> ProtoCompleteTransaction.TxType + 2, // 1: ProtoCompleteTransaction.Receipt:type_name -> ProtoCompleteTransaction.ReceiptType + 3, // 2: ProtoCompleteTransaction.ReceiptType.Log:type_name -> ProtoCompleteTransaction.ReceiptType.LogType + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_bchain_coins_eth_ethtx_proto_init() } +func file_bchain_coins_eth_ethtx_proto_init() { + if File_bchain_coins_eth_ethtx_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_bchain_coins_eth_ethtx_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ProtoCompleteTransaction); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_bchain_coins_eth_ethtx_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ProtoCompleteTransaction_TxType); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_bchain_coins_eth_ethtx_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ProtoCompleteTransaction_ReceiptType); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_bchain_coins_eth_ethtx_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ProtoCompleteTransaction_ReceiptType_LogType); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_bchain_coins_eth_ethtx_proto_msgTypes[2].OneofWrappers = []interface{}{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_bchain_coins_eth_ethtx_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_bchain_coins_eth_ethtx_proto_goTypes, + DependencyIndexes: file_bchain_coins_eth_ethtx_proto_depIdxs, + MessageInfos: file_bchain_coins_eth_ethtx_proto_msgTypes, + }.Build() + File_bchain_coins_eth_ethtx_proto = out.File + file_bchain_coins_eth_ethtx_proto_rawDesc = nil + file_bchain_coins_eth_ethtx_proto_goTypes = nil + file_bchain_coins_eth_ethtx_proto_depIdxs = nil } diff --git a/bchain/coins/eth/ethtx.proto b/bchain/coins/eth/ethtx.proto index ef7c4ce0..f53e0e39 100644 --- a/bchain/coins/eth/ethtx.proto +++ b/bchain/coins/eth/ethtx.proto @@ -1,30 +1,34 @@ syntax = "proto3"; - package eth; - - message ProtoCompleteTransaction { - message TxType { - uint64 AccountNonce = 1; - bytes GasPrice = 2; - uint64 GasLimit = 3; - bytes Value = 4; - bytes Payload = 5; - bytes Hash = 6; - bytes To = 7; - bytes From = 8; - uint32 TransactionIndex = 9; - } - message ReceiptType { - message LogType { - bytes Address = 1; - bytes Data = 2; - repeated bytes Topics = 3; - } - bytes GasUsed = 1; - bytes Status = 2; - repeated LogType Log = 3; - } - uint32 BlockNumber = 1; - uint64 BlockTime = 2; - TxType Tx = 3; - ReceiptType Receipt = 4; - } \ No newline at end of file +option go_package = "bchain/coins/eth"; + +message ProtoCompleteTransaction { + message TxType { + uint64 AccountNonce = 1; + bytes GasPrice = 2; + uint64 GasLimit = 3; + bytes Value = 4; + bytes Payload = 5; + bytes Hash = 6; + bytes To = 7; + bytes From = 8; + uint32 TransactionIndex = 9; + } + message ReceiptType { + message LogType { + bytes Address = 1; + bytes Data = 2; + repeated bytes Topics = 3; + } + bytes GasUsed = 1; + bytes Status = 2; + repeated LogType Log = 3; + optional bytes L1Fee = 4; + optional bytes L1FeeScalar = 5; + optional bytes L1GasPrice = 6; + optional bytes L1GasUsed = 7; + } + uint32 BlockNumber = 1; + uint64 BlockTime = 2; + TxType Tx = 3; + ReceiptType Receipt = 4; +} \ No newline at end of file diff --git a/bchain/coins/optimism/evm.go b/bchain/coins/optimism/evm.go new file mode 100644 index 00000000..e1f7e51e --- /dev/null +++ b/bchain/coins/optimism/evm.go @@ -0,0 +1,45 @@ +package optimism + +import ( + "context" + + "github.com/ethereum/go-ethereum/rpc" + "github.com/trezor/blockbook/bchain" +) + +// OptimismRPCClient wraps an rpc client to implement the EVMRPCClient interface +type OptimismRPCClient struct { + *rpc.Client +} + +// EthSubscribe subscribes to events and returns a client subscription that implements the EVMClientSubscription interface +func (c *OptimismRPCClient) EthSubscribe(ctx context.Context, channel interface{}, args ...interface{}) (bchain.EVMClientSubscription, error) { + sub, err := c.Client.EthSubscribe(ctx, channel, args...) + if err != nil { + return nil, err + } + + return &OptimismClientSubscription{ClientSubscription: sub}, nil +} + +// CallContext performs a JSON-RPC call with the given arguments +func (c *OptimismRPCClient) CallContext(ctx context.Context, result interface{}, method string, args ...interface{}) error { + if err := c.Client.CallContext(ctx, result, method, args...); err != nil { + return err + } + + // special case to handle empty gas price for a valid rpc transaction + // (https://goerli-optimism.etherscan.io/tx/0x9b62094073147508471e3371920b68070979beea32100acdc49c721350b69cb9) + if r, ok := result.(*bchain.RpcTransaction); ok { + if *r != (bchain.RpcTransaction{}) && r.GasPrice == "" { + r.GasPrice = "0x0" + } + } + + return nil +} + +// OptimismClientSubscription wraps a client subcription to implement the EVMClientSubscription interface +type OptimismClientSubscription struct { + *rpc.ClientSubscription +} diff --git a/bchain/coins/optimism/optimismrpc.go b/bchain/coins/optimism/optimismrpc.go new file mode 100644 index 00000000..11c7d051 --- /dev/null +++ b/bchain/coins/optimism/optimismrpc.go @@ -0,0 +1,83 @@ +package optimism + +import ( + "context" + "encoding/json" + + "github.com/ethereum/go-ethereum/ethclient" + "github.com/ethereum/go-ethereum/rpc" + "github.com/golang/glog" + "github.com/juju/errors" + "github.com/trezor/blockbook/bchain" + "github.com/trezor/blockbook/bchain/coins/eth" +) + +const ( + // MainNet is production network + MainNet eth.Network = 10 +) + +// OptimismRPC is an interface to JSON-RPC optimism service. +type OptimismRPC struct { + *eth.EthereumRPC +} + +// NewOptimismRPC returns new OptimismRPC instance. +func NewOptimismRPC(config json.RawMessage, pushHandler func(bchain.NotificationType)) (bchain.BlockChain, error) { + c, err := eth.NewEthereumRPC(config, pushHandler) + if err != nil { + return nil, err + } + + s := &OptimismRPC{ + EthereumRPC: c.(*eth.EthereumRPC), + } + + return s, nil +} + +// Initialize bnb smart chain rpc interface +func (b *OptimismRPC) Initialize() error { + b.OpenRPC = func(url string) (bchain.EVMRPCClient, bchain.EVMClient, error) { + r, err := rpc.Dial(url) + if err != nil { + return nil, nil, err + } + rc := &OptimismRPCClient{Client: r} + ec := ð.EthereumClient{Client: ethclient.NewClient(r)} + return rc, ec, nil + } + + rc, ec, err := b.OpenRPC(b.ChainConfig.RPCURL) + if err != nil { + return err + } + + // set chain specific + b.Client = ec + b.RPC = rc + b.MainNetChainID = MainNet + b.NewBlock = eth.NewEthereumNewBlock() + b.NewTx = eth.NewEthereumNewTx() + + ctx, cancel := context.WithTimeout(context.Background(), b.Timeout) + defer cancel() + + id, err := b.Client.NetworkID(ctx) + if err != nil { + return err + } + + // parameters for getInfo request + switch eth.Network(id.Uint64()) { + case MainNet: + b.Testnet = false + b.Network = "livenet" + default: + return errors.Errorf("Unknown network id %v", id) + } + + glog.Info("rpc: block chain ", b.Network) + + return nil +} diff --git a/bchain/types_ethereum_type.go b/bchain/types_ethereum_type.go index 6ee54c2f..652a9edd 100644 --- a/bchain/types_ethereum_type.go +++ b/bchain/types_ethereum_type.go @@ -122,9 +122,13 @@ type RpcLog struct { // RpcLog is returned by eth_getTransactionReceipt type RpcReceipt struct { - GasUsed string `json:"gasUsed"` - Status string `json:"status"` - Logs []*RpcLog `json:"logs"` + GasUsed string `json:"gasUsed"` + Status string `json:"status"` + Logs []*RpcLog `json:"logs"` + L1Fee string `json:"l1Fee,omitempty"` + L1FeeScalar string `json:"l1FeeScalar,omitempty"` + L1GasPrice string `json:"l1GasPrice,omitempty"` + L1GasUsed string `json:"l1GasUsed,omitempty"` } // EthereumSpecificData contains data specific to Ethereum transactions diff --git a/build/docker/deb/Dockerfile b/build/docker/deb/Dockerfile index 55989099..b6632379 100644 --- a/build/docker/deb/Dockerfile +++ b/build/docker/deb/Dockerfile @@ -6,7 +6,7 @@ ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update && \ apt-get upgrade -y && \ - apt-get install -y devscripts debhelper make dh-exec && \ + apt-get install -y devscripts debhelper make dh-exec zstd && \ apt-get clean ADD gpg-keys /tmp/gpg-keys diff --git a/build/templates/backend/scripts/optimism.sh b/build/templates/backend/scripts/optimism.sh new file mode 100644 index 00000000..faccfe80 --- /dev/null +++ b/build/templates/backend/scripts/optimism.sh @@ -0,0 +1,44 @@ +#!/bin/sh + +{{define "main" -}} + +set -e + +GETH_BIN={{.Env.BackendInstallPath}}/{{.Coin.Alias}}/geth +DATA_DIR={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend + +CHAINDATA_DIR=$DATA_DIR/geth/chaindata +SNAPSHOT=https://r2-snapshots.fastnode.io/op/$(curl -s https://r2-snapshots.fastnode.io/op/latest-mainnet) + +if [ ! -d "$CHAINDATA_DIR" ]; then + wget -c $SNAPSHOT -O - | lz4 -cd | tar xf - -C $DATA_DIR +fi + +$GETH_BIN \ + --op-network op-mainnet \ + --datadir $DATA_DIR \ + --authrpc.jwtsecret $DATA_DIR/jwtsecret \ + --authrpc.addr 127.0.0.1 \ + --authrpc.port {{.Ports.BackendAuthRpc}} \ + --authrpc.vhosts "*" \ + --port {{.Ports.BackendP2P}} \ + --http \ + --http.port {{.Ports.BackendHttp}} \ + --http.addr 127.0.0.1 \ + --http.api eth,net,web3,debug,txpool,engine \ + --http.vhosts "*" \ + --http.corsdomain "*" \ + --ws \ + --ws.port {{.Ports.BackendRPC}} \ + --ws.addr 127.0.0.1 \ + --ws.api eth,net,web3,debug,txpool,engine \ + --ws.origins "*" \ + --rollup.disabletxpoolgossip=true \ + --rollup.sequencerhttp https://mainnet-sequencer.optimism.io \ + --txlookuplimit 0 \ + --cache 4096 \ + --syncmode full \ + --maxpeers 0 \ + --nodiscover + +{{end}} diff --git a/build/templates/backend/scripts/optimism_archive.sh b/build/templates/backend/scripts/optimism_archive.sh new file mode 100644 index 00000000..286e1a00 --- /dev/null +++ b/build/templates/backend/scripts/optimism_archive.sh @@ -0,0 +1,48 @@ +#!/bin/sh + +{{define "main" -}} + +set -e + +GETH_BIN={{.Env.BackendInstallPath}}/{{.Coin.Alias}}/geth +DATA_DIR={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend + +CHAINDATA_DIR=$DATA_DIR/geth/chaindata +SNAPSHOT=https://datadirs.optimism.io/latest + +if [ ! -d "$CHAINDATA_DIR" ]; then + wget -c $SNAPSHOT -O - | zstd -cd | tar xf - -C $DATA_DIR +fi + +$GETH_BIN \ + --op-network op-mainnet \ + --datadir $DATA_DIR \ + --authrpc.jwtsecret $DATA_DIR/jwtsecret \ + --authrpc.addr 127.0.0.1 \ + --authrpc.port {{.Ports.BackendAuthRpc}} \ + --authrpc.vhosts "*" \ + --port {{.Ports.BackendP2P}} \ + --http \ + --http.port {{.Ports.BackendHttp}} \ + --http.addr 127.0.0.1 \ + --http.api eth,net,web3,debug,txpool,engine \ + --http.vhosts "*" \ + --http.corsdomain "*" \ + --ws \ + --ws.port {{.Ports.BackendRPC}} \ + --ws.addr 127.0.0.1 \ + --ws.api eth,net,web3,debug,txpool,engine \ + --ws.origins "*" \ + --rollup.disabletxpoolgossip=true \ + --rollup.historicalrpc http://127.0.0.1:8304 \ + --rollup.sequencerhttp https://mainnet.sequencer.optimism.io \ + --cache 4096 \ + --cache.gc 0 \ + --cache.trie 30 \ + --cache.snapshot 20 \ + --syncmode full \ + --gcmode archive \ + --maxpeers 0 \ + --nodiscover + +{{end}} diff --git a/build/templates/backend/scripts/optimism_archive_legacy_geth.sh b/build/templates/backend/scripts/optimism_archive_legacy_geth.sh new file mode 100644 index 00000000..641da1fe --- /dev/null +++ b/build/templates/backend/scripts/optimism_archive_legacy_geth.sh @@ -0,0 +1,40 @@ +#!/bin/sh + +{{define "main" -}} + +set -e + +export USING_OVM=true +export ETH1_SYNC_SERVICE_ENABLE=false + +GETH_BIN={{.Env.BackendInstallPath}}/{{.Coin.Alias}}/geth +DATA_DIR={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend + +CHAINDATA_DIR=$DATA_DIR/geth/chaindata +SNAPSHOT=https://datadirs.optimism.io/mainnet-legacy-archival.tar.zst + +if [ ! -d "$CHAINDATA_DIR" ]; then + wget -c $SNAPSHOT -O - | zstd -cd | tar xf - -C $DATA_DIR +fi + +$GETH_BIN \ + --networkid 10 \ + --datadir $DATA_DIR \ + --port {{.Ports.BackendP2P}} \ + --rpc \ + --rpcport {{.Ports.BackendHttp}} \ + --rpcaddr 127.0.0.1 \ + --rpcapi eth,rollup,net,web3,debug \ + --rpcvhosts "*" \ + --rpccorsdomain "*" \ + --ws \ + --wsport {{.Ports.BackendRPC}} \ + --wsaddr 0.0.0.0 \ + --wsapi eth,rollup,net,web3,debug \ + --wsorigins "*" \ + --nousb \ + --ipcdisable \ + --nat=none \ + --nodiscover + +{{end}} \ No newline at end of file diff --git a/configs/coins/optimism.json b/configs/coins/optimism.json new file mode 100644 index 00000000..08870305 --- /dev/null +++ b/configs/coins/optimism.json @@ -0,0 +1,66 @@ +{ + "coin": { + "name": "Optimism", + "shortcut": "ETH", + "label": "Optimism", + "alias": "optimism" + }, + "ports": { + "backend_rpc": 8200, + "backend_p2p": 38400, + "backend_http": 8300, + "backend_authrpc": 8400, + "blockbook_internal": 9200, + "blockbook_public": 9300 + }, + "ipc": { + "rpc_url_template": "ws://127.0.0.1:{{.Ports.BackendRPC}}", + "rpc_timeout": 25 + }, + "backend": { + "package_name": "backend-optimism", + "package_revision": "satoshilabs-1", + "system_user": "optimism", + "version": "1.101315.1", + "binary_url": "https://github.com/ethereum-optimism/op-geth/archive/refs/tags/v1.101315.1.tar.gz", + "verification_type": "sha256", + "verification_source": "f0f31ef2982f87f9e3eb90f2b603f5fcd9d680e487d35f5bdcf5aeba290b153f", + "extract_command": "mkdir backend/source && tar -C backend/source --strip 1 -xf", + "exclude_files": [], + "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/optimism_exec.sh 2>> {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", + "exec_script": "optimism.sh", + "logrotate_files_template": "{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log", + "postinst_script_template": "cd {{.Env.BackendInstallPath}}/{{.Coin.Alias}}/source && make geth && mv build/bin/geth {{.Env.BackendInstallPath}}/{{.Coin.Alias}} && rm -rf {{.Env.BackendInstallPath}}/{{.Coin.Alias}}/source && openssl rand -hex 32 > {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/jwtsecret", + "service_type": "simple", + "service_additional_params_template": "", + "protect_memory": true, + "mainnet": true, + "server_config_file": "", + "client_config_file": "" + }, + "blockbook": { + "package_name": "blockbook-optimism", + "system_user": "blockbook-optimism", + "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, + "additional_params": { + "mempoolTxTimeoutHours": 48, + "queryBackendOnMempoolResync": false, + "fiat_rates": "coingecko", + "fiat_rates_vs_currencies": "AED,ARS,AUD,BDT,BHD,BMD,BRL,CAD,CHF,CLP,CNY,CZK,DKK,EUR,GBP,HKD,HUF,IDR,ILS,INR,JPY,KRW,KWD,LKR,MMK,MXN,MYR,NGN,NOK,NZD,PHP,PKR,PLN,RUB,SAR,SEK,SGD,THB,TRY,TWD,UAH,USD,VEF,VND,ZAR,BTC,ETH", + "fiat_rates_params": "{\"url\": \"https://api.coingecko.com/api/v3\", \"coin\": \"ethereum\",\"platformIdentifier\": \"ethereum\",\"platformVsCurrency\": \"eth\",\"periodSeconds\": 900}" + } + } + }, + "meta": { + "package_maintainer": "IT", + "package_maintainer_email": "it@satoshilabs.com" + } +} \ No newline at end of file diff --git a/configs/coins/optimism_archive.json b/configs/coins/optimism_archive.json new file mode 100644 index 00000000..21ba9f72 --- /dev/null +++ b/configs/coins/optimism_archive.json @@ -0,0 +1,69 @@ +{ + "coin": { + "name": "Optimism Archive", + "shortcut": "ETH", + "label": "Optimism", + "alias": "optimism_archive" + }, + "ports": { + "backend_rpc": 8202, + "backend_p2p": 38402, + "backend_http": 8302, + "backend_authrpc": 8402, + "blockbook_internal": 9202, + "blockbook_public": 9302 + }, + "ipc": { + "rpc_url_template": "ws://127.0.0.1:{{.Ports.BackendRPC}}", + "rpc_timeout": 25 + }, + "backend": { + "package_name": "backend-optimism-archive", + "package_revision": "satoshilabs-1", + "system_user": "optimism", + "version": "1.101315.1", + "binary_url": "https://github.com/ethereum-optimism/op-geth/archive/refs/tags/v1.101315.1.tar.gz", + "verification_type": "sha256", + "verification_source": "f0f31ef2982f87f9e3eb90f2b603f5fcd9d680e487d35f5bdcf5aeba290b153f", + "extract_command": "mkdir backend/source && tar -C backend/source --strip 1 -xf", + "exclude_files": [], + "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/optimism_archive_exec.sh 2>> {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", + "exec_script": "optimism_archive.sh", + "logrotate_files_template": "{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log", + "postinst_script_template": "cd {{.Env.BackendInstallPath}}/{{.Coin.Alias}}/source && make geth && mv build/bin/geth {{.Env.BackendInstallPath}}/{{.Coin.Alias}} && rm -rf {{.Env.BackendInstallPath}}/{{.Coin.Alias}}/source && openssl rand -hex 32 > {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/jwtsecret", + "service_type": "simple", + "service_additional_params_template": "", + "protect_memory": true, + "mainnet": true, + "server_config_file": "", + "client_config_file": "" + }, + "blockbook": { + "package_name": "blockbook-optimism-archive", + "system_user": "blockbook-optimism", + "internal_binding_template": ":{{.Ports.BlockbookInternal}}", + "public_binding_template": ":{{.Ports.BlockbookPublic}}", + "explorer_url": "", + "additional_params": "-workers=16", + "block_chain": { + "parse": true, + "mempool_workers": 8, + "mempool_sub_workers": 2, + "block_addresses_to_keep": 600, + "additional_params": { + "address_aliases": true, + "mempoolTxTimeoutHours": 48, + "processInternalTransactions": true, + "queryBackendOnMempoolResync": false, + "fiat_rates": "coingecko", + "fiat_rates_vs_currencies": "AED,ARS,AUD,BDT,BHD,BMD,BRL,CAD,CHF,CLP,CNY,CZK,DKK,EUR,GBP,HKD,HUF,IDR,ILS,INR,JPY,KRW,KWD,LKR,MMK,MXN,MYR,NGN,NOK,NZD,PHP,PKR,PLN,RUB,SAR,SEK,SGD,THB,TRY,TWD,UAH,USD,VEF,VND,ZAR,BTC,ETH", + "fiat_rates_params": "{\"url\": \"https://api.coingecko.com/api/v3\", \"coin\": \"ethereum\",\"platformIdentifier\": \"ethereum\",\"platformVsCurrency\": \"eth\",\"periodSeconds\": 900}", + "fourByteSignatures": "https://www.4byte.directory/api/v1/signatures/" + } + } + }, + "meta": { + "package_maintainer": "IT", + "package_maintainer_email": "it@satoshilabs.com" + } +} \ No newline at end of file diff --git a/configs/coins/optimism_archive_legacy_geth.json b/configs/coins/optimism_archive_legacy_geth.json new file mode 100644 index 00000000..7a9379d9 --- /dev/null +++ b/configs/coins/optimism_archive_legacy_geth.json @@ -0,0 +1,40 @@ +{ + "coin": { + "name": "Optimism Archive Legacy Geth", + "shortcut": "ETH", + "label": "Optimism", + "alias": "optimism_archive_legacy_geth" + }, + "ports": { + "backend_rpc": 8204, + "backend_http": 8304, + "backend_p2p": 38404, + "blockbook_internal": 9204, + "blockbook_public": 9304 + }, + "backend": { + "package_name": "backend-optimism-archive-legacy-geth", + "package_revision": "satoshilabs-1", + "system_user": "optimism", + "version": "0.5.31", + "binary_url": "https://github.com/ethereum-optimism/optimism-legacy/archive/refs/heads/develop.zip", + "verification_type": "sha256", + "verification_source": "367b32b3f4c1450a57fa57650a0abdfb74ae58c09123d94b161aaec90fd6b883", + "extract_command": "mkdir backend/source && unzip -d backend/source", + "exclude_files": [], + "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/optimism_archive_legacy_geth_exec.sh 2>> {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", + "exec_script": "optimism_archive_legacy_geth.sh", + "logrotate_files_template": "{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log", + "postinst_script_template": "cd {{.Env.BackendInstallPath}}/{{.Coin.Alias}}/source/optimism-legacy-devlop/l2geth && make geth && mv build/bin/geth {{.Env.BackendInstallPath}}/{{.Coin.Alias}} && rm -rf {{.Env.BackendInstallPath}}/{{.Coin.Alias}}/source", + "service_type": "simple", + "service_additional_params_template": "", + "protect_memory": true, + "mainnet": true, + "server_config_file": "", + "client_config_file": "" + }, + "meta": { + "package_maintainer": "IT", + "package_maintainer_email": "it@satoshilabs.com" + } +} \ No newline at end of file diff --git a/configs/coins/optimism_archive_op_node.json b/configs/coins/optimism_archive_op_node.json new file mode 100644 index 00000000..9c6f77fc --- /dev/null +++ b/configs/coins/optimism_archive_op_node.json @@ -0,0 +1,37 @@ +{ + "coin": { + "name": "Optimism Archive Op-Node", + "shortcut": "ETH", + "label": "Optimism", + "alias": "optimism_archive_op_node" + }, + "ports": { + "backend_rpc": 8203, + "blockbook_internal": 9203, + "blockbook_public": 9303 + }, + "backend": { + "package_name": "backend-optimism-archive-op-node", + "package_revision": "satoshilabs-1", + "system_user": "optimism", + "version": "1.7.6", + "binary_url": "https://github.com/ethereum-optimism/optimism/archive/refs/tags/op-node/v1.7.6.tar.gz", + "verification_type": "sha256", + "verification_source": "91384e4834f0d0776d1c3e19613b5c50a904f6e5814349e444d42d9e8be5a7ab", + "extract_command": "mkdir backend/source && tar -C backend/source --strip 1 -xf", + "exclude_files": [], + "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/op-node --network mainnet --l1 http://127.0.0.1:8116 --l1.beacon http://127.0.0.1:7516 --l1.trustrpc --l1.rpckind=debug_geth --l2 http://127.0.0.1:8402 --rpc.addr 127.0.0.1 --rpc.port {{.Ports.BackendRPC}} --l2.jwt-secret {{.Env.BackendDataPath}}/optimism_archive/backend/jwtsecret 2>&1>> {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", + "logrotate_files_template": "{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log", + "postinst_script_template": "cd {{.Env.BackendInstallPath}}/{{.Coin.Alias}}/source/op-node && go build -o {{.Env.BackendInstallPath}}/{{.Coin.Alias}}/op-node ./cmd && rm -rf {{.Env.BackendInstallPath}}/{{.Coin.Alias}}/source", + "service_type": "simple", + "service_additional_params_template": "", + "protect_memory": true, + "mainnet": true, + "server_config_file": "", + "client_config_file": "" + }, + "meta": { + "package_maintainer": "IT", + "package_maintainer_email": "it@satoshilabs.com" + } +} \ No newline at end of file diff --git a/configs/coins/optimism_op_node.json b/configs/coins/optimism_op_node.json new file mode 100644 index 00000000..840aab8d --- /dev/null +++ b/configs/coins/optimism_op_node.json @@ -0,0 +1,37 @@ +{ + "coin": { + "name": "Optimism Op-Node", + "shortcut": "ETH", + "label": "Optimism", + "alias": "optimism_op_node" + }, + "ports": { + "backend_rpc": 8201, + "blockbook_internal": 9201, + "blockbook_public": 9301 + }, + "backend": { + "package_name": "backend-optimism-op-node", + "package_revision": "satoshilabs-1", + "system_user": "optimism", + "version": "1.7.6", + "binary_url": "https://github.com/ethereum-optimism/optimism/archive/refs/tags/op-node/v1.7.6.tar.gz", + "verification_type": "sha256", + "verification_source": "91384e4834f0d0776d1c3e19613b5c50a904f6e5814349e444d42d9e8be5a7ab", + "extract_command": "mkdir backend/source && tar -C backend/source --strip 1 -xf", + "exclude_files": [], + "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/op-node --network op-mainnet --l1 http://127.0.0.1:8136 --l1.beacon http://127.0.0.1:7536 --l1.trustrpc --l1.rpckind=debug_geth --l2 http://127.0.0.1:8400 --rpc.addr 127.0.0.1 --rpc.port {{.Ports.BackendRPC}} --l2.jwt-secret {{.Env.BackendDataPath}}/optimism/backend/jwtsecret 2>&1>> {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", + "logrotate_files_template": "{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log", + "postinst_script_template": "cd {{.Env.BackendInstallPath}}/{{.Coin.Alias}}/source/op-node && go build -o {{.Env.BackendInstallPath}}/{{.Coin.Alias}}/op-node ./cmd && rm -rf {{.Env.BackendInstallPath}}/{{.Coin.Alias}}/source", + "service_type": "simple", + "service_additional_params_template": "", + "protect_memory": true, + "mainnet": true, + "server_config_file": "", + "client_config_file": "" + }, + "meta": { + "package_maintainer": "IT", + "package_maintainer_email": "it@satoshilabs.com" + } +} \ No newline at end of file diff --git a/docs/ports.md b/docs/ports.md index 212d4ace..b18bfb46 100644 --- a/docs/ports.md +++ b/docs/ports.md @@ -1,82 +1,84 @@ # Registry of ports -| coin | blockbook public | blockbook internal | backend rpc | backend service ports (zmq) | -|----------------------------------|------------------|--------------------|-------------|--------------------------------------| -| Ethereum Archive | 9116 | 9016 | 8016 | 38316 p2p, 8116 http, 8516 authrpc | -| Bitcoin | 9130 | 9030 | 8030 | 38330 | -| Bitcoin Cash | 9131 | 9031 | 8031 | 38331 | -| Zcash | 9132 | 9032 | 8032 | 38332 | -| Dash | 9133 | 9033 | 8033 | 38333 | -| Litecoin | 9134 | 9034 | 8034 | 38334 | -| Bitcoin Gold | 9135 | 9035 | 8035 | 38335 | -| Ethereum | 9136 | 9036 | 8036 | 38336 p2p, 8136 http, 8536 authrpc | -| Ethereum Classic | 9137 | 9037 | 8037 | 38337 p2p, 8137 http | -| Dogecoin | 9138 | 9038 | 8038 | 38338 | -| Namecoin | 9139 | 9039 | 8039 | 38339 | -| Vertcoin | 9140 | 9040 | 8040 | 38340 | -| Monacoin | 9141 | 9041 | 8041 | 38341 | -| DigiByte | 9142 | 9042 | 8042 | 38342 | -| Myriad | 9143 | 9043 | 8043 | 38343 | -| GameCredits | 9144 | 9044 | 8044 | 38344 | -| Groestlcoin | 9145 | 9045 | 8045 | 38345 | -| Bitcoin Cash SV | 9146 | 9046 | 8046 | 38346 | -| Liquid | 9147 | 9047 | 8047 | 38347 | -| Fujicoin | 9148 | 9048 | 8048 | 38348 | -| PIVX | 9149 | 9049 | 8049 | 38349 | -| Firo | 9150 | 9050 | 8050 | 38350 | -| Koto | 9151 | 9051 | 8051 | 38351 | -| Bellcoin | 9152 | 9052 | 8052 | 38352 | -| NULS | 9153 | 9053 | 8053 | 38353 | -| Bitcore | 9154 | 9054 | 8054 | 38354 | -| Viacoin | 9155 | 9055 | 8055 | 38355 | -| VIPSTARCOIN | 9156 | 9056 | 8056 | 38356 | -| MonetaryUnit | 9157 | 9057 | 8057 | 38357 | -| Flux | 9158 | 9058 | 8058 | 38358 | -| Ravencoin | 9159 | 9059 | 8059 | 38359 | -| Ritocoin | 9160 | 9060 | 8060 | 38360 | -| Decred | 9161 | 9061 | 8061 | 38361 | -| SnowGem | 9162 | 9062 | 8062 | 38362 | -| BNB Smart Chain | 9164 | 9064 | 8064 | 38364 p2p, 8164 http | -| BNB Smart Chain Archive | 9165 | 9065 | 8065 | 38365 p2p, 8165 http | -| Flo | 9166 | 9066 | 8066 | 38366 | -| Polis | 9167 | 9067 | 8067 | 38367 | -| Polygon | 9170 | 9070 | 8070 | 38370 p2p, 8170 http | -| Polygon Archive | 9172 | 9072 | 8072 | 38372 p2p, 8172 http | -| Qtum | 9188 | 9088 | 8088 | 38388 | -| Divi Project | 9189 | 9089 | 8089 | 38389 | -| CPUchain | 9190 | 9090 | 8090 | 38390 | -| DeepOnion | 9191 | 9091 | 8091 | 38391 | -| Unobtanium | 9192 | 9092 | 65535 | 38392 | -| Omotenashicoin | 9194 | 9094 | 8094 | 38394 | -| BitZeny | 9195 | 9095 | 8095 | 38395 | -| Trezarcoin | 9196 | 9096 | 8096 | 38396 | -| eCash | 9197 | 9097 | 8097 | 38397 | -| Avalanche | 9198 | 9098 | 8098 | 38398 p2p | -| Avalanche Archive | 9199 | 9099 | 8099 | 38399 p2p | -| Ethereum Testnet Holesky | 19116 | 19016 | 18016 | 18116 http, 18516 authrpc, 48316 p2p | -| Bitcoin Signet | 19120 | 19020 | 18020 | 48320 | -| Bitcoin Regtest | 19121 | 19021 | 18021 | 48321 | -| Bitcoin Testnet | 19130 | 19030 | 18030 | 48330 | -| Bitcoin Cash Testnet | 19131 | 19031 | 18031 | 48331 | -| Zcash Testnet | 19132 | 19032 | 18032 | 48332 | -| Dash Testnet | 19133 | 19033 | 18033 | 48333 | -| Litecoin Testnet | 19134 | 19034 | 18034 | 48334 | -| Bitcoin Gold Testnet | 19135 | 19035 | 18035 | 48335 | -| Ethereum Testnet Holesky Archive | 19136 | 19036 | 18036 | 18136 http, 18536 authrpc, 48336 p2p | -| Dogecoin Testnet | 19138 | 19038 | 18038 | 48338 | -| Vertcoin Testnet | 19140 | 19040 | 18040 | 48340 | -| Monacoin Testnet | 19141 | 19041 | 18041 | 48341 | -| DigiByte Testnet | 19142 | 19042 | 18042 | 48342 | -| Groestlcoin Testnet | 19145 | 19045 | 18045 | 48345 | -| Groestlcoin Regtest | 19146 | 19046 | 18046 | 48346 | -| Groestlcoin Signet | 19147 | 19047 | 18047 | 48347 | -| PIVX Testnet | 19149 | 19049 | 18049 | 48349 | -| Koto Testnet | 19151 | 19051 | 18051 | 48351 | -| Decred Testnet | 19161 | 19061 | 18061 | 48361 | -| Flo Testnet | 19166 | 19066 | 18066 | 48366 | -| Ethereum Testnet Sepolia | 19176 | 19076 | 18076 | 18176 http, 18576 authrpc, 48376 p2p | -| Ethereum Testnet Sepolia Archive | 19186 | 19086 | 18086 | 18186 http, 18586 authrpc, 48386 p2p | -| Qtum Testnet | 19188 | 19088 | 18088 | 48388 | -| Omotenashicoin Testnet | 19189 | 19089 | 18089 | 48389 | +| coin | blockbook public | blockbook internal | backend rpc | backend service ports (zmq) | +|----------------------------------|------------------|--------------------|-------------|-----------------------------------------------------| +| Ethereum Archive | 9116 | 9016 | 8016 | 38316 p2p, 8116 http, 8516 authrpc | +| Bitcoin | 9130 | 9030 | 8030 | 38330 | +| Bitcoin Cash | 9131 | 9031 | 8031 | 38331 | +| Zcash | 9132 | 9032 | 8032 | 38332 | +| Dash | 9133 | 9033 | 8033 | 38333 | +| Litecoin | 9134 | 9034 | 8034 | 38334 | +| Bitcoin Gold | 9135 | 9035 | 8035 | 38335 | +| Ethereum | 9136 | 9036 | 8036 | 38336 p2p, 8136 http, 8536 authrpc | +| Ethereum Classic | 9137 | 9037 | 8037 | 38337 p2p, 8137 http | +| Dogecoin | 9138 | 9038 | 8038 | 38338 | +| Namecoin | 9139 | 9039 | 8039 | 38339 | +| Vertcoin | 9140 | 9040 | 8040 | 38340 | +| Monacoin | 9141 | 9041 | 8041 | 38341 | +| DigiByte | 9142 | 9042 | 8042 | 38342 | +| Myriad | 9143 | 9043 | 8043 | 38343 | +| GameCredits | 9144 | 9044 | 8044 | 38344 | +| Groestlcoin | 9145 | 9045 | 8045 | 38345 | +| Bitcoin Cash SV | 9146 | 9046 | 8046 | 38346 | +| Liquid | 9147 | 9047 | 8047 | 38347 | +| Fujicoin | 9148 | 9048 | 8048 | 38348 | +| PIVX | 9149 | 9049 | 8049 | 38349 | +| Firo | 9150 | 9050 | 8050 | 38350 | +| Koto | 9151 | 9051 | 8051 | 38351 | +| Bellcoin | 9152 | 9052 | 8052 | 38352 | +| NULS | 9153 | 9053 | 8053 | 38353 | +| Bitcore | 9154 | 9054 | 8054 | 38354 | +| Viacoin | 9155 | 9055 | 8055 | 38355 | +| VIPSTARCOIN | 9156 | 9056 | 8056 | 38356 | +| MonetaryUnit | 9157 | 9057 | 8057 | 38357 | +| Flux | 9158 | 9058 | 8058 | 38358 | +| Ravencoin | 9159 | 9059 | 8059 | 38359 | +| Ritocoin | 9160 | 9060 | 8060 | 38360 | +| Decred | 9161 | 9061 | 8061 | 38361 | +| SnowGem | 9162 | 9062 | 8062 | 38362 | +| BNB Smart Chain | 9164 | 9064 | 8064 | 38364 p2p, 8164 http | +| BNB Smart Chain Archive | 9165 | 9065 | 8065 | 38365 p2p, 8165 http | +| Flo | 9166 | 9066 | 8066 | 38366 | +| Polis | 9167 | 9067 | 8067 | 38367 | +| Polygon | 9170 | 9070 | 8070 | 38370 p2p, 8170 http | +| Polygon Archive | 9172 | 9072 | 8072 | 38372 p2p, 8172 http | +| Qtum | 9188 | 9088 | 8088 | 38388 | +| Divi Project | 9189 | 9089 | 8089 | 38389 | +| CPUchain | 9190 | 9090 | 8090 | 38390 | +| DeepOnion | 9191 | 9091 | 8091 | 38391 | +| Unobtanium | 9192 | 9092 | 65535 | 38392 | +| Omotenashicoin | 9194 | 9094 | 8094 | 38394 | +| BitZeny | 9195 | 9095 | 8095 | 38395 | +| Trezarcoin | 9196 | 9096 | 8096 | 38396 | +| eCash | 9197 | 9097 | 8097 | 38397 | +| Avalanche | 9198 | 9098 | 8098 | 38398 p2p | +| Avalanche Archive | 9199 | 9099 | 8099 | 38399 p2p | +| Optimism | 9300 | 9200 | 8200 | 38400 p2p, 8300 http, 8400 authrpc | +| Optimism Archive | 9302 | 9202 | 8202 | 38402 p2p, 8302 http, 8402 authrpc | +| Ethereum Testnet Holesky | 19116 | 19016 | 18016 | 18116 http, 18516 authrpc, 48316 p2p | +| Bitcoin Signet | 19120 | 19020 | 18020 | 48320 | +| Bitcoin Regtest | 19121 | 19021 | 18021 | 48321 | +| Bitcoin Testnet | 19130 | 19030 | 18030 | 48330 | +| Bitcoin Cash Testnet | 19131 | 19031 | 18031 | 48331 | +| Zcash Testnet | 19132 | 19032 | 18032 | 48332 | +| Dash Testnet | 19133 | 19033 | 18033 | 48333 | +| Litecoin Testnet | 19134 | 19034 | 18034 | 48334 | +| Bitcoin Gold Testnet | 19135 | 19035 | 18035 | 48335 | +| Ethereum Testnet Holesky Archive | 19136 | 19036 | 18036 | 18136 http, 18136 torrent, 18536 authrpc, 48336 p2p | +| Dogecoin Testnet | 19138 | 19038 | 18038 | 48338 | +| Vertcoin Testnet | 19140 | 19040 | 18040 | 48340 | +| Monacoin Testnet | 19141 | 19041 | 18041 | 48341 | +| DigiByte Testnet | 19142 | 19042 | 18042 | 48342 | +| Groestlcoin Testnet | 19145 | 19045 | 18045 | 48345 | +| Groestlcoin Regtest | 19146 | 19046 | 18046 | 48346 | +| Groestlcoin Signet | 19147 | 19047 | 18047 | 48347 | +| PIVX Testnet | 19149 | 19049 | 18049 | 48349 | +| Koto Testnet | 19151 | 19051 | 18051 | 48351 | +| Decred Testnet | 19161 | 19061 | 18061 | 48361 | +| Flo Testnet | 19166 | 19066 | 18066 | 48366 | +| Ethereum Testnet Sepolia | 19176 | 19076 | 18076 | 18176 http, 18576 authrpc, 48376 p2p | +| Ethereum Testnet Sepolia Archive | 19186 | 19086 | 18086 | 18186 http, 18186 torrent, 18586 authrpc, 48386 p2p | +| Qtum Testnet | 19188 | 19088 | 18088 | 48388 | +| Omotenashicoin Testnet | 19189 | 19089 | 18089 | 48389 | > NOTE: This document is generated from coin definitions in `configs/coins` using command `go run contrib/scripts/check-and-generate-port-registry.go -w`. diff --git a/static/templates/tx.html b/static/templates/tx.html index 396d6c14..ab00268b 100644 --- a/static/templates/tx.html +++ b/static/templates/tx.html @@ -51,6 +51,24 @@ Gas Price {{amountSpan $tx.EthereumSpecific.GasPrice $data "copyable"}} ({{amountSatsSpan $tx.EthereumSpecific.GasPrice $data "copyable"}} Gwei) + {{if $tx.EthereumSpecific.L1GasUsed}} + + L1 Gas Used + {{formatBigInt $tx.EthereumSpecific.L1GasUsed}} + + {{end}} + {{if $tx.EthereumSpecific.L1GasPrice}} + + L1 Gas Price + {{amountSpan $tx.EthereumSpecific.L1GasPrice $data "copyable"}} ({{amountSatsSpan $tx.EthereumSpecific.L1GasPrice $data "copyable"}} Gwei) + + {{end}} + {{if $tx.EthereumSpecific.L1FeeScalar}} + + L1 Fee Scalar + {{$tx.EthereumSpecific.L1FeeScalar}} + + {{end}} {{else}} Total Input From d814abae0ee3c91acbbd73de2ff510c02fa4dc17 Mon Sep 17 00:00:00 2001 From: kaladinlight <35275952+kaladinlight@users.noreply.github.com> Date: Wed, 12 Jun 2024 12:18:32 -0600 Subject: [PATCH 04/56] use eth.OpenRPC --- bchain/coins/optimism/optimismrpc.go | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/bchain/coins/optimism/optimismrpc.go b/bchain/coins/optimism/optimismrpc.go index 11c7d051..b28ae9ef 100644 --- a/bchain/coins/optimism/optimismrpc.go +++ b/bchain/coins/optimism/optimismrpc.go @@ -4,8 +4,6 @@ import ( "context" "encoding/json" - "github.com/ethereum/go-ethereum/ethclient" - "github.com/ethereum/go-ethereum/rpc" "github.com/golang/glog" "github.com/juju/errors" "github.com/trezor/blockbook/bchain" @@ -38,15 +36,7 @@ func NewOptimismRPC(config json.RawMessage, pushHandler func(bchain.Notification // Initialize bnb smart chain rpc interface func (b *OptimismRPC) Initialize() error { - b.OpenRPC = func(url string) (bchain.EVMRPCClient, bchain.EVMClient, error) { - r, err := rpc.Dial(url) - if err != nil { - return nil, nil, err - } - rc := &OptimismRPCClient{Client: r} - ec := ð.EthereumClient{Client: ethclient.NewClient(r)} - return rc, ec, nil - } + b.OpenRPC = eth.OpenRPC rc, ec, err := b.OpenRPC(b.ChainConfig.RPCURL) if err != nil { From 2e3ac06ea06e13d121438c773d94341cb11017fe Mon Sep 17 00:00:00 2001 From: kaladinlight <35275952+kaladinlight@users.noreply.github.com> Date: Wed, 12 Jun 2024 14:09:47 -0600 Subject: [PATCH 05/56] update op-node config --- configs/coins/optimism_archive_op_node.json | 6 +++--- configs/coins/optimism_op_node.json | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/configs/coins/optimism_archive_op_node.json b/configs/coins/optimism_archive_op_node.json index 9c6f77fc..3a816772 100644 --- a/configs/coins/optimism_archive_op_node.json +++ b/configs/coins/optimism_archive_op_node.json @@ -18,11 +18,11 @@ "binary_url": "https://github.com/ethereum-optimism/optimism/archive/refs/tags/op-node/v1.7.6.tar.gz", "verification_type": "sha256", "verification_source": "91384e4834f0d0776d1c3e19613b5c50a904f6e5814349e444d42d9e8be5a7ab", - "extract_command": "mkdir backend/source && tar -C backend/source --strip 1 -xf", + "extract_command": "mkdir backend/source && tar -C backend/source --strip 1 -xf v1.7.6.tar.gz && cd backend/source/op-node && go build -o ../../op-node ./cmd && rm -rf ../../source && echo", "exclude_files": [], - "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/op-node --network mainnet --l1 http://127.0.0.1:8116 --l1.beacon http://127.0.0.1:7516 --l1.trustrpc --l1.rpckind=debug_geth --l2 http://127.0.0.1:8402 --rpc.addr 127.0.0.1 --rpc.port {{.Ports.BackendRPC}} --l2.jwt-secret {{.Env.BackendDataPath}}/optimism_archive/backend/jwtsecret 2>&1>> {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", + "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/op-node --network mainnet --l1 http://127.0.0.1:8116 --l1.beacon http://127.0.0.1:7516 --l1.trustrpc --l1.rpckind=debug_geth --l2 http://127.0.0.1:8402 --rpc.addr 127.0.0.1 --rpc.port {{.Ports.BackendRPC}} --l2.jwt-secret {{.Env.BackendDataPath}}/optimism_archive/backend/jwtsecret 2>&1 >> {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", "logrotate_files_template": "{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log", - "postinst_script_template": "cd {{.Env.BackendInstallPath}}/{{.Coin.Alias}}/source/op-node && go build -o {{.Env.BackendInstallPath}}/{{.Coin.Alias}}/op-node ./cmd && rm -rf {{.Env.BackendInstallPath}}/{{.Coin.Alias}}/source", + "postinst_script_template": "", "service_type": "simple", "service_additional_params_template": "", "protect_memory": true, diff --git a/configs/coins/optimism_op_node.json b/configs/coins/optimism_op_node.json index 840aab8d..49bbfc4f 100644 --- a/configs/coins/optimism_op_node.json +++ b/configs/coins/optimism_op_node.json @@ -18,11 +18,11 @@ "binary_url": "https://github.com/ethereum-optimism/optimism/archive/refs/tags/op-node/v1.7.6.tar.gz", "verification_type": "sha256", "verification_source": "91384e4834f0d0776d1c3e19613b5c50a904f6e5814349e444d42d9e8be5a7ab", - "extract_command": "mkdir backend/source && tar -C backend/source --strip 1 -xf", + "extract_command": "mkdir backend/source && tar -C backend/source --strip 1 -xf v1.7.6.tar.gz && cd backend/source/op-node && go build -o ../../op-node ./cmd && rm -rf ../../source && echo", "exclude_files": [], - "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/op-node --network op-mainnet --l1 http://127.0.0.1:8136 --l1.beacon http://127.0.0.1:7536 --l1.trustrpc --l1.rpckind=debug_geth --l2 http://127.0.0.1:8400 --rpc.addr 127.0.0.1 --rpc.port {{.Ports.BackendRPC}} --l2.jwt-secret {{.Env.BackendDataPath}}/optimism/backend/jwtsecret 2>&1>> {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", + "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/op-node --network op-mainnet --l1 http://127.0.0.1:8136 --l1.beacon http://127.0.0.1:7536 --l1.trustrpc --l1.rpckind=debug_geth --l2 http://127.0.0.1:8400 --rpc.addr 127.0.0.1 --rpc.port {{.Ports.BackendRPC}} --l2.jwt-secret {{.Env.BackendDataPath}}/optimism/backend/jwtsecret 2>&1 >> {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", "logrotate_files_template": "{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log", - "postinst_script_template": "cd {{.Env.BackendInstallPath}}/{{.Coin.Alias}}/source/op-node && go build -o {{.Env.BackendInstallPath}}/{{.Coin.Alias}}/op-node ./cmd && rm -rf {{.Env.BackendInstallPath}}/{{.Coin.Alias}}/source", + "postinst_script_template": "", "service_type": "simple", "service_additional_params_template": "", "protect_memory": true, From 80f05727c151368c4cf05fb4a8456b098b88dac1 Mon Sep 17 00:00:00 2001 From: kaladinlight <35275952+kaladinlight@users.noreply.github.com> Date: Tue, 18 Jun 2024 13:11:25 -0600 Subject: [PATCH 06/56] run op_node from backend for local file store --- configs/coins/optimism_archive_op_node.json | 2 +- configs/coins/optimism_op_node.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configs/coins/optimism_archive_op_node.json b/configs/coins/optimism_archive_op_node.json index 3a816772..b9d1d76d 100644 --- a/configs/coins/optimism_archive_op_node.json +++ b/configs/coins/optimism_archive_op_node.json @@ -20,7 +20,7 @@ "verification_source": "91384e4834f0d0776d1c3e19613b5c50a904f6e5814349e444d42d9e8be5a7ab", "extract_command": "mkdir backend/source && tar -C backend/source --strip 1 -xf v1.7.6.tar.gz && cd backend/source/op-node && go build -o ../../op-node ./cmd && rm -rf ../../source && echo", "exclude_files": [], - "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/op-node --network mainnet --l1 http://127.0.0.1:8116 --l1.beacon http://127.0.0.1:7516 --l1.trustrpc --l1.rpckind=debug_geth --l2 http://127.0.0.1:8402 --rpc.addr 127.0.0.1 --rpc.port {{.Ports.BackendRPC}} --l2.jwt-secret {{.Env.BackendDataPath}}/optimism_archive/backend/jwtsecret 2>&1 >> {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", + "exec_command_template": "cd {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend && /bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/op-node --network mainnet --l1 http://127.0.0.1:8116 --l1.beacon http://127.0.0.1:7516 --l1.trustrpc --l1.rpckind=debug_geth --l2 http://127.0.0.1:8402 --rpc.addr 127.0.0.1 --rpc.port {{.Ports.BackendRPC}} --l2.jwt-secret {{.Env.BackendDataPath}}/optimism_archive/backend/jwtsecret 2>&1 >> {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", "logrotate_files_template": "{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log", "postinst_script_template": "", "service_type": "simple", diff --git a/configs/coins/optimism_op_node.json b/configs/coins/optimism_op_node.json index 49bbfc4f..239949f3 100644 --- a/configs/coins/optimism_op_node.json +++ b/configs/coins/optimism_op_node.json @@ -20,7 +20,7 @@ "verification_source": "91384e4834f0d0776d1c3e19613b5c50a904f6e5814349e444d42d9e8be5a7ab", "extract_command": "mkdir backend/source && tar -C backend/source --strip 1 -xf v1.7.6.tar.gz && cd backend/source/op-node && go build -o ../../op-node ./cmd && rm -rf ../../source && echo", "exclude_files": [], - "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/op-node --network op-mainnet --l1 http://127.0.0.1:8136 --l1.beacon http://127.0.0.1:7536 --l1.trustrpc --l1.rpckind=debug_geth --l2 http://127.0.0.1:8400 --rpc.addr 127.0.0.1 --rpc.port {{.Ports.BackendRPC}} --l2.jwt-secret {{.Env.BackendDataPath}}/optimism/backend/jwtsecret 2>&1 >> {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", + "exec_command_template": "cd {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend && /bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/op-node --network op-mainnet --l1 http://127.0.0.1:8136 --l1.beacon http://127.0.0.1:7536 --l1.trustrpc --l1.rpckind=debug_geth --l2 http://127.0.0.1:8400 --rpc.addr 127.0.0.1 --rpc.port {{.Ports.BackendRPC}} --l2.jwt-secret {{.Env.BackendDataPath}}/optimism/backend/jwtsecret 2>&1 >> {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", "logrotate_files_template": "{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log", "postinst_script_template": "", "service_type": "simple", From 3ce286f82d57474673ad8b6d5b99d8322f97f1d5 Mon Sep 17 00:00:00 2001 From: kaladinlight <35275952+kaladinlight@users.noreply.github.com> Date: Tue, 25 Jun 2024 11:56:54 -0600 Subject: [PATCH 07/56] pull out exec command into script and add path flags --- .../scripts/optimism_archive_op_node.sh | 24 +++++++++++++++++++ .../backend/scripts/optimism_op_node.sh | 24 +++++++++++++++++++ configs/coins/optimism_archive_op_node.json | 3 ++- configs/coins/optimism_op_node.json | 3 ++- 4 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 build/templates/backend/scripts/optimism_archive_op_node.sh create mode 100644 build/templates/backend/scripts/optimism_op_node.sh diff --git a/build/templates/backend/scripts/optimism_archive_op_node.sh b/build/templates/backend/scripts/optimism_archive_op_node.sh new file mode 100644 index 00000000..46375703 --- /dev/null +++ b/build/templates/backend/scripts/optimism_archive_op_node.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +{{define "main" -}} + +set -e + +BIN={{.Env.BackendInstallPath}}/{{.Coin.Alias}}/op-node +PATH={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend + +$BIN \ + --network op-mainnet \ + --l1 http://127.0.0.1:8116 \ + --l1.beacon http://127.0.0.1:7516 \ + --l1.trustrpc \ + --l1.rpckind=debug_geth \ + --l2 http://127.0.0.1:8402 \ + --rpc.addr 127.0.0.1 \ + --rpc.port {{.Ports.BackendRPC}} \ + --l2.jwt-secret {{.Env.BackendDataPath}}/optimism_archive/backend/jwtsecret \ + --p2p.priv.path $PATH/opnode_p2p_priv.txt \ + --p2p.peerstore.path $PATH/opnode_peerstore_db \ + --p2p.discovery.path $PATH/opnode_discovery_db + +{{end}} diff --git a/build/templates/backend/scripts/optimism_op_node.sh b/build/templates/backend/scripts/optimism_op_node.sh new file mode 100644 index 00000000..200c04b6 --- /dev/null +++ b/build/templates/backend/scripts/optimism_op_node.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +{{define "main" -}} + +set -e + +BIN={{.Env.BackendInstallPath}}/{{.Coin.Alias}}/op-node +PATH={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend + +$BIN \ + --network op-mainnet \ + --l1 http://127.0.0.1:8136 \ + --l1.beacon http://127.0.0.1:7536 \ + --l1.trustrpc \ + --l1.rpckind=debug_geth \ + --l2 http://127.0.0.1:8400 \ + --rpc.addr 127.0.0.1 \ + --rpc.port {{.Ports.BackendRPC}} \ + --l2.jwt-secret {{.Env.BackendDataPath}}/optimism/backend/jwtsecret \ + --p2p.priv.path $PATH/opnode_p2p_priv.txt \ + --p2p.peerstore.path $PATH/opnode_peerstore_db \ + --p2p.discovery.path $PATH/opnode_discovery_db + +{{end}} diff --git a/configs/coins/optimism_archive_op_node.json b/configs/coins/optimism_archive_op_node.json index b9d1d76d..a16c4122 100644 --- a/configs/coins/optimism_archive_op_node.json +++ b/configs/coins/optimism_archive_op_node.json @@ -20,7 +20,8 @@ "verification_source": "91384e4834f0d0776d1c3e19613b5c50a904f6e5814349e444d42d9e8be5a7ab", "extract_command": "mkdir backend/source && tar -C backend/source --strip 1 -xf v1.7.6.tar.gz && cd backend/source/op-node && go build -o ../../op-node ./cmd && rm -rf ../../source && echo", "exclude_files": [], - "exec_command_template": "cd {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend && /bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/op-node --network mainnet --l1 http://127.0.0.1:8116 --l1.beacon http://127.0.0.1:7516 --l1.trustrpc --l1.rpckind=debug_geth --l2 http://127.0.0.1:8402 --rpc.addr 127.0.0.1 --rpc.port {{.Ports.BackendRPC}} --l2.jwt-secret {{.Env.BackendDataPath}}/optimism_archive/backend/jwtsecret 2>&1 >> {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", + "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/optimism_archive_op_node_exec.sh 2>&1 >> {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", + "exec_script": "optimism_archive_op_node.sh", "logrotate_files_template": "{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log", "postinst_script_template": "", "service_type": "simple", diff --git a/configs/coins/optimism_op_node.json b/configs/coins/optimism_op_node.json index 239949f3..e2b6cc17 100644 --- a/configs/coins/optimism_op_node.json +++ b/configs/coins/optimism_op_node.json @@ -20,7 +20,8 @@ "verification_source": "91384e4834f0d0776d1c3e19613b5c50a904f6e5814349e444d42d9e8be5a7ab", "extract_command": "mkdir backend/source && tar -C backend/source --strip 1 -xf v1.7.6.tar.gz && cd backend/source/op-node && go build -o ../../op-node ./cmd && rm -rf ../../source && echo", "exclude_files": [], - "exec_command_template": "cd {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend && /bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/op-node --network op-mainnet --l1 http://127.0.0.1:8136 --l1.beacon http://127.0.0.1:7536 --l1.trustrpc --l1.rpckind=debug_geth --l2 http://127.0.0.1:8400 --rpc.addr 127.0.0.1 --rpc.port {{.Ports.BackendRPC}} --l2.jwt-secret {{.Env.BackendDataPath}}/optimism/backend/jwtsecret 2>&1 >> {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", + "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/optimism_op_node_exec.sh 2>&1 >> {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", + "exec_script": "optimism_op_node.sh", "logrotate_files_template": "{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log", "postinst_script_template": "", "service_type": "simple", From 7e5be4837b3f8db3224a25c058bbd67634dd9e0d Mon Sep 17 00:00:00 2001 From: kaladinlight <35275952+kaladinlight@users.noreply.github.com> Date: Wed, 26 Jun 2024 10:11:21 -0600 Subject: [PATCH 08/56] move go build into extract command --- configs/coins/optimism.json | 4 ++-- configs/coins/optimism_archive.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/configs/coins/optimism.json b/configs/coins/optimism.json index 08870305..1c6c8ae9 100644 --- a/configs/coins/optimism.json +++ b/configs/coins/optimism.json @@ -25,12 +25,12 @@ "binary_url": "https://github.com/ethereum-optimism/op-geth/archive/refs/tags/v1.101315.1.tar.gz", "verification_type": "sha256", "verification_source": "f0f31ef2982f87f9e3eb90f2b603f5fcd9d680e487d35f5bdcf5aeba290b153f", - "extract_command": "mkdir backend/source && tar -C backend/source --strip 1 -xf", + "extract_command": "mkdir backend/source && tar -C backend/source --strip 1 -xf v1.101315.1.tar.gz && cd backend/source && make geth && mv build/bin/geth ../ && rm -rf ../source && echo", "exclude_files": [], "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/optimism_exec.sh 2>> {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", "exec_script": "optimism.sh", "logrotate_files_template": "{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log", - "postinst_script_template": "cd {{.Env.BackendInstallPath}}/{{.Coin.Alias}}/source && make geth && mv build/bin/geth {{.Env.BackendInstallPath}}/{{.Coin.Alias}} && rm -rf {{.Env.BackendInstallPath}}/{{.Coin.Alias}}/source && openssl rand -hex 32 > {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/jwtsecret", + "postinst_script_template": "openssl rand -hex 32 > {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/jwtsecret", "service_type": "simple", "service_additional_params_template": "", "protect_memory": true, diff --git a/configs/coins/optimism_archive.json b/configs/coins/optimism_archive.json index 21ba9f72..9d9daac0 100644 --- a/configs/coins/optimism_archive.json +++ b/configs/coins/optimism_archive.json @@ -25,12 +25,12 @@ "binary_url": "https://github.com/ethereum-optimism/op-geth/archive/refs/tags/v1.101315.1.tar.gz", "verification_type": "sha256", "verification_source": "f0f31ef2982f87f9e3eb90f2b603f5fcd9d680e487d35f5bdcf5aeba290b153f", - "extract_command": "mkdir backend/source && tar -C backend/source --strip 1 -xf", + "extract_command": "mkdir backend/source && tar -C backend/source --strip 1 -xf v1.101315.1.tar.gz && cd backend/source && make geth && mv build/bin/geth ../ && rm -rf ../source && echo", "exclude_files": [], "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/optimism_archive_exec.sh 2>> {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", "exec_script": "optimism_archive.sh", "logrotate_files_template": "{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log", - "postinst_script_template": "cd {{.Env.BackendInstallPath}}/{{.Coin.Alias}}/source && make geth && mv build/bin/geth {{.Env.BackendInstallPath}}/{{.Coin.Alias}} && rm -rf {{.Env.BackendInstallPath}}/{{.Coin.Alias}}/source && openssl rand -hex 32 > {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/jwtsecret", + "postinst_script_template": "openssl rand -hex 32 > {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/jwtsecret", "service_type": "simple", "service_additional_params_template": "", "protect_memory": true, From 4b9a0a90bbb1519ae27afd05452b0413e50037a4 Mon Sep 17 00:00:00 2001 From: kaladinlight <35275952+kaladinlight@users.noreply.github.com> Date: Mon, 1 Jul 2024 14:37:51 -0600 Subject: [PATCH 09/56] extract snapshot url from metadata html --- build/templates/backend/scripts/optimism_archive.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/templates/backend/scripts/optimism_archive.sh b/build/templates/backend/scripts/optimism_archive.sh index 286e1a00..78025884 100644 --- a/build/templates/backend/scripts/optimism_archive.sh +++ b/build/templates/backend/scripts/optimism_archive.sh @@ -11,7 +11,7 @@ CHAINDATA_DIR=$DATA_DIR/geth/chaindata SNAPSHOT=https://datadirs.optimism.io/latest if [ ! -d "$CHAINDATA_DIR" ]; then - wget -c $SNAPSHOT -O - | zstd -cd | tar xf - -C $DATA_DIR + wget -c $(curl -sL $SNAPSHOT | grep -oP '(?<=url=)[^"]*') -O - | zstd -cd | tar xf - -C $DATA_DIR fi $GETH_BIN \ From 0afcb3a002e9f818907f2e1398f5c2af72c9f1ae Mon Sep 17 00:00:00 2001 From: JoHnY Date: Tue, 16 Jul 2024 07:46:40 +0000 Subject: [PATCH 10/56] =?UTF-8?q?bch=20(+testnet)=2027.0.0=20=E2=86=92=202?= =?UTF-8?q?7.1.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- configs/coins/bcash.json | 6 +++--- configs/coins/bcash_testnet.json | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/configs/coins/bcash.json b/configs/coins/bcash.json index 1d2043ea..daac347b 100644 --- a/configs/coins/bcash.json +++ b/configs/coins/bcash.json @@ -22,10 +22,10 @@ "package_name": "backend-bcash", "package_revision": "satoshilabs-1", "system_user": "bcash", - "version": "27.0.0", - "binary_url": "https://github.com/bitcoin-cash-node/bitcoin-cash-node/releases/download/v27.0.0/bitcoin-cash-node-27.0.0-x86_64-linux-gnu.tar.gz", + "version": "27.1.0", + "binary_url": "https://github.com/bitcoin-cash-node/bitcoin-cash-node/releases/download/v27.1.0/bitcoin-cash-node-27.1.0-x86_64-linux-gnu.tar.gz", "verification_type": "sha256", - "verification_source": "2ab81515a763162435f7ea28bb1f10f69b6143f469278fc52c0b8cbaec6cf238", + "verification_source": "0dcc387cbaa3a039c97ddc8fb99c1fa7bff5dc6e4bd3a01d3c3095f595ad2dce", "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", diff --git a/configs/coins/bcash_testnet.json b/configs/coins/bcash_testnet.json index 0571743a..89c08f09 100644 --- a/configs/coins/bcash_testnet.json +++ b/configs/coins/bcash_testnet.json @@ -22,10 +22,10 @@ "package_name": "backend-bcash-testnet", "package_revision": "satoshilabs-1", "system_user": "bcash", - "version": "27.0.0", - "binary_url": "https://github.com/bitcoin-cash-node/bitcoin-cash-node/releases/download/v27.0.0/bitcoin-cash-node-27.0.0-x86_64-linux-gnu.tar.gz", + "version": "27.1.0", + "binary_url": "https://github.com/bitcoin-cash-node/bitcoin-cash-node/releases/download/v27.1.0/bitcoin-cash-node-27.1.0-x86_64-linux-gnu.tar.gz", "verification_type": "sha256", - "verification_source": "2ab81515a763162435f7ea28bb1f10f69b6143f469278fc52c0b8cbaec6cf238", + "verification_source": "0dcc387cbaa3a039c97ddc8fb99c1fa7bff5dc6e4bd3a01d3c3095f595ad2dce", "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", From f6899a771285475739383f64137af8e2a19ee855 Mon Sep 17 00:00:00 2001 From: JoHnY Date: Mon, 29 Jul 2024 07:34:43 +0000 Subject: [PATCH 11/56] =?UTF-8?q?eth=20(+testnets)=202.59.3=20=E2=86=92=20?= =?UTF-8?q?2.60.5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- configs/coins/ethereum.json | 10 +++++----- configs/coins/ethereum_archive.json | 10 +++++----- configs/coins/ethereum_testnet_holesky.json | 10 +++++----- configs/coins/ethereum_testnet_holesky_archive.json | 10 +++++----- configs/coins/ethereum_testnet_sepolia.json | 10 +++++----- configs/coins/ethereum_testnet_sepolia_archive.json | 10 +++++----- 6 files changed, 30 insertions(+), 30 deletions(-) diff --git a/configs/coins/ethereum.json b/configs/coins/ethereum.json index 79e607a9..92aacd65 100644 --- a/configs/coins/ethereum.json +++ b/configs/coins/ethereum.json @@ -22,10 +22,10 @@ "package_name": "backend-ethereum", "package_revision": "satoshilabs-1", "system_user": "ethereum", - "version": "2.59.1", - "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/v2.59.1/erigon_2.59.1_linux_amd64.tar.gz", + "version": "2.60.5", + "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/v2.60.5/erigon_2.60.5_linux_amd64.tar.gz", "verification_type": "sha256", - "verification_source": "5800f0da3ec52f8abc414860f4b3c9ac8c46d07c5044b5458820c71fd4b95b38", + "verification_source": "e214fd85eff9f37926599309e1a0e60673698770656ad826fcdecaab55bc2ba1", "extract_command": "tar -C backend -xf", "exclude_files": [], "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/erigon --chain mainnet --snap.keepblocks --db.size.limit 15TB --prune c --prune.c.older 1000000 -torrent.download.rate 32mb --nat none --datadir {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/erigon --port {{.Ports.BackendP2P}} --ws --ws.port {{.Ports.BackendRPC}} --http --http.port {{.Ports.BackendRPC}} --http.addr 127.0.0.1 --http.corsdomain \"*\" --http.vhosts \"*\" --http.api \"eth,net,web3,debug,txpool\" --authrpc.port {{.Ports.BackendAuthRpc}} --private.api.addr \"\" --torrent.port {{.Ports.BackendHttp}} --log.dir.path {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend --log.dir.prefix {{.Coin.Alias}}'", @@ -39,8 +39,8 @@ "client_config_file": "", "platforms": { "arm64": { - "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/v2.59.1/erigon_2.59.1_linux_arm64.tar.gz", - "verification_source": "9d29e04f600111971c56a9c48aa5c7c9e81cd61ad8bb042c240505e4bd93bf88" + "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/v2.60.5/erigon_2.60.5_linux_arm64.tar.gz", + "verification_source": "b53d4b34fd1d96880886829aedd7f5a095a26065b7856c0862273fcb539151bd" } } }, diff --git a/configs/coins/ethereum_archive.json b/configs/coins/ethereum_archive.json index 18103432..7542abf0 100644 --- a/configs/coins/ethereum_archive.json +++ b/configs/coins/ethereum_archive.json @@ -22,10 +22,10 @@ "package_name": "backend-ethereum-archive", "package_revision": "satoshilabs-1", "system_user": "ethereum", - "version": "2.59.1", - "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/v2.59.1/erigon_2.59.1_linux_amd64.tar.gz", + "version": "2.60.5", + "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/v2.60.5/erigon_2.60.5_linux_amd64.tar.gz", "verification_type": "sha256", - "verification_source": "5800f0da3ec52f8abc414860f4b3c9ac8c46d07c5044b5458820c71fd4b95b38", + "verification_source": "e214fd85eff9f37926599309e1a0e60673698770656ad826fcdecaab55bc2ba1", "extract_command": "tar -C backend -xf", "exclude_files": [], "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/erigon --chain mainnet --snap.keepblocks --db.size.limit 15TB --prune c --prune.c.older 1000000 -torrent.download.rate 32mb --nat none --datadir {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/erigon --port {{.Ports.BackendP2P}} --ws --ws.port {{.Ports.BackendRPC}} --http --http.port {{.Ports.BackendRPC}} --http.addr 127.0.0.1 --http.corsdomain \"*\" --http.vhosts \"*\" --http.api \"eth,net,web3,debug,txpool\" --authrpc.port {{.Ports.BackendAuthRpc}} --private.api.addr \"\" --torrent.port {{.Ports.BackendHttp}} --log.dir.path {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend --log.dir.prefix {{.Coin.Alias}}'", @@ -39,8 +39,8 @@ "client_config_file": "", "platforms": { "arm64": { - "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/v2.59.1/erigon_2.59.1_linux_arm64.tar.gz", - "verification_source": "9d29e04f600111971c56a9c48aa5c7c9e81cd61ad8bb042c240505e4bd93bf88" + "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/v2.60.5/erigon_2.60.5_linux_arm64.tar.gz", + "verification_source": "b53d4b34fd1d96880886829aedd7f5a095a26065b7856c0862273fcb539151bd" } } }, diff --git a/configs/coins/ethereum_testnet_holesky.json b/configs/coins/ethereum_testnet_holesky.json index 91e6e9b7..1aea3a04 100644 --- a/configs/coins/ethereum_testnet_holesky.json +++ b/configs/coins/ethereum_testnet_holesky.json @@ -22,10 +22,10 @@ "package_name": "backend-ethereum-testnet-holesky", "package_revision": "satoshilabs-1", "system_user": "ethereum", - "version": "2.59.1", - "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/v2.59.1/erigon_2.59.1_linux_amd64.tar.gz", + "version": "2.60.5", + "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/v2.60.5/erigon_2.60.5_linux_amd64.tar.gz", "verification_type": "sha256", - "verification_source": "5800f0da3ec52f8abc414860f4b3c9ac8c46d07c5044b5458820c71fd4b95b38", + "verification_source": "e214fd85eff9f37926599309e1a0e60673698770656ad826fcdecaab55bc2ba1", "extract_command": "tar -C backend -xf", "exclude_files": [], "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/erigon --chain holesky --snap.keepblocks --db.size.limit 15TB --prune c --prune.c.older 1000000 -torrent.download.rate 32mb --nat none --datadir {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/erigon --port {{.Ports.BackendP2P}} --ws --ws.port {{.Ports.BackendRPC}} --http --http.port {{.Ports.BackendRPC}} --http.addr 127.0.0.1 --http.corsdomain \"*\" --http.vhosts \"*\" --http.api \"eth,net,web3,debug,txpool\" --authrpc.port {{.Ports.BackendAuthRpc}} --private.api.addr \"\" --torrent.port {{.Ports.BackendHttp}} --log.dir.path {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend --log.dir.prefix {{.Coin.Alias}}'", @@ -39,8 +39,8 @@ "client_config_file": "", "platforms": { "arm64": { - "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/v2.59.1/erigon_2.59.1_linux_arm64.tar.gz", - "verification_source": "9d29e04f600111971c56a9c48aa5c7c9e81cd61ad8bb042c240505e4bd93bf88" + "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/v2.60.5/erigon_2.60.5_linux_arm64.tar.gz", + "verification_source": "b53d4b34fd1d96880886829aedd7f5a095a26065b7856c0862273fcb539151bd" } } }, diff --git a/configs/coins/ethereum_testnet_holesky_archive.json b/configs/coins/ethereum_testnet_holesky_archive.json index aa7c3f77..bad490fb 100644 --- a/configs/coins/ethereum_testnet_holesky_archive.json +++ b/configs/coins/ethereum_testnet_holesky_archive.json @@ -23,10 +23,10 @@ "package_name": "backend-ethereum-testnet-holesky-archive", "package_revision": "satoshilabs-1", "system_user": "ethereum", - "version": "2.59.1", - "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/v2.59.1/erigon_2.59.1_linux_amd64.tar.gz", + "version": "2.60.5", + "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/v2.60.5/erigon_2.60.5_linux_amd64.tar.gz", "verification_type": "sha256", - "verification_source": "5800f0da3ec52f8abc414860f4b3c9ac8c46d07c5044b5458820c71fd4b95b38", + "verification_source": "e214fd85eff9f37926599309e1a0e60673698770656ad826fcdecaab55bc2ba1", "extract_command": "tar -C backend -xf", "exclude_files": [], "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/erigon --chain holesky --snap.keepblocks --db.size.limit 15TB --prune c --prune.c.older 1000000 -torrent.download.rate 32mb --nat none --datadir {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/erigon --port {{.Ports.BackendP2P}} --ws --ws.port {{.Ports.BackendRPC}} --http --http.port {{.Ports.BackendRPC}} --http.addr 127.0.0.1 --http.corsdomain \"*\" --http.vhosts \"*\" --http.api \"eth,net,web3,debug,txpool\" --authrpc.port {{.Ports.BackendAuthRpc}} --private.api.addr \"\" --torrent.port {{.Ports.BackendHttp}} --log.dir.path {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend --log.dir.prefix {{.Coin.Alias}}'", @@ -40,8 +40,8 @@ "client_config_file": "", "platforms": { "arm64": { - "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/v2.59.1/erigon_2.59.1_linux_arm64.tar.gz", - "verification_source": "9d29e04f600111971c56a9c48aa5c7c9e81cd61ad8bb042c240505e4bd93bf88" + "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/v2.60.5/erigon_2.60.5_linux_arm64.tar.gz", + "verification_source": "b53d4b34fd1d96880886829aedd7f5a095a26065b7856c0862273fcb539151bd" } } }, diff --git a/configs/coins/ethereum_testnet_sepolia.json b/configs/coins/ethereum_testnet_sepolia.json index a39e6cc3..0222dcfe 100644 --- a/configs/coins/ethereum_testnet_sepolia.json +++ b/configs/coins/ethereum_testnet_sepolia.json @@ -22,10 +22,10 @@ "package_name": "backend-ethereum-testnet-sepolia", "package_revision": "satoshilabs-1", "system_user": "ethereum", - "version": "2.59.1", - "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/v2.59.1/erigon_2.59.1_linux_amd64.tar.gz", + "version": "2.60.5", + "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/v2.60.5/erigon_2.60.5_linux_amd64.tar.gz", "verification_type": "sha256", - "verification_source": "5800f0da3ec52f8abc414860f4b3c9ac8c46d07c5044b5458820c71fd4b95b38", + "verification_source": "e214fd85eff9f37926599309e1a0e60673698770656ad826fcdecaab55bc2ba1", "extract_command": "tar -C backend -xf", "exclude_files": [], "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/erigon --chain sepolia --snap.keepblocks --db.size.limit 15TB --prune c --prune.c.older 1000000 -torrent.download.rate 32mb --nat none --datadir {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/erigon --port {{.Ports.BackendP2P}} --ws --ws.port {{.Ports.BackendRPC}} --http --http.port {{.Ports.BackendRPC}} --http.addr 127.0.0.1 --http.corsdomain \"*\" --http.vhosts \"*\" --http.api \"eth,net,web3,debug,txpool\" --authrpc.port {{.Ports.BackendAuthRpc}} --private.api.addr \"\" --torrent.port {{.Ports.BackendHttp}} --log.dir.path {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend --log.dir.prefix {{.Coin.Alias}}'", @@ -39,8 +39,8 @@ "client_config_file": "", "platforms": { "arm64": { - "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/v2.59.1/erigon_2.59.1_linux_arm64.tar.gz", - "verification_source": "9d29e04f600111971c56a9c48aa5c7c9e81cd61ad8bb042c240505e4bd93bf88" + "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/v2.60.5/erigon_2.60.5_linux_arm64.tar.gz", + "verification_source": "b53d4b34fd1d96880886829aedd7f5a095a26065b7856c0862273fcb539151bd" } } }, diff --git a/configs/coins/ethereum_testnet_sepolia_archive.json b/configs/coins/ethereum_testnet_sepolia_archive.json index 90e40f7c..5f8f02bf 100644 --- a/configs/coins/ethereum_testnet_sepolia_archive.json +++ b/configs/coins/ethereum_testnet_sepolia_archive.json @@ -23,10 +23,10 @@ "package_name": "backend-ethereum-testnet-sepolia-archive", "package_revision": "satoshilabs-1", "system_user": "ethereum", - "version": "2.59.1", - "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/v2.59.1/erigon_2.59.1_linux_amd64.tar.gz", + "version": "2.60.5", + "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/v2.60.5/erigon_2.60.5_linux_amd64.tar.gz", "verification_type": "sha256", - "verification_source": "5800f0da3ec52f8abc414860f4b3c9ac8c46d07c5044b5458820c71fd4b95b38", + "verification_source": "e214fd85eff9f37926599309e1a0e60673698770656ad826fcdecaab55bc2ba1", "extract_command": "tar -C backend -xf", "exclude_files": [], "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/erigon --chain sepolia --snap.keepblocks --db.size.limit 15TB --prune c --prune.c.older 1000000 -torrent.download.rate 32mb --nat none --datadir {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/erigon --port {{.Ports.BackendP2P}} --ws --ws.port {{.Ports.BackendRPC}} --http --http.port {{.Ports.BackendRPC}} --http.addr 127.0.0.1 --http.corsdomain \"*\" --http.vhosts \"*\" --http.api \"eth,net,web3,debug,txpool\" --authrpc.port {{.Ports.BackendAuthRpc}} --private.api.addr \"\" --torrent.port {{.Ports.BackendHttp}} --log.dir.path {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend --log.dir.prefix {{.Coin.Alias}}'", @@ -40,8 +40,8 @@ "client_config_file": "", "platforms": { "arm64": { - "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/v2.59.1/erigon_2.59.1_linux_arm64.tar.gz", - "verification_source": "9d29e04f600111971c56a9c48aa5c7c9e81cd61ad8bb042c240505e4bd93bf88" + "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/v2.60.5/erigon_2.60.5_linux_arm64.tar.gz", + "verification_source": "b53d4b34fd1d96880886829aedd7f5a095a26065b7856c0862273fcb539151bd" } } }, From c1f2e62c45483a595bf3e610f2a9c8e94e0de863 Mon Sep 17 00:00:00 2001 From: Martin Boehm Date: Thu, 11 Jul 2024 17:19:46 +0200 Subject: [PATCH 12/56] Show Nonce for ethereum type transactions in explorer --- server/public_ethereumtype_test.go | 2 +- static/templates/tx.html | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/server/public_ethereumtype_test.go b/server/public_ethereumtype_test.go index 75c680b0..1edb8ab2 100644 --- a/server/public_ethereumtype_test.go +++ b/server/public_ethereumtype_test.go @@ -44,7 +44,7 @@ func httpTestsEthereumType(t *testing.T, ts *httptest.Server) { status: http.StatusOK, contentType: "text/html; charset=utf-8", body: []string{ - `Trezor Fake Coin Explorer

Transaction

0xa9cd088aba2131000da6f38a33c20169baee476218deea6b78720700b895b101
In BlockUnconfirmed
StatusSuccess
Value0 FAKE0.00 USD0.00 USD
Gas Used / Limit52025 / 78037
Gas Price0.00000004 FAKE0.00 USD0.00 USD (40 Gwei)
Fees0.002081 FAKE4.16 USD18.55 USD
RBFON
 
0 FAKE0.00 USD0.00 USD
ERC20 Token Transfers
Input Data

0xa9059cbb000000000000000000000000555ee11fbddc0e49a9bab358a8941ad95ffdb48f00000000000000000000000000000000000000000000021e19e0c9bab2400000
transfer(address, uint256)
#TypeData
0address0x555Ee11FBDDc0E49A9bAB358A8941AD95fFDB48f
1uint25610000000000000000000000
Raw Transaction
`, + `Trezor Fake Coin Explorer

Transaction

0xa9cd088aba2131000da6f38a33c20169baee476218deea6b78720700b895b101
In BlockUnconfirmed
StatusSuccess
Value0 FAKE0.00 USD0.00 USD
Gas Used / Limit52025 / 78037
Gas Price0.00000004 FAKE0.00 USD0.00 USD (40 Gwei)
Fees0.002081 FAKE4.16 USD18.55 USD
RBFON
Nonce208
 
0 FAKE0.00 USD0.00 USD
ERC20 Token Transfers
Input Data

0xa9059cbb000000000000000000000000555ee11fbddc0e49a9bab358a8941ad95ffdb48f00000000000000000000000000000000000000000000021e19e0c9bab2400000
transfer(address, uint256)
#TypeData
0address0x555Ee11FBDDc0E49A9bAB358A8941AD95fFDB48f
1uint25610000000000000000000000
Raw Transaction
`, }, }, { name: "explorerTokenDetail " + dbtestdata.EthAddr7b, diff --git a/static/templates/tx.html b/static/templates/tx.html index ab00268b..f148f984 100644 --- a/static/templates/tx.html +++ b/static/templates/tx.html @@ -117,6 +117,12 @@ {{end}} + {{if $tx.EthereumSpecific}} + + Nonce + {{$tx.EthereumSpecific.Nonce}} + + {{end}}
From a0960c8e1760497d9c04a0cd8507243cb208b181 Mon Sep 17 00:00:00 2001 From: Martin Boehm Date: Tue, 6 Aug 2024 10:50:01 +0200 Subject: [PATCH 13/56] Add network parameter to getInfo ws request --- api/types.go | 1 + api/worker.go | 1 + blockbook-api.ts | 5 + build/templates/blockbook/blockchaincfg.json | 2 + build/tools/templates.go | 1 + common/config.go | 1 + common/internalstate.go | 10 ++ configs/coins/bsc.json | 1 + configs/coins/bsc_archive.json | 1 + configs/coins/optimism.json | 129 +++++++++--------- configs/coins/optimism_archive.json | 135 ++++++++++--------- configs/coins/polygon.json | 1 + configs/coins/polygon_archive.json | 1 + db/rocksdb.go | 1 + server/public_test.go | 4 +- server/websocket.go | 5 +- server/ws_types.go | 1 + 17 files changed, 165 insertions(+), 135 deletions(-) diff --git a/api/types.go b/api/types.go index 6f5bb80f..c2839893 100644 --- a/api/types.go +++ b/api/types.go @@ -503,6 +503,7 @@ type BlockRaw struct { // BlockbookInfo contains information about the running blockbook instance type BlockbookInfo struct { Coin string `json:"coin"` + Network string `json:"network"` Host string `json:"host"` Version string `json:"version"` GitCommit string `json:"gitCommit"` diff --git a/api/worker.go b/api/worker.go index ed5a76da..799c90e8 100644 --- a/api/worker.go +++ b/api/worker.go @@ -2413,6 +2413,7 @@ func (w *Worker) GetSystemInfo(internal bool) (*SystemInfo, error) { } blockbookInfo := &BlockbookInfo{ Coin: w.is.Coin, + Network: w.is.GetNetwork(), Host: w.is.Host, Version: vi.Version, GitCommit: vi.GitCommit, diff --git a/blockbook-api.ts b/blockbook-api.ts index b69be708..2f08c6e7 100644 --- a/blockbook-api.ts +++ b/blockbook-api.ts @@ -33,6 +33,10 @@ export interface EthereumSpecific { gasLimit: number; gasUsed?: number; gasPrice?: string; + l1Fee?: number; + l1FeeScalar?: string; + l1GasPrice?: string; + l1GasUsed?: number; data?: string; parsedData?: EthereumParsedInputData; internalTransfers?: EthereumInternalTransfer[]; @@ -351,6 +355,7 @@ export interface WsBackendInfo { export interface WsInfoRes { name: string; shortcut: string; + network: string; decimals: number; version: string; bestHeight: number; diff --git a/build/templates/blockbook/blockchaincfg.json b/build/templates/blockbook/blockchaincfg.json index 525937c5..7d8fe75c 100644 --- a/build/templates/blockbook/blockchaincfg.json +++ b/build/templates/blockbook/blockchaincfg.json @@ -7,6 +7,8 @@ {{end}} "coin_name": "{{.Coin.Name}}", "coin_shortcut": "{{.Coin.Shortcut}}", +{{- if .Coin.Network}} + "network": "{{.Coin.Network}}",{{end}} "coin_label": "{{.Coin.Label}}", "rpc_url": "{{template "IPC.RPCURLTemplate" .}}", "rpc_user": "{{.IPC.RPCUser}}", diff --git a/build/tools/templates.go b/build/tools/templates.go index f414e5e1..8dfb9fb0 100644 --- a/build/tools/templates.go +++ b/build/tools/templates.go @@ -44,6 +44,7 @@ type Config struct { Coin struct { Name string `json:"name"` Shortcut string `json:"shortcut"` + Network string `json:"network,omitempty"` Label string `json:"label"` Alias string `json:"alias"` } `json:"coin"` diff --git a/common/config.go b/common/config.go index a0429805..2252b602 100644 --- a/common/config.go +++ b/common/config.go @@ -12,6 +12,7 @@ type Config struct { CoinName string `json:"coin_name"` CoinShortcut string `json:"coin_shortcut"` CoinLabel string `json:"coin_label"` + Network string `json:"network"` FourByteSignatures string `json:"fourByteSignatures"` FiatRates string `json:"fiat_rates"` FiatRatesParams string `json:"fiat_rates_params"` diff --git a/common/internalstate.go b/common/internalstate.go index 7c5c95ae..29a7a333 100644 --- a/common/internalstate.go +++ b/common/internalstate.go @@ -57,6 +57,7 @@ type InternalState struct { CoinShortcut string `json:"coinShortcut"` CoinLabel string `json:"coinLabel"` Host string `json:"host"` + Network string `json:"network,omitempty"` DbState uint32 `json:"dbState"` ExtendedIndex bool `json:"extendedIndex"` @@ -305,6 +306,15 @@ func (is *InternalState) computeAvgBlockPeriod() { is.AvgBlockPeriod = (is.BlockTimes[last] - is.BlockTimes[first]) / avgBlockPeriodSample } +// GetNetwork returns network. If not set returns the same value as CoinShortcut +func (is *InternalState) GetNetwork() string { + network := is.Network + if network == "" { + return is.CoinShortcut + } + return network +} + // SetBackendInfo sets new BackendInfo func (is *InternalState) SetBackendInfo(bi *BackendInfo) { is.mux.Lock() diff --git a/configs/coins/bsc.json b/configs/coins/bsc.json index a22923d8..8d15e80d 100644 --- a/configs/coins/bsc.json +++ b/configs/coins/bsc.json @@ -2,6 +2,7 @@ "coin": { "name": "BNB Smart Chain", "shortcut": "BNB", + "network": "BNB", "label": "BNB Smart Chain", "alias": "bsc" }, diff --git a/configs/coins/bsc_archive.json b/configs/coins/bsc_archive.json index b40584ea..df80c6d0 100644 --- a/configs/coins/bsc_archive.json +++ b/configs/coins/bsc_archive.json @@ -2,6 +2,7 @@ "coin": { "name": "BNB Smart Chain Archive", "shortcut": "BNB", + "network": "BNB", "label": "BNB Smart Chain", "alias": "bsc_archive" }, diff --git a/configs/coins/optimism.json b/configs/coins/optimism.json index 1c6c8ae9..07ab65ec 100644 --- a/configs/coins/optimism.json +++ b/configs/coins/optimism.json @@ -1,66 +1,67 @@ { - "coin": { - "name": "Optimism", - "shortcut": "ETH", - "label": "Optimism", - "alias": "optimism" - }, - "ports": { - "backend_rpc": 8200, - "backend_p2p": 38400, - "backend_http": 8300, - "backend_authrpc": 8400, - "blockbook_internal": 9200, - "blockbook_public": 9300 - }, - "ipc": { - "rpc_url_template": "ws://127.0.0.1:{{.Ports.BackendRPC}}", - "rpc_timeout": 25 - }, - "backend": { - "package_name": "backend-optimism", - "package_revision": "satoshilabs-1", - "system_user": "optimism", - "version": "1.101315.1", - "binary_url": "https://github.com/ethereum-optimism/op-geth/archive/refs/tags/v1.101315.1.tar.gz", - "verification_type": "sha256", - "verification_source": "f0f31ef2982f87f9e3eb90f2b603f5fcd9d680e487d35f5bdcf5aeba290b153f", - "extract_command": "mkdir backend/source && tar -C backend/source --strip 1 -xf v1.101315.1.tar.gz && cd backend/source && make geth && mv build/bin/geth ../ && rm -rf ../source && echo", - "exclude_files": [], - "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/optimism_exec.sh 2>> {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", - "exec_script": "optimism.sh", - "logrotate_files_template": "{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log", - "postinst_script_template": "openssl rand -hex 32 > {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/jwtsecret", - "service_type": "simple", - "service_additional_params_template": "", - "protect_memory": true, - "mainnet": true, - "server_config_file": "", - "client_config_file": "" - }, - "blockbook": { - "package_name": "blockbook-optimism", - "system_user": "blockbook-optimism", - "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, - "additional_params": { - "mempoolTxTimeoutHours": 48, - "queryBackendOnMempoolResync": false, - "fiat_rates": "coingecko", - "fiat_rates_vs_currencies": "AED,ARS,AUD,BDT,BHD,BMD,BRL,CAD,CHF,CLP,CNY,CZK,DKK,EUR,GBP,HKD,HUF,IDR,ILS,INR,JPY,KRW,KWD,LKR,MMK,MXN,MYR,NGN,NOK,NZD,PHP,PKR,PLN,RUB,SAR,SEK,SGD,THB,TRY,TWD,UAH,USD,VEF,VND,ZAR,BTC,ETH", - "fiat_rates_params": "{\"url\": \"https://api.coingecko.com/api/v3\", \"coin\": \"ethereum\",\"platformIdentifier\": \"ethereum\",\"platformVsCurrency\": \"eth\",\"periodSeconds\": 900}" - } + "coin": { + "name": "Optimism", + "shortcut": "ETH", + "network": "OP", + "label": "Optimism", + "alias": "optimism" + }, + "ports": { + "backend_rpc": 8200, + "backend_p2p": 38400, + "backend_http": 8300, + "backend_authrpc": 8400, + "blockbook_internal": 9200, + "blockbook_public": 9300 + }, + "ipc": { + "rpc_url_template": "ws://127.0.0.1:{{.Ports.BackendRPC}}", + "rpc_timeout": 25 + }, + "backend": { + "package_name": "backend-optimism", + "package_revision": "satoshilabs-1", + "system_user": "optimism", + "version": "1.101315.1", + "binary_url": "https://github.com/ethereum-optimism/op-geth/archive/refs/tags/v1.101315.1.tar.gz", + "verification_type": "sha256", + "verification_source": "f0f31ef2982f87f9e3eb90f2b603f5fcd9d680e487d35f5bdcf5aeba290b153f", + "extract_command": "mkdir backend/source && tar -C backend/source --strip 1 -xf v1.101315.1.tar.gz && cd backend/source && make geth && mv build/bin/geth ../ && rm -rf ../source && echo", + "exclude_files": [], + "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/optimism_exec.sh 2>> {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", + "exec_script": "optimism.sh", + "logrotate_files_template": "{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log", + "postinst_script_template": "openssl rand -hex 32 > {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/jwtsecret", + "service_type": "simple", + "service_additional_params_template": "", + "protect_memory": true, + "mainnet": true, + "server_config_file": "", + "client_config_file": "" + }, + "blockbook": { + "package_name": "blockbook-optimism", + "system_user": "blockbook-optimism", + "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, + "additional_params": { + "mempoolTxTimeoutHours": 48, + "queryBackendOnMempoolResync": false, + "fiat_rates": "coingecko", + "fiat_rates_vs_currencies": "AED,ARS,AUD,BDT,BHD,BMD,BRL,CAD,CHF,CLP,CNY,CZK,DKK,EUR,GBP,HKD,HUF,IDR,ILS,INR,JPY,KRW,KWD,LKR,MMK,MXN,MYR,NGN,NOK,NZD,PHP,PKR,PLN,RUB,SAR,SEK,SGD,THB,TRY,TWD,UAH,USD,VEF,VND,ZAR,BTC,ETH", + "fiat_rates_params": "{\"url\": \"https://api.coingecko.com/api/v3\", \"coin\": \"ethereum\",\"platformIdentifier\": \"ethereum\",\"platformVsCurrency\": \"eth\",\"periodSeconds\": 900}" + } + } + }, + "meta": { + "package_maintainer": "IT", + "package_maintainer_email": "it@satoshilabs.com" } - }, - "meta": { - "package_maintainer": "IT", - "package_maintainer_email": "it@satoshilabs.com" - } -} \ No newline at end of file +} diff --git a/configs/coins/optimism_archive.json b/configs/coins/optimism_archive.json index 9d9daac0..46967e5e 100644 --- a/configs/coins/optimism_archive.json +++ b/configs/coins/optimism_archive.json @@ -1,69 +1,70 @@ { - "coin": { - "name": "Optimism Archive", - "shortcut": "ETH", - "label": "Optimism", - "alias": "optimism_archive" - }, - "ports": { - "backend_rpc": 8202, - "backend_p2p": 38402, - "backend_http": 8302, - "backend_authrpc": 8402, - "blockbook_internal": 9202, - "blockbook_public": 9302 - }, - "ipc": { - "rpc_url_template": "ws://127.0.0.1:{{.Ports.BackendRPC}}", - "rpc_timeout": 25 - }, - "backend": { - "package_name": "backend-optimism-archive", - "package_revision": "satoshilabs-1", - "system_user": "optimism", - "version": "1.101315.1", - "binary_url": "https://github.com/ethereum-optimism/op-geth/archive/refs/tags/v1.101315.1.tar.gz", - "verification_type": "sha256", - "verification_source": "f0f31ef2982f87f9e3eb90f2b603f5fcd9d680e487d35f5bdcf5aeba290b153f", - "extract_command": "mkdir backend/source && tar -C backend/source --strip 1 -xf v1.101315.1.tar.gz && cd backend/source && make geth && mv build/bin/geth ../ && rm -rf ../source && echo", - "exclude_files": [], - "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/optimism_archive_exec.sh 2>> {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", - "exec_script": "optimism_archive.sh", - "logrotate_files_template": "{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log", - "postinst_script_template": "openssl rand -hex 32 > {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/jwtsecret", - "service_type": "simple", - "service_additional_params_template": "", - "protect_memory": true, - "mainnet": true, - "server_config_file": "", - "client_config_file": "" - }, - "blockbook": { - "package_name": "blockbook-optimism-archive", - "system_user": "blockbook-optimism", - "internal_binding_template": ":{{.Ports.BlockbookInternal}}", - "public_binding_template": ":{{.Ports.BlockbookPublic}}", - "explorer_url": "", - "additional_params": "-workers=16", - "block_chain": { - "parse": true, - "mempool_workers": 8, - "mempool_sub_workers": 2, - "block_addresses_to_keep": 600, - "additional_params": { - "address_aliases": true, - "mempoolTxTimeoutHours": 48, - "processInternalTransactions": true, - "queryBackendOnMempoolResync": false, - "fiat_rates": "coingecko", - "fiat_rates_vs_currencies": "AED,ARS,AUD,BDT,BHD,BMD,BRL,CAD,CHF,CLP,CNY,CZK,DKK,EUR,GBP,HKD,HUF,IDR,ILS,INR,JPY,KRW,KWD,LKR,MMK,MXN,MYR,NGN,NOK,NZD,PHP,PKR,PLN,RUB,SAR,SEK,SGD,THB,TRY,TWD,UAH,USD,VEF,VND,ZAR,BTC,ETH", - "fiat_rates_params": "{\"url\": \"https://api.coingecko.com/api/v3\", \"coin\": \"ethereum\",\"platformIdentifier\": \"ethereum\",\"platformVsCurrency\": \"eth\",\"periodSeconds\": 900}", - "fourByteSignatures": "https://www.4byte.directory/api/v1/signatures/" - } + "coin": { + "name": "Optimism Archive", + "shortcut": "ETH", + "network": "OP", + "label": "Optimism", + "alias": "optimism_archive" + }, + "ports": { + "backend_rpc": 8202, + "backend_p2p": 38402, + "backend_http": 8302, + "backend_authrpc": 8402, + "blockbook_internal": 9202, + "blockbook_public": 9302 + }, + "ipc": { + "rpc_url_template": "ws://127.0.0.1:{{.Ports.BackendRPC}}", + "rpc_timeout": 25 + }, + "backend": { + "package_name": "backend-optimism-archive", + "package_revision": "satoshilabs-1", + "system_user": "optimism", + "version": "1.101315.1", + "binary_url": "https://github.com/ethereum-optimism/op-geth/archive/refs/tags/v1.101315.1.tar.gz", + "verification_type": "sha256", + "verification_source": "f0f31ef2982f87f9e3eb90f2b603f5fcd9d680e487d35f5bdcf5aeba290b153f", + "extract_command": "mkdir backend/source && tar -C backend/source --strip 1 -xf v1.101315.1.tar.gz && cd backend/source && make geth && mv build/bin/geth ../ && rm -rf ../source && echo", + "exclude_files": [], + "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/optimism_archive_exec.sh 2>> {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", + "exec_script": "optimism_archive.sh", + "logrotate_files_template": "{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log", + "postinst_script_template": "openssl rand -hex 32 > {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/jwtsecret", + "service_type": "simple", + "service_additional_params_template": "", + "protect_memory": true, + "mainnet": true, + "server_config_file": "", + "client_config_file": "" + }, + "blockbook": { + "package_name": "blockbook-optimism-archive", + "system_user": "blockbook-optimism", + "internal_binding_template": ":{{.Ports.BlockbookInternal}}", + "public_binding_template": ":{{.Ports.BlockbookPublic}}", + "explorer_url": "", + "additional_params": "-workers=16", + "block_chain": { + "parse": true, + "mempool_workers": 8, + "mempool_sub_workers": 2, + "block_addresses_to_keep": 600, + "additional_params": { + "address_aliases": true, + "mempoolTxTimeoutHours": 48, + "processInternalTransactions": true, + "queryBackendOnMempoolResync": false, + "fiat_rates": "coingecko", + "fiat_rates_vs_currencies": "AED,ARS,AUD,BDT,BHD,BMD,BRL,CAD,CHF,CLP,CNY,CZK,DKK,EUR,GBP,HKD,HUF,IDR,ILS,INR,JPY,KRW,KWD,LKR,MMK,MXN,MYR,NGN,NOK,NZD,PHP,PKR,PLN,RUB,SAR,SEK,SGD,THB,TRY,TWD,UAH,USD,VEF,VND,ZAR,BTC,ETH", + "fiat_rates_params": "{\"url\": \"https://api.coingecko.com/api/v3\", \"coin\": \"ethereum\",\"platformIdentifier\": \"ethereum\",\"platformVsCurrency\": \"eth\",\"periodSeconds\": 900}", + "fourByteSignatures": "https://www.4byte.directory/api/v1/signatures/" + } + } + }, + "meta": { + "package_maintainer": "IT", + "package_maintainer_email": "it@satoshilabs.com" } - }, - "meta": { - "package_maintainer": "IT", - "package_maintainer_email": "it@satoshilabs.com" - } -} \ No newline at end of file +} diff --git a/configs/coins/polygon.json b/configs/coins/polygon.json index 1044b1e3..0237926a 100644 --- a/configs/coins/polygon.json +++ b/configs/coins/polygon.json @@ -2,6 +2,7 @@ "coin": { "name": "Polygon", "shortcut": "MATIC", + "network": "MATIC", "label": "Polygon", "alias": "polygon_bor" }, diff --git a/configs/coins/polygon_archive.json b/configs/coins/polygon_archive.json index 860dd01b..2533c9f3 100644 --- a/configs/coins/polygon_archive.json +++ b/configs/coins/polygon_archive.json @@ -2,6 +2,7 @@ "coin": { "name": "Polygon Archive", "shortcut": "MATIC", + "network": "MATIC", "label": "Polygon", "alias": "polygon_archive_bor" }, diff --git a/db/rocksdb.go b/db/rocksdb.go index 9c5a3b2f..58e269d7 100644 --- a/db/rocksdb.go +++ b/db/rocksdb.go @@ -1962,6 +1962,7 @@ func (d *RocksDB) LoadInternalState(config *common.Config) (*common.InternalStat } else { is.CoinLabel = config.CoinLabel } + is.Network = config.Network return is, nil } diff --git a/server/public_test.go b/server/public_test.go index 107a4a9c..84d5e1ca 100644 --- a/server/public_test.go +++ b/server/public_test.go @@ -1039,7 +1039,7 @@ var websocketTestsBitcoinType = []websocketTest{ req: websocketReq{ Method: "getInfo", }, - want: `{"id":"0","data":{"name":"Fakecoin","shortcut":"FAKE","decimals":8,"version":"unknown","bestHeight":225494,"bestHash":"00000000eb0443fd7dc4a1ed5c686a8e995057805f9a161d9a5a77a95e72b7b6","block0Hash":"","testnet":true,"backend":{"version":"001001","subversion":"/Fakecoin:0.0.1/"}}}`, + want: `{"id":"0","data":{"name":"Fakecoin","shortcut":"FAKE","network":"FAKE","decimals":8,"version":"unknown","bestHeight":225494,"bestHash":"00000000eb0443fd7dc4a1ed5c686a8e995057805f9a161d9a5a77a95e72b7b6","block0Hash":"","testnet":true,"backend":{"version":"001001","subversion":"/Fakecoin:0.0.1/"}}}`, }, { name: "websocket getBlockHash", @@ -1681,7 +1681,7 @@ var websocketTestsBitcoinTypeExtendedIndex = []websocketTest{ req: websocketReq{ Method: "getInfo", }, - want: `{"id":"0","data":{"name":"Fakecoin","shortcut":"FAKE","decimals":8,"version":"unknown","bestHeight":225494,"bestHash":"00000000eb0443fd7dc4a1ed5c686a8e995057805f9a161d9a5a77a95e72b7b6","block0Hash":"","testnet":true,"backend":{"version":"001001","subversion":"/Fakecoin:0.0.1/"}}}`, + want: `{"id":"0","data":{"name":"Fakecoin","shortcut":"FAKE","network":"FAKE","decimals":8,"version":"unknown","bestHeight":225494,"bestHash":"00000000eb0443fd7dc4a1ed5c686a8e995057805f9a161d9a5a77a95e72b7b6","block0Hash":"","testnet":true,"backend":{"version":"001001","subversion":"/Fakecoin:0.0.1/"}}}`, }, { name: "websocket getBlockHash", diff --git a/server/websocket.go b/server/websocket.go index cba5f27d..9e628222 100644 --- a/server/websocket.go +++ b/server/websocket.go @@ -277,8 +277,8 @@ var requestHandlers = map[string]func(*WebsocketServer, *websocketChannel, *WsRe c.getAddressInfoDescriptorsMux.Unlock() if l > s.is.WsGetAccountInfoLimit { if s.closeChannel(c) { - glog.Info("Client ", c.id, " exceeded getAddressInfo limit, ", c.ip) - s.is.AddWsLimitExceedingIP(c.ip) + glog.Info("Client ", c.id, " exceeded getAddressInfo limit, ", c.ip) + s.is.AddWsLimitExceedingIP(c.ip) } return } @@ -580,6 +580,7 @@ func (s *WebsocketServer) getInfo() (*WsInfoRes, error) { return &WsInfoRes{ Name: s.is.Coin, Shortcut: s.is.CoinShortcut, + Network: s.is.GetNetwork(), Decimals: s.chainParser.AmountDecimals(), BestHeight: int(height), BestHash: hash, diff --git a/server/ws_types.go b/server/ws_types.go index d91a2a56..0ebe0d19 100644 --- a/server/ws_types.go +++ b/server/ws_types.go @@ -36,6 +36,7 @@ type WsBackendInfo struct { type WsInfoRes struct { Name string `json:"name"` Shortcut string `json:"shortcut"` + Network string `json:"network"` Decimals int `json:"decimals"` Version string `json:"version"` BestHeight int `json:"bestHeight"` From 424055d6893cf3e9015f4b139722668406cb6e49 Mon Sep 17 00:00:00 2001 From: JoHnY Date: Mon, 12 Aug 2024 08:37:03 +0000 Subject: [PATCH 14/56] =?UTF-8?q?polygon-bor=201.3.2=20=E2=86=92=201.3.7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- configs/coins/polygon.json | 10 +++++----- configs/coins/polygon_archive.json | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/configs/coins/polygon.json b/configs/coins/polygon.json index 0237926a..9918e1cf 100644 --- a/configs/coins/polygon.json +++ b/configs/coins/polygon.json @@ -21,16 +21,16 @@ "package_name": "backend-polygon-bor", "package_revision": "satoshilabs-1", "system_user": "polygon", - "version": "1.3.2", - "binary_url": "https://github.com/maticnetwork/bor/archive/refs/tags/v1.3.2.tar.gz", + "version": "1.3.7", + "binary_url": "https://github.com/maticnetwork/bor/archive/refs/tags/v1.3.7.tar.gz", "verification_type": "sha256", - "verification_source": "bcd662d003a3aaa704b0226afcf0dac040de5f054de09e3ef1f5a0c494cdbc0f", - "extract_command": "mkdir backend/source && tar -C backend/source --strip 1 -xf v1.3.2.tar.gz && cd backend/source && make bor && mv build/bin/bor ../ && rm -rf ../source && echo", + "verification_source": "189b6086ba0c09a82d2ac790a748b2a8ee613a08b89e5d15f976374f6cede13a", + "extract_command": "mkdir backend/source && tar -C backend/source --strip 1 -xf v1.3.7.tar.gz && cd backend/source && make bor && mv build/bin/bor ../ && rm -rf ../source && echo", "exclude_files": [], "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/polygon_bor_exec.sh 2>> {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", "exec_script": "polygon_bor.sh", "logrotate_files_template": "{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log", - "postinst_script_template": "wget https://raw.githubusercontent.com/maticnetwork/bor/v1.3.2/builder/files/genesis-mainnet-v1.json -O {{.Env.BackendInstallPath}}/{{.Coin.Alias}}/genesis.json", + "postinst_script_template": "wget https://raw.githubusercontent.com/maticnetwork/bor/v1.3.7/builder/files/genesis-mainnet-v1.json -O {{.Env.BackendInstallPath}}/{{.Coin.Alias}}/genesis.json", "service_type": "simple", "service_additional_params_template": "", "protect_memory": true, diff --git a/configs/coins/polygon_archive.json b/configs/coins/polygon_archive.json index 2533c9f3..ba29b847 100644 --- a/configs/coins/polygon_archive.json +++ b/configs/coins/polygon_archive.json @@ -21,16 +21,16 @@ "package_name": "backend-polygon-archive-bor", "package_revision": "satoshilabs-1", "system_user": "polygon", - "version": "1.3.2", - "binary_url": "https://github.com/maticnetwork/bor/archive/refs/tags/v1.3.2.tar.gz", + "version": "1.3.7", + "binary_url": "https://github.com/maticnetwork/bor/archive/refs/tags/v1.3.7.tar.gz", "verification_type": "sha256", - "verification_source": "bcd662d003a3aaa704b0226afcf0dac040de5f054de09e3ef1f5a0c494cdbc0f", - "extract_command": "mkdir backend/source && tar -C backend/source --strip 1 -xf v1.3.2.tar.gz && cd backend/source && make bor && mv build/bin/bor ../ && rm -rf ../source && echo", + "verification_source": "189b6086ba0c09a82d2ac790a748b2a8ee613a08b89e5d15f976374f6cede13a", + "extract_command": "mkdir backend/source && tar -C backend/source --strip 1 -xf v1.3.7.tar.gz && cd backend/source && make bor && mv build/bin/bor ../ && rm -rf ../source && echo", "exclude_files": [], "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/polygon_archive_bor_exec.sh 2>> {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", "exec_script": "polygon_archive_bor.sh", "logrotate_files_template": "{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log", - "postinst_script_template": "wget https://raw.githubusercontent.com/maticnetwork/bor/v1.3.2/builder/files/genesis-mainnet-v1.json -O {{.Env.BackendInstallPath}}/{{.Coin.Alias}}/genesis.json", + "postinst_script_template": "wget https://raw.githubusercontent.com/maticnetwork/bor/v1.3.7/builder/files/genesis-mainnet-v1.json -O {{.Env.BackendInstallPath}}/{{.Coin.Alias}}/genesis.json", "service_type": "simple", "service_additional_params_template": "", "protect_memory": true, From 3cb815ba277d2550d1a790cd5a605414f037d121 Mon Sep 17 00:00:00 2001 From: JoHnY Date: Tue, 27 Aug 2024 07:10:44 +0000 Subject: [PATCH 15/56] =?UTF-8?q?prysm=205.0.4=20=E2=86=92=205.1.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- configs/coins/ethereum_archive_consensus.json | 10 +++++----- configs/coins/ethereum_consensus.json | 10 +++++----- .../ethereum_testnet_holesky_archive_consensus.json | 10 +++++----- configs/coins/ethereum_testnet_holesky_consensus.json | 10 +++++----- .../ethereum_testnet_sepolia_archive_consensus.json | 10 +++++----- configs/coins/ethereum_testnet_sepolia_consensus.json | 10 +++++----- 6 files changed, 30 insertions(+), 30 deletions(-) diff --git a/configs/coins/ethereum_archive_consensus.json b/configs/coins/ethereum_archive_consensus.json index 6534e3f6..744350ca 100644 --- a/configs/coins/ethereum_archive_consensus.json +++ b/configs/coins/ethereum_archive_consensus.json @@ -19,10 +19,10 @@ "package_name": "backend-ethereum-archive-consensus", "package_revision": "satoshilabs-1", "system_user": "ethereum", - "version": "5.0.4", - "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.0.4/beacon-chain-v5.0.4-linux-amd64", + "version": "5.1.0", + "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.1.0/beacon-chain-v5.1.0-linux-amd64", "verification_type": "sha256", - "verification_source": "5e51589ea9e53d90690dd26aaad9f7ee01f8c760082521438f7a4f05028dfc9f", + "verification_source": "bc59aabe40d32959692dba260003fc5004775ac0f7fa2513a66fc28dc2f4717f", "extract_command": "mv ${ARCHIVE} backend/beacon-chain && chmod +x backend/beacon-chain && echo", "exclude_files": [], "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/beacon-chain --mainnet --accept-terms-of-use --execution-endpoint=http://localhost:{{.Ports.BackendAuthRpc}} --grpc-gateway-port=7516 --rpc-port=7517 --monitoring-port=7518 --p2p-tcp-port=3516 --p2p-udp-port=2516 --datadir={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend --jwt-secret={{.Env.BackendDataPath}}/ethereum_archive/backend/erigon/jwt.hex 2>>{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", @@ -36,8 +36,8 @@ "client_config_file": "", "platforms": { "arm64": { - "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.0.4/beacon-chain-v5.0.4-linux-arm64", - "verification_source": "2d8c925d35aebd193f29f763dca879c190db9567a12f03f6ca17f471378104df" + "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.1.0/beacon-chain-v5.1.0-linux-arm64", + "verification_source": "74eb6c423316074641367d5655bb84bc7ae117ff6e58d95ef9d48d065eef00ef" } } }, diff --git a/configs/coins/ethereum_consensus.json b/configs/coins/ethereum_consensus.json index 42383b53..8a80eca9 100644 --- a/configs/coins/ethereum_consensus.json +++ b/configs/coins/ethereum_consensus.json @@ -19,10 +19,10 @@ "package_name": "backend-ethereum-consensus", "package_revision": "satoshilabs-1", "system_user": "ethereum", - "version": "5.0.4", - "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.0.4/beacon-chain-v5.0.4-linux-amd64", + "version": "5.1.0", + "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.1.0/beacon-chain-v5.1.0-linux-amd64", "verification_type": "sha256", - "verification_source": "5e51589ea9e53d90690dd26aaad9f7ee01f8c760082521438f7a4f05028dfc9f", + "verification_source": "bc59aabe40d32959692dba260003fc5004775ac0f7fa2513a66fc28dc2f4717f", "extract_command": "mv ${ARCHIVE} backend/beacon-chain && chmod +x backend/beacon-chain && echo", "exclude_files": [], "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/beacon-chain --mainnet --accept-terms-of-use --execution-endpoint=http://localhost:{{.Ports.BackendAuthRpc}} --grpc-gateway-port=7536 --rpc-port=7537 --monitoring-port=7538 --p2p-tcp-port=3536 --p2p-udp-port=2536 --datadir={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend --jwt-secret={{.Env.BackendDataPath}}/ethereum/backend/erigon/jwt.hex 2>>{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", @@ -36,8 +36,8 @@ "client_config_file": "", "platforms": { "arm64": { - "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.0.2/beacon-chain-v5.0.2-linux-arm64", - "verification_source": "dcabf9ecd9e6835f04d81d8317d640fdb3a223cb462c8764f0ea167a3ff3230e" + "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.1.0/beacon-chain-v5.1.0-linux-arm64", + "verification_source": "74eb6c423316074641367d5655bb84bc7ae117ff6e58d95ef9d48d065eef00ef" } } }, diff --git a/configs/coins/ethereum_testnet_holesky_archive_consensus.json b/configs/coins/ethereum_testnet_holesky_archive_consensus.json index 2c5ec441..d9d6e325 100644 --- a/configs/coins/ethereum_testnet_holesky_archive_consensus.json +++ b/configs/coins/ethereum_testnet_holesky_archive_consensus.json @@ -23,10 +23,10 @@ "package_name": "backend-ethereum-testnet-holesky-archive-consensus", "package_revision": "satoshilabs-1", "system_user": "ethereum", - "version": "5.0.4", - "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.0.4/beacon-chain-v5.0.4-linux-amd64", + "version": "5.1.0", + "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.1.0/beacon-chain-v5.1.0-linux-amd64", "verification_type": "sha256", - "verification_source": "5e51589ea9e53d90690dd26aaad9f7ee01f8c760082521438f7a4f05028dfc9f", + "verification_source": "bc59aabe40d32959692dba260003fc5004775ac0f7fa2513a66fc28dc2f4717f", "extract_command": "mv ${ARCHIVE} backend/beacon-chain && chmod +x backend/beacon-chain && echo", "exclude_files": [], "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/beacon-chain --holesky --accept-terms-of-use --execution-endpoint=http://localhost:{{.Ports.BackendAuthRpc}} --grpc-gateway-port=17536 --rpc-port=17537 --monitoring-port=17538 --p2p-tcp-port=13636 --p2p-udp-port=12636 --datadir={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend --jwt-secret={{.Env.BackendDataPath}}/ethereum_testnet_holesky_archive/backend/erigon/jwt.hex --genesis-state={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/genesis.ssz 2>>{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", @@ -40,8 +40,8 @@ "client_config_file": "", "platforms": { "arm64": { - "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.0.4/beacon-chain-v5.0.4-linux-arm64", - "verification_source": "2d8c925d35aebd193f29f763dca879c190db9567a12f03f6ca17f471378104df" + "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.1.0/beacon-chain-v5.1.0-linux-arm64", + "verification_source": "74eb6c423316074641367d5655bb84bc7ae117ff6e58d95ef9d48d065eef00ef" } } }, diff --git a/configs/coins/ethereum_testnet_holesky_consensus.json b/configs/coins/ethereum_testnet_holesky_consensus.json index 8f113d85..94314490 100644 --- a/configs/coins/ethereum_testnet_holesky_consensus.json +++ b/configs/coins/ethereum_testnet_holesky_consensus.json @@ -23,10 +23,10 @@ "package_name": "backend-ethereum-testnet-holesky-consensus", "package_revision": "satoshilabs-1", "system_user": "ethereum", - "version": "5.0.4", - "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.0.4/beacon-chain-v5.0.4-linux-amd64", + "version": "5.1.0", + "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.1.0/beacon-chain-v5.1.0-linux-amd64", "verification_type": "sha256", - "verification_source": "5e51589ea9e53d90690dd26aaad9f7ee01f8c760082521438f7a4f05028dfc9f", + "verification_source": "bc59aabe40d32959692dba260003fc5004775ac0f7fa2513a66fc28dc2f4717f", "extract_command": "mv ${ARCHIVE} backend/beacon-chain && chmod +x backend/beacon-chain && echo", "exclude_files": [], "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/beacon-chain --holesky --accept-terms-of-use --execution-endpoint=http://localhost:{{.Ports.BackendAuthRpc}} --grpc-gateway-port=17516 --rpc-port=17517 --monitoring-port=17518 --p2p-tcp-port=13516 --p2p-udp-port=12516 --datadir={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend --jwt-secret={{.Env.BackendDataPath}}/ethereum_testnet_holesky/backend/erigon/jwt.hex --genesis-state={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/genesis.ssz 2>>{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", @@ -40,8 +40,8 @@ "client_config_file": "", "platforms": { "arm64": { - "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.0.4/beacon-chain-v5.0.4-linux-arm64", - "verification_source": "2d8c925d35aebd193f29f763dca879c190db9567a12f03f6ca17f471378104df" + "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.1.0/beacon-chain-v5.1.0-linux-arm64", + "verification_source": "74eb6c423316074641367d5655bb84bc7ae117ff6e58d95ef9d48d065eef00ef" } } }, diff --git a/configs/coins/ethereum_testnet_sepolia_archive_consensus.json b/configs/coins/ethereum_testnet_sepolia_archive_consensus.json index 5279e8fe..1faa700c 100644 --- a/configs/coins/ethereum_testnet_sepolia_archive_consensus.json +++ b/configs/coins/ethereum_testnet_sepolia_archive_consensus.json @@ -23,10 +23,10 @@ "package_name": "backend-ethereum-testnet-sepolia-archive-consensus", "package_revision": "satoshilabs-1", "system_user": "ethereum", - "version": "5.0.4", - "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.0.4/beacon-chain-v5.0.4-linux-amd64", + "version": "5.1.0", + "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.1.0/beacon-chain-v5.1.0-linux-amd64", "verification_type": "sha256", - "verification_source": "5e51589ea9e53d90690dd26aaad9f7ee01f8c760082521438f7a4f05028dfc9f", + "verification_source": "bc59aabe40d32959692dba260003fc5004775ac0f7fa2513a66fc28dc2f4717f", "extract_command": "mv ${ARCHIVE} backend/beacon-chain && chmod +x backend/beacon-chain && echo", "exclude_files": [], "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/beacon-chain --sepolia --accept-terms-of-use --execution-endpoint=http://localhost:{{.Ports.BackendAuthRpc}} --grpc-gateway-port=17586 --rpc-port=17587 --monitoring-port=17548 --p2p-tcp-port=13676 --p2p-udp-port=12676 --datadir={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend --jwt-secret={{.Env.BackendDataPath}}/ethereum_testnet_sepolia_archive/backend/erigon/jwt.hex --genesis-state={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/genesis.ssz 2>>{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", @@ -40,8 +40,8 @@ "client_config_file": "", "platforms": { "arm64": { - "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.0.4/beacon-chain-v5.0.4-linux-arm64", - "verification_source": "2d8c925d35aebd193f29f763dca879c190db9567a12f03f6ca17f471378104df" + "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.1.0/beacon-chain-v5.1.0-linux-arm64", + "verification_source": "74eb6c423316074641367d5655bb84bc7ae117ff6e58d95ef9d48d065eef00ef" } } }, diff --git a/configs/coins/ethereum_testnet_sepolia_consensus.json b/configs/coins/ethereum_testnet_sepolia_consensus.json index 623f0a5b..106b7a30 100644 --- a/configs/coins/ethereum_testnet_sepolia_consensus.json +++ b/configs/coins/ethereum_testnet_sepolia_consensus.json @@ -23,10 +23,10 @@ "package_name": "backend-ethereum-testnet-sepolia-consensus", "package_revision": "satoshilabs-1", "system_user": "ethereum", - "version": "5.0.2", - "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.0.2/beacon-chain-v5.0.2-linux-amd64", + "version": "5.1.0", + "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.1.0/beacon-chain-v5.1.0-linux-amd64", "verification_type": "sha256", - "verification_source": "f3515bdd216a34e54b178d03ced311e4c86cee1a1d0f84fb8bffa682244916b4", + "verification_source": "bc59aabe40d32959692dba260003fc5004775ac0f7fa2513a66fc28dc2f4717f", "extract_command": "mv ${ARCHIVE} backend/beacon-chain && chmod +x backend/beacon-chain && echo", "exclude_files": [], "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/beacon-chain --sepolia --accept-terms-of-use --execution-endpoint=http://localhost:{{.Ports.BackendAuthRpc}} --grpc-gateway-port=17576 --rpc-port=17577 --monitoring-port=17578 --p2p-tcp-port=13576 --p2p-udp-port=12576 --datadir={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend --jwt-secret={{.Env.BackendDataPath}}/ethereum_testnet_sepolia/backend/erigon/jwt.hex --genesis-state={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/genesis.ssz 2>>{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", @@ -40,8 +40,8 @@ "client_config_file": "", "platforms": { "arm64": { - "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.0.2/beacon-chain-v5.0.2-linux-arm64", - "verification_source": "dcabf9ecd9e6835f04d81d8317d640fdb3a223cb462c8764f0ea167a3ff3230e" + "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.1.0/beacon-chain-v5.1.0-linux-arm64", + "verification_source": "74eb6c423316074641367d5655bb84bc7ae117ff6e58d95ef9d48d065eef00ef" } } }, From 345ea17031efe13f34a6266c0bac79656248a129 Mon Sep 17 00:00:00 2001 From: JoHnY Date: Fri, 30 Aug 2024 07:49:07 +0000 Subject: [PATCH 16/56] =?UTF-8?q?zcash=205.9.1=20=E2=86=92=205.10.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- configs/coins/zcash.json | 6 +++--- configs/coins/zcash_testnet.json | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/configs/coins/zcash.json b/configs/coins/zcash.json index fdf43d3d..0e010986 100644 --- a/configs/coins/zcash.json +++ b/configs/coins/zcash.json @@ -22,10 +22,10 @@ "package_name": "backend-zcash", "package_revision": "satoshilabs-1", "system_user": "zcash", - "version": "5.9.1", - "binary_url": "https://github.com/zcash/artifacts/raw/master/v5.9.1/bullseye/zcash-5.9.1-linux64-debian-bullseye.tar.gz", + "version": "5.10.0", + "binary_url": "https://download.z.cash/downloads/zcash-5.10.0-linux64-debian-bullseye.tar.gz", "verification_type": "sha256", - "verification_source": "1911d4da83781dfe9d50fb4e0e5bab14fddca6e648f861563a629583182f478e", + "verification_source": "72d06e97bab29b2a21fc52637485840335fd7fff3f5f06ad9f66c326d3f7ca1f", "extract_command": "tar -C backend --strip 1 -xf", "exclude_files": [], "exec_command_template": "{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/bin/zcashd -datadir={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend -conf={{.Env.BackendInstallPath}}/{{.Coin.Alias}}/{{.Coin.Alias}}.conf -pid=/run/{{.Coin.Alias}}/{{.Coin.Alias}}.pid", diff --git a/configs/coins/zcash_testnet.json b/configs/coins/zcash_testnet.json index 89125fe3..ca5d3a4c 100644 --- a/configs/coins/zcash_testnet.json +++ b/configs/coins/zcash_testnet.json @@ -21,10 +21,10 @@ "backend": { "package_name": "backend-zcash-testnet", "package_revision": "satoshilabs-1", - "version": "5.9.1", - "binary_url": "https://github.com/zcash/artifacts/raw/master/v5.9.1/bullseye/zcash-5.9.1-linux64-debian-bullseye.tar.gz", + "version": "5.10.0", + "binary_url": "https://download.z.cash/downloads/zcash-5.10.0-linux64-debian-bullseye.tar.gz", "verification_type": "sha256", - "verification_source": "1911d4da83781dfe9d50fb4e0e5bab14fddca6e648f861563a629583182f478e", + "verification_source": "72d06e97bab29b2a21fc52637485840335fd7fff3f5f06ad9f66c326d3f7ca1f", "extract_command": "tar -C backend --strip 1 -xf", "exclude_files": [], "exec_command_template": "{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/bin/zcashd -datadir={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend -conf={{.Env.BackendInstallPath}}/{{.Coin.Alias}}/{{.Coin.Alias}}.conf -pid=/run/{{.Coin.Alias}}/{{.Coin.Alias}}.pid", From a1434979fa0c847ee8502580a939224ded2d5a4a Mon Sep 17 00:00:00 2001 From: JoHnY Date: Tue, 24 Sep 2024 06:48:51 +0000 Subject: [PATCH 17/56] =?UTF-8?q?polygon-bor=201.3.7=20=E2=86=92=201.4.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- configs/coins/polygon.json | 10 +++++----- configs/coins/polygon_archive.json | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/configs/coins/polygon.json b/configs/coins/polygon.json index 9918e1cf..3e92d326 100644 --- a/configs/coins/polygon.json +++ b/configs/coins/polygon.json @@ -21,16 +21,16 @@ "package_name": "backend-polygon-bor", "package_revision": "satoshilabs-1", "system_user": "polygon", - "version": "1.3.7", - "binary_url": "https://github.com/maticnetwork/bor/archive/refs/tags/v1.3.7.tar.gz", + "version": "1.4.0", + "binary_url": "https://github.com/maticnetwork/bor/archive/refs/tags/v1.4.0.tar.gz", "verification_type": "sha256", - "verification_source": "189b6086ba0c09a82d2ac790a748b2a8ee613a08b89e5d15f976374f6cede13a", - "extract_command": "mkdir backend/source && tar -C backend/source --strip 1 -xf v1.3.7.tar.gz && cd backend/source && make bor && mv build/bin/bor ../ && rm -rf ../source && echo", + "verification_source": "d072bbcae0993a5770e65c6a7936baea0f1b3d8ee5c4de56a86b9776eacd6fed", + "extract_command": "mkdir backend/source && tar -C backend/source --strip 1 -xf v1.4.0.tar.gz && cd backend/source && make bor && mv build/bin/bor ../ && rm -rf ../source && echo", "exclude_files": [], "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/polygon_bor_exec.sh 2>> {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", "exec_script": "polygon_bor.sh", "logrotate_files_template": "{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log", - "postinst_script_template": "wget https://raw.githubusercontent.com/maticnetwork/bor/v1.3.7/builder/files/genesis-mainnet-v1.json -O {{.Env.BackendInstallPath}}/{{.Coin.Alias}}/genesis.json", + "postinst_script_template": "wget https://raw.githubusercontent.com/maticnetwork/bor/v1.4.0/builder/files/genesis-mainnet-v1.json -O {{.Env.BackendInstallPath}}/{{.Coin.Alias}}/genesis.json", "service_type": "simple", "service_additional_params_template": "", "protect_memory": true, diff --git a/configs/coins/polygon_archive.json b/configs/coins/polygon_archive.json index ba29b847..95ae26ea 100644 --- a/configs/coins/polygon_archive.json +++ b/configs/coins/polygon_archive.json @@ -21,16 +21,16 @@ "package_name": "backend-polygon-archive-bor", "package_revision": "satoshilabs-1", "system_user": "polygon", - "version": "1.3.7", - "binary_url": "https://github.com/maticnetwork/bor/archive/refs/tags/v1.3.7.tar.gz", + "version": "1.4.0", + "binary_url": "https://github.com/maticnetwork/bor/archive/refs/tags/v1.4.0.tar.gz", "verification_type": "sha256", - "verification_source": "189b6086ba0c09a82d2ac790a748b2a8ee613a08b89e5d15f976374f6cede13a", - "extract_command": "mkdir backend/source && tar -C backend/source --strip 1 -xf v1.3.7.tar.gz && cd backend/source && make bor && mv build/bin/bor ../ && rm -rf ../source && echo", + "verification_source": "d072bbcae0993a5770e65c6a7936baea0f1b3d8ee5c4de56a86b9776eacd6fed", + "extract_command": "mkdir backend/source && tar -C backend/source --strip 1 -xf v1.4.0.tar.gz && cd backend/source && make bor && mv build/bin/bor ../ && rm -rf ../source && echo", "exclude_files": [], "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/polygon_archive_bor_exec.sh 2>> {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", "exec_script": "polygon_archive_bor.sh", "logrotate_files_template": "{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log", - "postinst_script_template": "wget https://raw.githubusercontent.com/maticnetwork/bor/v1.3.7/builder/files/genesis-mainnet-v1.json -O {{.Env.BackendInstallPath}}/{{.Coin.Alias}}/genesis.json", + "postinst_script_template": "wget https://raw.githubusercontent.com/maticnetwork/bor/v1.4.0/builder/files/genesis-mainnet-v1.json -O {{.Env.BackendInstallPath}}/{{.Coin.Alias}}/genesis.json", "service_type": "simple", "service_additional_params_template": "", "protect_memory": true, From 3cf7e6abe8e07c7c9419bcd462c7b6c87c2d4f6c Mon Sep 17 00:00:00 2001 From: Martin Boehm Date: Fri, 6 Sep 2024 14:06:02 +0200 Subject: [PATCH 18/56] Add ethCall websocket request --- README.md | 4 + bchain/basechain.go | 5 + bchain/coins/blockchain.go | 6 + bchain/coins/eth/contract.go | 21 +- bchain/coins/eth/stakingpool.go | 2 +- bchain/types.go | 1 + blockbook-api.ts | 9 + build/tools/typescriptify/typescriptify.go | 2 + docs/env.md | 11 + server/public_ethereumtype_test.go | 22 + server/public_test.go | 17 +- server/websocket.go | 32 + server/ws_types.go | 10 + static/test-websocket.html | 2078 ++++++++++++-------- tests/dbtestdata/fakechain_ethereumtype.go | 5 + 15 files changed, 1409 insertions(+), 816 deletions(-) create mode 100644 docs/env.md diff --git a/README.md b/README.md index b9c2c4d6..3cc41cb1 100644 --- a/README.md +++ b/README.md @@ -74,3 +74,7 @@ Blockbook stores data the key-value store RocksDB. Database format is described ## API Blockbook API is described [here](/docs/api.md). + +## Environment variables + +List of environment variables that affect Blockbook's behavior is [here](/docs/env.md). diff --git a/bchain/basechain.go b/bchain/basechain.go index cecd2954..df494531 100644 --- a/bchain/basechain.go +++ b/bchain/basechain.go @@ -76,3 +76,8 @@ func (b *BaseChain) EthereumTypeGetSupportedStakingPools() []string { func (b *BaseChain) EthereumTypeGetStakingPoolsData(addrDesc AddressDescriptor) ([]StakingPoolData, error) { return nil, errors.New("not supported") } + +// EthereumTypeEthCall calls eth_call with given data and to address +func (b *BaseChain) EthereumTypeEthCall(data, to, from string) (string, error) { + return "", errors.New("not supported") +} diff --git a/bchain/coins/blockchain.go b/bchain/coins/blockchain.go index dcb51667..cdc877ca 100644 --- a/bchain/coins/blockchain.go +++ b/bchain/coins/blockchain.go @@ -342,6 +342,12 @@ func (c *blockChainWithMetrics) EthereumTypeGetStakingPoolsData(addrDesc bchain. return c.b.EthereumTypeGetStakingPoolsData(addrDesc) } +// EthereumTypeEthCall calls eth_call with given data and to address +func (c *blockChainWithMetrics) EthereumTypeEthCall(data, to, from string) (v string, err error) { + defer func(s time.Time) { c.observeRPCLatency("EthereumTypeEthCall", s, err) }(time.Now()) + return c.b.EthereumTypeEthCall(data, to, from) +} + type mempoolWithMetrics struct { mempool bchain.Mempool m *common.Metrics diff --git a/bchain/coins/eth/contract.go b/bchain/coins/eth/contract.go index 34916346..0d3bd237 100644 --- a/bchain/coins/eth/contract.go +++ b/bchain/coins/eth/contract.go @@ -273,14 +273,19 @@ func contractGetTransfersFromTx(tx *bchain.RpcTransaction) (bchain.TokenTransfer return r, nil } -func (b *EthereumRPC) ethCall(data, to string) (string, error) { +// EthereumTypeEthCall calls eth_call with given data and to address +func (b *EthereumRPC) EthereumTypeEthCall(data, to, from string) (string, error) { ctx, cancel := context.WithTimeout(context.Background(), b.Timeout) defer cancel() var r string - err := b.RPC.CallContext(ctx, &r, "eth_call", map[string]interface{}{ + args := map[string]interface{}{ "data": data, "to": to, - }, "latest") + } + if from != "" { + args["from"] = from + } + err := b.RPC.CallContext(ctx, &r, "eth_call", args, "latest") if err != nil { return "", err } @@ -289,7 +294,7 @@ func (b *EthereumRPC) ethCall(data, to string) (string, error) { func (b *EthereumRPC) fetchContractInfo(address string) (*bchain.ContractInfo, error) { var contract bchain.ContractInfo - data, err := b.ethCall(contractNameSignature, address) + data, err := b.EthereumTypeEthCall(contractNameSignature, address, "") if err != nil { // ignore the error from the eth_call - since geth v1.9.15 they changed the behavior // and returning error "execution reverted" for some non contract addresses @@ -300,14 +305,14 @@ func (b *EthereumRPC) fetchContractInfo(address string) (*bchain.ContractInfo, e } name := strings.TrimSpace(parseSimpleStringProperty(data)) if name != "" { - data, err = b.ethCall(contractSymbolSignature, address) + data, err = b.EthereumTypeEthCall(contractSymbolSignature, address, "") if err != nil { // glog.Warning(errors.Annotatef(err, "Contract SymbolSignature %v", address)) return nil, nil // return nil, errors.Annotatef(err, "erc20SymbolSignature %v", address) } symbol := strings.TrimSpace(parseSimpleStringProperty(data)) - data, _ = b.ethCall(contractDecimalsSignature, address) + data, _ = b.EthereumTypeEthCall(contractDecimalsSignature, address, "") // if err != nil { // glog.Warning(errors.Annotatef(err, "Contract DecimalsSignature %v", address)) // // return nil, errors.Annotatef(err, "erc20DecimalsSignature %v", address) @@ -340,7 +345,7 @@ func (b *EthereumRPC) EthereumTypeGetErc20ContractBalance(addrDesc, contractDesc addr := hexutil.Encode(addrDesc)[2:] contract := hexutil.Encode(contractDesc) req := contractBalanceOfSignature + "0000000000000000000000000000000000000000000000000000000000000000"[len(addr):] + addr - data, err := b.ethCall(req, contract) + data, err := b.EthereumTypeEthCall(req, contract, "") if err != nil { return nil, err } @@ -364,7 +369,7 @@ func (b *EthereumRPC) GetTokenURI(contractDesc bchain.AddressDescriptor, tokenID } // try ERC721 tokenURI method and ERC1155 uri method for _, method := range []string{erc721TokenURIMethodSignature, erc1155URIMethodSignature} { - data, err := b.ethCall(method+id, address) + data, err := b.EthereumTypeEthCall(method+id, address, "") if err == nil && data != "" { uri := parseSimpleStringProperty(data) // try to sanitize the URI returned from the contract diff --git a/bchain/coins/eth/stakingpool.go b/bchain/coins/eth/stakingpool.go index 30820390..4a40057a 100644 --- a/bchain/coins/eth/stakingpool.go +++ b/bchain/coins/eth/stakingpool.go @@ -61,7 +61,7 @@ func isZeroBigInt(b *big.Int) bool { func (b *EthereumRPC) everstakeBalanceTypeContractCall(signature, addr, contract string) (string, error) { req := signature + "0000000000000000000000000000000000000000000000000000000000000000"[len(addr):] + addr - return b.ethCall(req, contract) + return b.EthereumTypeEthCall(req, contract, "") } func (b *EthereumRPC) everstakeContractCallSimpleNumeric(signature, addr, contract string) (*big.Int, error) { diff --git a/bchain/types.go b/bchain/types.go index a27431ab..ee29be9d 100644 --- a/bchain/types.go +++ b/bchain/types.go @@ -335,6 +335,7 @@ type BlockChain interface { EthereumTypeGetErc20ContractBalance(addrDesc, contractDesc AddressDescriptor) (*big.Int, error) EthereumTypeGetSupportedStakingPools() []string EthereumTypeGetStakingPoolsData(addrDesc AddressDescriptor) ([]StakingPoolData, error) + EthereumTypeEthCall(data, to, from string) (string, error) GetTokenURI(contractDesc AddressDescriptor, tokenID *big.Int) (string, error) } diff --git a/blockbook-api.ts b/blockbook-api.ts index 2f08c6e7..ca722a37 100644 --- a/blockbook-api.ts +++ b/blockbook-api.ts @@ -261,6 +261,7 @@ export interface InternalStateColumn { } export interface BlockbookInfo { coin: string; + network: string; host: string; version: string; gitCommit: string; @@ -447,6 +448,14 @@ export interface WsMempoolFiltersReq { fromTimestamp: number; M?: number; } +export interface WsEthCallReq { + from?: string; + to: string; + data: string; +} +export interface WsEthCallRes { + data: string; +} export interface MempoolTxidFilterEntries { entries?: { [key: string]: string }; usedZeroedKey?: boolean; diff --git a/build/tools/typescriptify/typescriptify.go b/build/tools/typescriptify/typescriptify.go index 4b19d4a2..5e24f620 100644 --- a/build/tools/typescriptify/typescriptify.go +++ b/build/tools/typescriptify/typescriptify.go @@ -60,6 +60,8 @@ func main() { t.Add(server.WsFiatRatesForTimestampsReq{}) t.Add(server.WsFiatRatesTickersListReq{}) t.Add(server.WsMempoolFiltersReq{}) + t.Add(server.WsEthCallReq{}) + t.Add(server.WsEthCallRes{}) t.Add(bchain.MempoolTxidFilterEntries{}) err := t.ConvertToFile("blockbook-api.ts") diff --git a/docs/env.md b/docs/env.md new file mode 100644 index 00000000..98383453 --- /dev/null +++ b/docs/env.md @@ -0,0 +1,11 @@ +# Environment variables + +Some behavior of Blockbook can be modified by environment variables. The variables usually start with a coin shortcut to allow to run multiple Blockbooks on a single server. + +- `_WS_GETACCOUNTINFO_LIMIT` - Limits the number of `getAccountInfo` requests per websocket connection to reduce server abuse. Accepts number as input. + +- `_STAKING_POOL_CONTRACT` - The pool name and contract used for Ethereum staking. The format of the variable is `/`. If missing, staking support is disabled. + +- `COINGECKO_API_KEY` or `_COINGECKO_API_KEY` - API key for making requests to CoinGecko in the paid tier. + +- `_ALLOWED_ETH_CALL_CONTRACTS` - Contract addresses for which `ethCall` websocket requests can be made, as a comma-separated list. If omitted, `ethCall` is enabled for all addresses. diff --git a/server/public_ethereumtype_test.go b/server/public_ethereumtype_test.go index 1edb8ab2..b7a6c6c9 100644 --- a/server/public_ethereumtype_test.go +++ b/server/public_ethereumtype_test.go @@ -134,6 +134,27 @@ func httpTestsEthereumType(t *testing.T, ts *httptest.Server) { performHttpTests(tests, t, ts) } +var websocketTestsEthereumType = []websocketTest{ + { + name: "websocket getInfo", + req: websocketReq{ + Method: "getInfo", + }, + want: `{"id":"0","data":{"name":"Fakecoin","shortcut":"FAKE","network":"FAKE","decimals":18,"version":"unknown","bestHeight":4321001,"bestHash":"0x2b57e15e93a0ed197417a34c2498b7187df79099572c04a6b6e6ff418f74e6ee","block0Hash":"","testnet":true,"backend":{"version":"001001","subversion":"/Fakecoin:0.0.1/"}}}`, + }, + { + name: "websocket ethCall", + req: websocketReq{ + Method: "ethCall", + Params: WsEthCallReq{ + To: "0xcdA9FC258358EcaA88845f19Af595e908bb7EfE9", + Data: "0x4567", + }, + }, + want: `{"id":"1","data":{"data":"0x4567abcd"}}`, + }, +} + func initEthereumTypeDB(d *db.RocksDB) error { // add 0xa9059cbb transfer(address,uint256) signature wb := grocksdb.NewWriteBatch() @@ -238,4 +259,5 @@ func Test_PublicServer_EthereumType(t *testing.T) { defer ts.Close() httpTestsEthereumType(t, ts) + runWebsocketTests(t, ts, websocketTestsEthereumType) } diff --git a/server/public_test.go b/server/public_test.go index 84d5e1ca..9b8ed215 100644 --- a/server/public_test.go +++ b/server/public_test.go @@ -1484,9 +1484,20 @@ var websocketTestsBitcoinType = []websocketTest{ }, want: `{"id":"43","data":{"P":0,"M":1,"zeroedKey":false,"blockFilter":""}}`, }, + { + name: "websocket ethCall", + req: websocketReq{ + Method: "ethCall", + Params: WsEthCallReq{ + To: "0x123", + Data: "0x456", + }, + }, + want: `{"id":"44","data":{"error":{"message":"not supported"}}}`, + }, } -func runWebsocketTestsBitcoinType(t *testing.T, ts *httptest.Server, tests []websocketTest) { +func runWebsocketTests(t *testing.T, ts *httptest.Server, tests []websocketTest) { url := strings.Replace(ts.URL, "http://", "ws://", 1) + "/websocket" s, _, err := websocket.DefaultDialer.Dial(url, nil) if err != nil { @@ -1577,7 +1588,7 @@ func Test_PublicServer_BitcoinType(t *testing.T) { httpTestsBitcoinType(t, ts) socketioTestsBitcoinType(t, ts) - runWebsocketTestsBitcoinType(t, ts, websocketTestsBitcoinType) + runWebsocketTests(t, ts, websocketTestsBitcoinType) } func httpTestsBitcoinTypeExtendedIndex(t *testing.T, ts *httptest.Server) { @@ -1758,5 +1769,5 @@ func Test_PublicServer_BitcoinType_ExtendedIndex(t *testing.T) { defer ts.Close() httpTestsBitcoinTypeExtendedIndex(t, ts) - runWebsocketTestsBitcoinType(t, ts, websocketTestsBitcoinTypeExtendedIndex) + runWebsocketTests(t, ts, websocketTestsBitcoinTypeExtendedIndex) } diff --git a/server/websocket.go b/server/websocket.go index 9e628222..4a0745b4 100644 --- a/server/websocket.go +++ b/server/websocket.go @@ -4,6 +4,7 @@ import ( "encoding/json" "math/big" "net/http" + "os" "runtime/debug" "strconv" "strings" @@ -70,6 +71,7 @@ type WebsocketServer struct { fiatRatesSubscriptions map[string]map[*websocketChannel]string fiatRatesTokenSubscriptions map[*websocketChannel][]string fiatRatesSubscriptionsLock sync.Mutex + allowedEthCallContracts map[string]struct{} } // NewWebsocketServer creates new websocket interface to blockbook and returns its handle @@ -105,6 +107,14 @@ func NewWebsocketServer(db *db.RocksDB, chain bchain.BlockChain, mempool bchain. fiatRatesSubscriptions: make(map[string]map[*websocketChannel]string), fiatRatesTokenSubscriptions: make(map[*websocketChannel][]string), } + envEthCall := os.Getenv(strings.ToUpper(is.CoinShortcut) + "_ALLOWED_ETH_CALL_CONTRACTS") + if envEthCall != "" { + s.allowedEthCallContracts = make(map[string]struct{}) + for _, c := range strings.Split(envEthCall, ",") { + s.allowedEthCallContracts[strings.ToLower(c)] = struct{}{} + } + glog.Info("Support of ethCall for these contracts: ", envEthCall) + } return s, nil } @@ -391,6 +401,14 @@ var requestHandlers = map[string]func(*WebsocketServer, *websocketChannel, *WsRe } return }, + "ethCall": func(s *WebsocketServer, c *websocketChannel, req *WsReq) (rv interface{}, err error) { + r := WsEthCallReq{} + err = json.Unmarshal(req.Params, &r) + if err == nil { + rv, err = s.ethCall(&r) + } + return + }, "subscribeNewBlock": func(s *WebsocketServer, c *websocketChannel, req *WsReq) (rv interface{}, err error) { return s.subscribeNewBlock(c, req) }, @@ -747,6 +765,20 @@ func (s *WebsocketServer) getBlockFiltersBatch(r *WsBlockFiltersBatchReq) (res i }, nil } +func (s *WebsocketServer) ethCall(r *WsEthCallReq) (*WsEthCallRes, error) { + if s.allowedEthCallContracts != nil { + _, ok := s.allowedEthCallContracts[strings.ToLower(r.To)] + if !ok { + return nil, errors.New("Not supported") + } + } + data, err := s.chain.EthereumTypeEthCall(r.Data, r.To, r.From) + if err != nil { + return nil, err + } + return &WsEthCallRes{Data: data}, nil +} + type subscriptionResponse struct { Subscribed bool `json:"subscribed"` } diff --git a/server/ws_types.go b/server/ws_types.go index 0ebe0d19..248e1d32 100644 --- a/server/ws_types.go +++ b/server/ws_types.go @@ -138,3 +138,13 @@ type WsFiatRatesTickersListReq struct { Timestamp int64 `json:"timestamp,omitempty"` Token string `json:"token,omitempty"` } + +type WsEthCallReq struct { + From string `json:"from,omitempty"` + To string `json:"to"` + Data string `json:"data"` +} + +type WsEthCallRes struct { + Data string `json:"data"` +} diff --git a/static/test-websocket.html b/static/test-websocket.html index 3972aa53..4f2cc0f6 100644 --- a/static/test-websocket.html +++ b/static/test-websocket.html @@ -1,823 +1,1293 @@ - + - - - - - - - Blockbook Websocket Test Page - + + + +
+
+

Blockbook Websocket Test Page

+
+
+
+ +
+
+ +
+
+ +
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+ +
+
+ +
+
+
+
+
+
+
+
+ +
+
+
+ + + +
+
+
+
+
+
+
+
+
+ +
+
+
+ + +
+
+ + + + + +
+
+
+
+
+
+
+
+
+ +
+
+
+ +
+
+
+
+
+
+
+
+
+ +
+
+
+ +
+
+ + + + +
+
+
+
+
+
+
+
+
+ +
+
+
+ +
+
+
+
+
+
+
+
+
+ +
+
+
+ +
+
+
+
+
+
+
+
+
+ +
+
+
+ +
+
+ +
+
+
+
+
+
+
+
+
+ +
+
+ +
+
+
+
+
+
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+
+
+
+
+ +
+
+ +
+
+ +
+
+
+
+
+
+
+ +
+
+ +
+
+ +
+
+
+
+
+
+
+ +
+
+ +
+
+ +
+
+
+
+
+
+
+ +
+
+ + +
+
+
+
+
+
+
+ +
+
+
+ + + +
+
+
+
+
+
+
+
+ +
+
+
+ + + +
+
+
+
+
+
+
+
+ +
+
+ +
+
+ +
+
+
+
+
+
+
+ +
+
+ +
+
+ +
+
+
+
+
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+
+
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+
+
+
+

+ + - - - -
-
-

Blockbook Websocket Test Page

-
-
-
- -
-
- -
-
- -
-
-
-
- -
-
-
-
-
-
- -
-
-
-
-
-
- -
-
- -
-
-
-
-
-
-
-
-
- -
-
-
- - - -
-
-
-
-
-
-
-
-
-
- -
-
-
- - -
-
- - - - - -
-
-
-
-
-
-
-
-
-
- -
-
-
- -
-
-
-
-
-
-
-
-
-
- -
-
-
- -
-
- - - - -
-
-
-
-
-
-
-
-
-
- -
-
-
- -
-
-
-
-
-
-
-
-
-
- -
-
-
- -
-
-
-
-
-
-
-
-
-
- -
-
-
- -
-
- -
-
-
-
-
-
-
-
-
-
- -
-
- -
-
-
-
-
-
-
-
-
- -
-
- -
-
- -
-
- -
-
-
-
-
-
-
- -
-
- -
-
- -
-
-
-
-
-
-
- -
-
- -
-
- -
-
-
-
-
-
-
- -
-
- -
-
- -
-
-
-
-
-
-
- -
-
- - -
-
-
-
-
-
-
- -
-
-
- - - -
-
-
-
-
-
-
-
- -
-
- -
-
- -
-
-
-
-
-
-
- -
-
- -
-
- -
-
-
-
-
-
-
- -
-
- -
-
- -
-
- -
-
-
-
-
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
-
-
-
-

- - - diff --git a/tests/dbtestdata/fakechain_ethereumtype.go b/tests/dbtestdata/fakechain_ethereumtype.go index 73e30b12..09abdfe9 100644 --- a/tests/dbtestdata/fakechain_ethereumtype.go +++ b/tests/dbtestdata/fakechain_ethereumtype.go @@ -134,6 +134,11 @@ func (c *fakeBlockChainEthereumType) EthereumTypeGetErc20ContractBalance(addrDes return big.NewInt(1000000000 + int64(addrDesc[0])*1000 + int64(contractDesc[0])), nil } +// EthereumTypeEthCall calls eth_call with given data and to address +func (c *fakeBlockChainEthereumType) EthereumTypeEthCall(data, to, from string) (string, error) { + return data + "abcd", nil +} + // GetTokenURI returns URI derived from the input contractDesc func (c *fakeBlockChainEthereumType) GetTokenURI(contractDesc bchain.AddressDescriptor, tokenID *big.Int) (string, error) { return "https://ipfs.io/ipfs/" + contractDesc.String()[3:] + ".json", nil From 996fa2d88c05181800d2ae1ff36f7a7ae44c8ee8 Mon Sep 17 00:00:00 2001 From: JoHnY Date: Wed, 25 Sep 2024 09:13:11 +0000 Subject: [PATCH 19/56] =?UTF-8?q?polygon-bor=201.4.0=20=E2=86=92=201.4.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- configs/coins/polygon.json | 10 +++++----- configs/coins/polygon_archive.json | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/configs/coins/polygon.json b/configs/coins/polygon.json index 3e92d326..39ab85aa 100644 --- a/configs/coins/polygon.json +++ b/configs/coins/polygon.json @@ -21,16 +21,16 @@ "package_name": "backend-polygon-bor", "package_revision": "satoshilabs-1", "system_user": "polygon", - "version": "1.4.0", - "binary_url": "https://github.com/maticnetwork/bor/archive/refs/tags/v1.4.0.tar.gz", + "version": "1.4.1", + "binary_url": "https://github.com/maticnetwork/bor/archive/refs/tags/v1.4.1.tar.gz", "verification_type": "sha256", - "verification_source": "d072bbcae0993a5770e65c6a7936baea0f1b3d8ee5c4de56a86b9776eacd6fed", - "extract_command": "mkdir backend/source && tar -C backend/source --strip 1 -xf v1.4.0.tar.gz && cd backend/source && make bor && mv build/bin/bor ../ && rm -rf ../source && echo", + "verification_source": "59fd114c572f81ccdd7ceb5ee6ece0ca03341b5bba294bceb34f9b572d7ef1e9", + "extract_command": "mkdir backend/source && tar -C backend/source --strip 1 -xf v1.4.1.tar.gz && cd backend/source && make bor && mv build/bin/bor ../ && rm -rf ../source && echo", "exclude_files": [], "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/polygon_bor_exec.sh 2>> {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", "exec_script": "polygon_bor.sh", "logrotate_files_template": "{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log", - "postinst_script_template": "wget https://raw.githubusercontent.com/maticnetwork/bor/v1.4.0/builder/files/genesis-mainnet-v1.json -O {{.Env.BackendInstallPath}}/{{.Coin.Alias}}/genesis.json", + "postinst_script_template": "wget https://raw.githubusercontent.com/maticnetwork/bor/v1.4.1/builder/files/genesis-mainnet-v1.json -O {{.Env.BackendInstallPath}}/{{.Coin.Alias}}/genesis.json", "service_type": "simple", "service_additional_params_template": "", "protect_memory": true, diff --git a/configs/coins/polygon_archive.json b/configs/coins/polygon_archive.json index 95ae26ea..6c26246d 100644 --- a/configs/coins/polygon_archive.json +++ b/configs/coins/polygon_archive.json @@ -21,16 +21,16 @@ "package_name": "backend-polygon-archive-bor", "package_revision": "satoshilabs-1", "system_user": "polygon", - "version": "1.4.0", - "binary_url": "https://github.com/maticnetwork/bor/archive/refs/tags/v1.4.0.tar.gz", + "version": "1.4.1", + "binary_url": "https://github.com/maticnetwork/bor/archive/refs/tags/v1.4.1.tar.gz", "verification_type": "sha256", - "verification_source": "d072bbcae0993a5770e65c6a7936baea0f1b3d8ee5c4de56a86b9776eacd6fed", - "extract_command": "mkdir backend/source && tar -C backend/source --strip 1 -xf v1.4.0.tar.gz && cd backend/source && make bor && mv build/bin/bor ../ && rm -rf ../source && echo", + "verification_source": "59fd114c572f81ccdd7ceb5ee6ece0ca03341b5bba294bceb34f9b572d7ef1e9", + "extract_command": "mkdir backend/source && tar -C backend/source --strip 1 -xf v1.4.1.tar.gz && cd backend/source && make bor && mv build/bin/bor ../ && rm -rf ../source && echo", "exclude_files": [], "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/polygon_archive_bor_exec.sh 2>> {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", "exec_script": "polygon_archive_bor.sh", "logrotate_files_template": "{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log", - "postinst_script_template": "wget https://raw.githubusercontent.com/maticnetwork/bor/v1.4.0/builder/files/genesis-mainnet-v1.json -O {{.Env.BackendInstallPath}}/{{.Coin.Alias}}/genesis.json", + "postinst_script_template": "wget https://raw.githubusercontent.com/maticnetwork/bor/v1.4.1/builder/files/genesis-mainnet-v1.json -O {{.Env.BackendInstallPath}}/{{.Coin.Alias}}/genesis.json", "service_type": "simple", "service_additional_params_template": "", "protect_memory": true, From a93a011d8fe6af7348745326f7af205da508481d Mon Sep 17 00:00:00 2001 From: JoHnY Date: Wed, 25 Sep 2024 08:51:54 +0000 Subject: [PATCH 20/56] =?UTF-8?q?eth=20(+testnets)=202.60.5=20=E2=86=92=20?= =?UTF-8?q?2.60.8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- configs/coins/ethereum.json | 12 ++++++------ configs/coins/ethereum_archive.json | 12 ++++++------ configs/coins/ethereum_testnet_holesky.json | 12 ++++++------ configs/coins/ethereum_testnet_holesky_archive.json | 12 ++++++------ configs/coins/ethereum_testnet_sepolia.json | 12 ++++++------ configs/coins/ethereum_testnet_sepolia_archive.json | 12 ++++++------ 6 files changed, 36 insertions(+), 36 deletions(-) diff --git a/configs/coins/ethereum.json b/configs/coins/ethereum.json index 92aacd65..90aab017 100644 --- a/configs/coins/ethereum.json +++ b/configs/coins/ethereum.json @@ -22,11 +22,11 @@ "package_name": "backend-ethereum", "package_revision": "satoshilabs-1", "system_user": "ethereum", - "version": "2.60.5", - "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/v2.60.5/erigon_2.60.5_linux_amd64.tar.gz", + "version": "2.60.8", + "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/2.60.8/erigon_2.60.8_linux_amd64.tar.gz", "verification_type": "sha256", - "verification_source": "e214fd85eff9f37926599309e1a0e60673698770656ad826fcdecaab55bc2ba1", - "extract_command": "tar -C backend -xf", + "verification_source": "02e9f46a0689c458045db113f9b356fb23f549e4bc2815826301e874a94f52d4", + "extract_command": "tar -C backend --strip-components=1 -xf", "exclude_files": [], "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/erigon --chain mainnet --snap.keepblocks --db.size.limit 15TB --prune c --prune.c.older 1000000 -torrent.download.rate 32mb --nat none --datadir {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/erigon --port {{.Ports.BackendP2P}} --ws --ws.port {{.Ports.BackendRPC}} --http --http.port {{.Ports.BackendRPC}} --http.addr 127.0.0.1 --http.corsdomain \"*\" --http.vhosts \"*\" --http.api \"eth,net,web3,debug,txpool\" --authrpc.port {{.Ports.BackendAuthRpc}} --private.api.addr \"\" --torrent.port {{.Ports.BackendHttp}} --log.dir.path {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend --log.dir.prefix {{.Coin.Alias}}'", "logrotate_files_template": "{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log", @@ -39,8 +39,8 @@ "client_config_file": "", "platforms": { "arm64": { - "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/v2.60.5/erigon_2.60.5_linux_arm64.tar.gz", - "verification_source": "b53d4b34fd1d96880886829aedd7f5a095a26065b7856c0862273fcb539151bd" + "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/2.60.8/erigon_2.60.8_linux_arm64.tar.gz", + "verification_source": "0c19123af4bcf510e70a98de6bc882cf55c4b66cef841fdcedb8aa7c6c65d698" } } }, diff --git a/configs/coins/ethereum_archive.json b/configs/coins/ethereum_archive.json index 7542abf0..ecf662e0 100644 --- a/configs/coins/ethereum_archive.json +++ b/configs/coins/ethereum_archive.json @@ -22,11 +22,11 @@ "package_name": "backend-ethereum-archive", "package_revision": "satoshilabs-1", "system_user": "ethereum", - "version": "2.60.5", - "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/v2.60.5/erigon_2.60.5_linux_amd64.tar.gz", + "version": "2.60.8", + "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/2.60.8/erigon_2.60.8_linux_amd64.tar.gz", "verification_type": "sha256", - "verification_source": "e214fd85eff9f37926599309e1a0e60673698770656ad826fcdecaab55bc2ba1", - "extract_command": "tar -C backend -xf", + "verification_source": "02e9f46a0689c458045db113f9b356fb23f549e4bc2815826301e874a94f52d4", + "extract_command": "tar -C backend --strip-components=1 -xf", "exclude_files": [], "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/erigon --chain mainnet --snap.keepblocks --db.size.limit 15TB --prune c --prune.c.older 1000000 -torrent.download.rate 32mb --nat none --datadir {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/erigon --port {{.Ports.BackendP2P}} --ws --ws.port {{.Ports.BackendRPC}} --http --http.port {{.Ports.BackendRPC}} --http.addr 127.0.0.1 --http.corsdomain \"*\" --http.vhosts \"*\" --http.api \"eth,net,web3,debug,txpool\" --authrpc.port {{.Ports.BackendAuthRpc}} --private.api.addr \"\" --torrent.port {{.Ports.BackendHttp}} --log.dir.path {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend --log.dir.prefix {{.Coin.Alias}}'", "logrotate_files_template": "{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log", @@ -39,8 +39,8 @@ "client_config_file": "", "platforms": { "arm64": { - "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/v2.60.5/erigon_2.60.5_linux_arm64.tar.gz", - "verification_source": "b53d4b34fd1d96880886829aedd7f5a095a26065b7856c0862273fcb539151bd" + "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/2.60.8/erigon_2.60.8_linux_arm64.tar.gz", + "verification_source": "0c19123af4bcf510e70a98de6bc882cf55c4b66cef841fdcedb8aa7c6c65d698" } } }, diff --git a/configs/coins/ethereum_testnet_holesky.json b/configs/coins/ethereum_testnet_holesky.json index 1aea3a04..88dbaac2 100644 --- a/configs/coins/ethereum_testnet_holesky.json +++ b/configs/coins/ethereum_testnet_holesky.json @@ -22,11 +22,11 @@ "package_name": "backend-ethereum-testnet-holesky", "package_revision": "satoshilabs-1", "system_user": "ethereum", - "version": "2.60.5", - "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/v2.60.5/erigon_2.60.5_linux_amd64.tar.gz", + "version": "2.60.8", + "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/2.60.8/erigon_2.60.8_linux_amd64.tar.gz", "verification_type": "sha256", - "verification_source": "e214fd85eff9f37926599309e1a0e60673698770656ad826fcdecaab55bc2ba1", - "extract_command": "tar -C backend -xf", + "verification_source": "02e9f46a0689c458045db113f9b356fb23f549e4bc2815826301e874a94f52d4", + "extract_command": "tar -C backend --strip-components=1 -xf", "exclude_files": [], "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/erigon --chain holesky --snap.keepblocks --db.size.limit 15TB --prune c --prune.c.older 1000000 -torrent.download.rate 32mb --nat none --datadir {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/erigon --port {{.Ports.BackendP2P}} --ws --ws.port {{.Ports.BackendRPC}} --http --http.port {{.Ports.BackendRPC}} --http.addr 127.0.0.1 --http.corsdomain \"*\" --http.vhosts \"*\" --http.api \"eth,net,web3,debug,txpool\" --authrpc.port {{.Ports.BackendAuthRpc}} --private.api.addr \"\" --torrent.port {{.Ports.BackendHttp}} --log.dir.path {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend --log.dir.prefix {{.Coin.Alias}}'", "logrotate_files_template": "{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log", @@ -39,8 +39,8 @@ "client_config_file": "", "platforms": { "arm64": { - "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/v2.60.5/erigon_2.60.5_linux_arm64.tar.gz", - "verification_source": "b53d4b34fd1d96880886829aedd7f5a095a26065b7856c0862273fcb539151bd" + "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/2.60.8/erigon_2.60.8_linux_arm64.tar.gz", + "verification_source": "0c19123af4bcf510e70a98de6bc882cf55c4b66cef841fdcedb8aa7c6c65d698" } } }, diff --git a/configs/coins/ethereum_testnet_holesky_archive.json b/configs/coins/ethereum_testnet_holesky_archive.json index bad490fb..99191e83 100644 --- a/configs/coins/ethereum_testnet_holesky_archive.json +++ b/configs/coins/ethereum_testnet_holesky_archive.json @@ -23,11 +23,11 @@ "package_name": "backend-ethereum-testnet-holesky-archive", "package_revision": "satoshilabs-1", "system_user": "ethereum", - "version": "2.60.5", - "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/v2.60.5/erigon_2.60.5_linux_amd64.tar.gz", + "version": "2.60.8", + "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/2.60.8/erigon_2.60.8_linux_amd64.tar.gz", "verification_type": "sha256", - "verification_source": "e214fd85eff9f37926599309e1a0e60673698770656ad826fcdecaab55bc2ba1", - "extract_command": "tar -C backend -xf", + "verification_source": "02e9f46a0689c458045db113f9b356fb23f549e4bc2815826301e874a94f52d4", + "extract_command": "tar -C backend --strip-components=1 -xf", "exclude_files": [], "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/erigon --chain holesky --snap.keepblocks --db.size.limit 15TB --prune c --prune.c.older 1000000 -torrent.download.rate 32mb --nat none --datadir {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/erigon --port {{.Ports.BackendP2P}} --ws --ws.port {{.Ports.BackendRPC}} --http --http.port {{.Ports.BackendRPC}} --http.addr 127.0.0.1 --http.corsdomain \"*\" --http.vhosts \"*\" --http.api \"eth,net,web3,debug,txpool\" --authrpc.port {{.Ports.BackendAuthRpc}} --private.api.addr \"\" --torrent.port {{.Ports.BackendHttp}} --log.dir.path {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend --log.dir.prefix {{.Coin.Alias}}'", "logrotate_files_template": "{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log", @@ -40,8 +40,8 @@ "client_config_file": "", "platforms": { "arm64": { - "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/v2.60.5/erigon_2.60.5_linux_arm64.tar.gz", - "verification_source": "b53d4b34fd1d96880886829aedd7f5a095a26065b7856c0862273fcb539151bd" + "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/2.60.8/erigon_2.60.8_linux_arm64.tar.gz", + "verification_source": "0c19123af4bcf510e70a98de6bc882cf55c4b66cef841fdcedb8aa7c6c65d698" } } }, diff --git a/configs/coins/ethereum_testnet_sepolia.json b/configs/coins/ethereum_testnet_sepolia.json index 0222dcfe..195faa55 100644 --- a/configs/coins/ethereum_testnet_sepolia.json +++ b/configs/coins/ethereum_testnet_sepolia.json @@ -22,11 +22,11 @@ "package_name": "backend-ethereum-testnet-sepolia", "package_revision": "satoshilabs-1", "system_user": "ethereum", - "version": "2.60.5", - "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/v2.60.5/erigon_2.60.5_linux_amd64.tar.gz", + "version": "2.60.8", + "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/2.60.8/erigon_2.60.8_linux_amd64.tar.gz", "verification_type": "sha256", - "verification_source": "e214fd85eff9f37926599309e1a0e60673698770656ad826fcdecaab55bc2ba1", - "extract_command": "tar -C backend -xf", + "verification_source": "02e9f46a0689c458045db113f9b356fb23f549e4bc2815826301e874a94f52d4", + "extract_command": "tar -C backend --strip-components=1 -xf", "exclude_files": [], "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/erigon --chain sepolia --snap.keepblocks --db.size.limit 15TB --prune c --prune.c.older 1000000 -torrent.download.rate 32mb --nat none --datadir {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/erigon --port {{.Ports.BackendP2P}} --ws --ws.port {{.Ports.BackendRPC}} --http --http.port {{.Ports.BackendRPC}} --http.addr 127.0.0.1 --http.corsdomain \"*\" --http.vhosts \"*\" --http.api \"eth,net,web3,debug,txpool\" --authrpc.port {{.Ports.BackendAuthRpc}} --private.api.addr \"\" --torrent.port {{.Ports.BackendHttp}} --log.dir.path {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend --log.dir.prefix {{.Coin.Alias}}'", "logrotate_files_template": "{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log", @@ -39,8 +39,8 @@ "client_config_file": "", "platforms": { "arm64": { - "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/v2.60.5/erigon_2.60.5_linux_arm64.tar.gz", - "verification_source": "b53d4b34fd1d96880886829aedd7f5a095a26065b7856c0862273fcb539151bd" + "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/2.60.8/erigon_2.60.8_linux_arm64.tar.gz", + "verification_source": "0c19123af4bcf510e70a98de6bc882cf55c4b66cef841fdcedb8aa7c6c65d698" } } }, diff --git a/configs/coins/ethereum_testnet_sepolia_archive.json b/configs/coins/ethereum_testnet_sepolia_archive.json index 5f8f02bf..2ab9faea 100644 --- a/configs/coins/ethereum_testnet_sepolia_archive.json +++ b/configs/coins/ethereum_testnet_sepolia_archive.json @@ -23,11 +23,11 @@ "package_name": "backend-ethereum-testnet-sepolia-archive", "package_revision": "satoshilabs-1", "system_user": "ethereum", - "version": "2.60.5", - "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/v2.60.5/erigon_2.60.5_linux_amd64.tar.gz", + "version": "2.60.8", + "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/2.60.8/erigon_2.60.8_linux_amd64.tar.gz", "verification_type": "sha256", - "verification_source": "e214fd85eff9f37926599309e1a0e60673698770656ad826fcdecaab55bc2ba1", - "extract_command": "tar -C backend -xf", + "verification_source": "02e9f46a0689c458045db113f9b356fb23f549e4bc2815826301e874a94f52d4", + "extract_command": "tar -C backend --strip-components=1 -xf", "exclude_files": [], "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/erigon --chain sepolia --snap.keepblocks --db.size.limit 15TB --prune c --prune.c.older 1000000 -torrent.download.rate 32mb --nat none --datadir {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/erigon --port {{.Ports.BackendP2P}} --ws --ws.port {{.Ports.BackendRPC}} --http --http.port {{.Ports.BackendRPC}} --http.addr 127.0.0.1 --http.corsdomain \"*\" --http.vhosts \"*\" --http.api \"eth,net,web3,debug,txpool\" --authrpc.port {{.Ports.BackendAuthRpc}} --private.api.addr \"\" --torrent.port {{.Ports.BackendHttp}} --log.dir.path {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend --log.dir.prefix {{.Coin.Alias}}'", "logrotate_files_template": "{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log", @@ -40,8 +40,8 @@ "client_config_file": "", "platforms": { "arm64": { - "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/v2.60.5/erigon_2.60.5_linux_arm64.tar.gz", - "verification_source": "b53d4b34fd1d96880886829aedd7f5a095a26065b7856c0862273fcb539151bd" + "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/2.60.8/erigon_2.60.8_linux_arm64.tar.gz", + "verification_source": "0c19123af4bcf510e70a98de6bc882cf55c4b66cef841fdcedb8aa7c6c65d698" } } }, From a2aa489b655d19fc3dc4864e2502a4d4f22de786 Mon Sep 17 00:00:00 2001 From: grdddj Date: Tue, 10 Sep 2024 10:51:20 +0200 Subject: [PATCH 21/56] chore: add .editorconfig and style api.md --- .editorconfig | 10 ++ docs/api.md | 288 +++++++++++++++++++++++++------------------------- 2 files changed, 154 insertions(+), 144 deletions(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..2048f1d1 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,10 @@ +root = true + +[*.md] +indent_style = space +indent_size = 4 +trim_trailing_whitespace = false +max_line_length = 80 +insert_final_newline = true +charset = utf-8 +end_of_line = lf diff --git a/docs/api.md b/docs/api.md index 69ac4579..d81534db 100644 --- a/docs/api.md +++ b/docs/api.md @@ -8,25 +8,25 @@ API V2 is the current version of API. It can be used with all coin types that Bl Common principles used in API V2: -- all crypto amounts are transferred as strings, in the lowest denomination (satoshis, wei, ...), without decimal point -- empty fields are omitted. Empty field is a string of value _null_ or _""_, a number of value _0_, an object of value _null_ or an array without elements. The reason for this is that the interface serves many different coins which use only subset of the fields. Sometimes this principle can lead to slightly confusing results, for example when transaction version is 0, the field _version_ is omitted. +- all crypto amounts are transferred as strings, in the lowest denomination (satoshis, wei, ...), without decimal point +- empty fields are omitted. Empty field is a string of value _null_ or _""_, a number of value _0_, an object of value _null_ or an array without elements. The reason for this is that the interface serves many different coins which use only subset of the fields. Sometimes this principle can lead to slightly confusing results, for example when transaction version is 0, the field _version_ is omitted. ### REST API The following methods are supported: -- [Status](#status) -- [Get block hash](#get-block-hash) -- [Get transaction](#get-transaction) -- [Get transaction specific](#get-transaction-specific) -- [Get address](#get-address) -- [Get xpub](#get-xpub) -- [Get utxo](#get-utxo) -- [Get block](#get-block) -- [Send transaction](#send-transaction) -- [Tickers list](#tickers-list) -- [Tickers](#tickers) -- [Balance history](#balance-history) +- [Status](#status) +- [Get block hash](#get-block-hash) +- [Get transaction](#get-transaction) +- [Get transaction specific](#get-transaction-specific) +- [Get address](#get-address) +- [Get xpub](#get-xpub) +- [Get utxo](#get-utxo) +- [Get block](#get-block) +- [Send transaction](#send-transaction) +- [Tickers list](#tickers-list) +- [Tickers](#tickers) +- [Balance history](#balance-history) #### Status page @@ -201,14 +201,14 @@ Response for Bitcoin-type coins, unconfirmed transaction (_blockHeight_: -1, _co Response for Ethereum-type coins. Data of the transaction consist of: -- always only one _vin_, only one _vout_ -- an array of _tokenTransfers_ (ERC20, ERC721 or ERC1155) -- _ethereumSpecific_ data - - _type_ (returned only for contract creation - value `1` and destruction value `2`) - - _status_ (`1` OK, `0` Failure, `-1` pending), potential _error_ message, _gasLimit_, _gasUsed_, _gasPrice_, _nonce_, input _data_ - - parsed input data in the field _parsedData_, if a match with the 4byte directory was found - - internal transfers (type `0` transfer, type `1` contract creation, type `2` contract destruction) -- _addressAliases_ - maps addresses in the transaction to names from contract or ENS. Only addresses with known names are returned. +- always only one _vin_, only one _vout_ +- an array of _tokenTransfers_ (ERC20, ERC721 or ERC1155) +- _ethereumSpecific_ data + - _type_ (returned only for contract creation - value `1` and destruction value `2`) + - _status_ (`1` OK, `0` Failure, `-1` pending), potential _error_ message, _gasLimit_, _gasUsed_, _gasPrice_, _nonce_, input _data_ + - parsed input data in the field _parsedData_, if a match with the 4byte directory was found + - internal transfers (type `0` transfer, type `1` contract creation, type `2` contract destruction) +- _addressAliases_ - maps addresses in the transaction to names from contract or ENS. Only addresses with known names are returned. ```javascript { @@ -311,8 +311,8 @@ Response for Ethereum-type coins. Data of the transaction consist of: A note about the `blockTime` field: -- for already mined transaction (`confirmations > 0`), the field `blockTime` contains time of the block -- for transactions in mempool (`confirmations == 0`), the field contains time when the running instance of Blockbook was first time notified about the transaction. This time may be different in different instances of Blockbook. +- for already mined transaction (`confirmations > 0`), the field `blockTime` contains time of the block +- for transactions in mempool (`confirmations == 0`), the field contains time when the running instance of Blockbook was first time notified about the transaction. This time may be different in different instances of Blockbook. #### Get transaction specific @@ -383,18 +383,18 @@ GET /api/v2/address/
[?page=&pageSize=&from=&t The optional query parameters: -- _page_: specifies page of returned transactions, starting from 1. If out of range, Blockbook returns the closest possible page. -- _pageSize_: number of transactions returned by call (default and maximum 1000) -- _from_, _to_: filter of the returned transactions _from_ block height _to_ block height (default no filter) -- _details_: specifies level of details returned by request (default _txids_) - - _basic_: return only address balances, without any transactions - - _tokens_: _basic_ + tokens belonging to the address (applicable only to some coins) - - _tokenBalances_: _basic_ + tokens with balances + belonging to the address (applicable only to some coins) - - _txids_: _tokenBalances_ + list of txids, subject to _from_, _to_ filter and paging - - _txslight_: _tokenBalances_ + list of transaction with limited details (only data from index), subject to _from_, _to_ filter and paging - - _txs_: _tokenBalances_ + list of transaction with details, subject to _from_, _to_ filter and paging -- _contract_: return only transactions which affect specified contract (applicable only to coins which support contracts) -- _secondary_: specifies secondary (fiat) currency in which the token and total balances are returned in addition to crypto values +- _page_: specifies page of returned transactions, starting from 1. If out of range, Blockbook returns the closest possible page. +- _pageSize_: number of transactions returned by call (default and maximum 1000) +- _from_, _to_: filter of the returned transactions _from_ block height _to_ block height (default no filter) +- _details_: specifies level of details returned by request (default _txids_) + - _basic_: return only address balances, without any transactions + - _tokens_: _basic_ + tokens belonging to the address (applicable only to some coins) + - _tokenBalances_: _basic_ + tokens with balances + belonging to the address (applicable only to some coins) + - _txids_: _tokenBalances_ + list of txids, subject to _from_, _to_ filter and paging + - _txslight_: _tokenBalances_ + list of transaction with limited details (only data from index), subject to _from_, _to_ filter and paging + - _txs_: _tokenBalances_ + list of transaction with details, subject to _from_, _to_ filter and paging +- _contract_: return only transactions which affect specified contract (applicable only to coins which support contracts) +- _secondary_: specifies secondary (fiat) currency in which the token and total balances are returned in addition to crypto values Example response for bitcoin type coin, _details_ set to _txids_: @@ -457,25 +457,25 @@ Returns balances and transactions of an xpub or output descriptor, applicable on Blockbook supports BIP44, BIP49, BIP84 and BIP86 (Taproot) derivation schemes, using either xpubs or output descriptors (see https://github.com/bitcoin/bitcoin/blob/master/doc/descriptors.md) -- Xpubs +- Xpubs - Blockbook expects xpub at level 3 derivation path, i.e. _m/purpose'/coin_type'/account'/_. Blockbook completes the _change/address_index_ part of the path when deriving addresses. - The BIP version is determined by the prefix of the xpub. The prefixes for each coin are defined by fields `xpub_magic`, `xpub_magic_segwit_p2sh`, `xpub_magic_segwit_native` in the [trezor-common](https://github.com/trezor/trezor-common/tree/master/defs/bitcoin) library. If the prefix is not recognized, Blockbook defaults to BIP44 derivation scheme. + Blockbook expects xpub at level 3 derivation path, i.e. _m/purpose'/coin_type'/account'/_. Blockbook completes the _change/address_index_ part of the path when deriving addresses. + The BIP version is determined by the prefix of the xpub. The prefixes for each coin are defined by fields `xpub_magic`, `xpub_magic_segwit_p2sh`, `xpub_magic_segwit_native` in the [trezor-common](https://github.com/trezor/trezor-common/tree/master/defs/bitcoin) library. If the prefix is not recognized, Blockbook defaults to BIP44 derivation scheme. -- Output descriptors +- Output descriptors - Output descriptors are in the form `([][//*])[#checksum]`, for example `pkh([5c9e228d/44'/0'/0']xpub6BgBgses...Mj92pReUsQ/<0;1>/*)#abcd` + Output descriptors are in the form `([][//*])[#checksum]`, for example `pkh([5c9e228d/44'/0'/0']xpub6BgBgses...Mj92pReUsQ/<0;1>/*)#abcd` - Parameters `type` and `xpub` are mandatory, the rest is optional + Parameters `type` and `xpub` are mandatory, the rest is optional - Blockbook supports a limited set of `type`s: + Blockbook supports a limited set of `type`s: - - BIP44: `pkh(xpub)` - - BIP49: `sh(wpkh(xpub))` - - BIP84: `wpkh(xpub)` - - BIP86 (Taproot single key): `tr(xpub)` + - BIP44: `pkh(xpub)` + - BIP49: `sh(wpkh(xpub))` + - BIP84: `wpkh(xpub)` + - BIP86 (Taproot single key): `tr(xpub)` - Parameter `change` can be a single number or a list of change indexes, specified either in the format `` or `{index1,index2,...}`. If the parameter `change` is not specified, Blockbook defaults to `<0;1>`. + Parameter `change` can be a single number or a list of change indexes, specified either in the format `` or `{index1,index2,...}`. If the parameter `change` is not specified, Blockbook defaults to `<0;1>`. The returned transactions are sorted by block height, newest blocks first. @@ -485,20 +485,20 @@ GET /api/v2/xpub/[?page=&pageSize=&from= The query parameters: -- _timestamp_: specifies a Unix timestamp to return available tickers for. +- _timestamp_: specifies a Unix timestamp to return available tickers for. Example response: @@ -760,8 +760,8 @@ GET /api/v2/tickers/[?currency=×tamp=] The optional query parameters: -- _currency_: specifies a currency of returned rate ("usd", "eur", "eth"...). If not specified, all available currencies will be returned. -- _timestamp_: a Unix timestamp that specifies a date to return currency rates for. If not specified, the last available rate will be returned. +- _currency_: specifies a currency of returned rate ("usd", "eur", "eth"...). If not specified, all available currencies will be returned. +- _timestamp_: a Unix timestamp that specifies a date to return currency rates for. If not specified, the last available rate will be returned. Example response (no parameters): @@ -807,13 +807,13 @@ GET /api/v2/balancehistory/?from=&to=[&fiatcur Query parameters: -- _from_: specifies a start date as a Unix timestamp -- _to_: specifies an end date as a Unix timestamp +- _from_: specifies a start date as a Unix timestamp +- _to_: specifies an end date as a Unix timestamp The optional query parameters: -- _fiatcurrency_: if specified, the response will contain secondary (fiat) rate at the time of transaction. If not, all available currencies will be returned. -- _groupBy_: an interval in seconds, to group results by. Default is 3600 seconds. +- _fiatcurrency_: if specified, the response will contain secondary (fiat) rate at the time of transaction. If not, all available currencies will be returned. +- _groupBy_: an interval in seconds, to group results by. Default is 3600 seconds. Example response (_fiatcurrency_ not specified): @@ -850,26 +850,26 @@ Example response (fiatcurrency=usd): ```javascript [ - { - time: 1578391200, - txs: 5, - received: "5000000", - sent: "0", - sentToSelf: "0", - rates: { - usd: 7855.9, + { + time: 1578391200, + txs: 5, + received: '5000000', + sent: '0', + sentToSelf: '0', + rates: { + usd: 7855.9, + }, }, - }, - { - time: 1578488400, - txs: 1, - received: "0", - sent: "5000000", - sentToSelf: "0", - rates: { - usd: 8283.11, + { + time: 1578488400, + txs: 1, + received: '0', + sent: '5000000', + sentToSelf: '0', + rates: { + usd: 8283.11, + }, }, - }, ]; ``` @@ -877,16 +877,16 @@ Example response (fiatcurrency=usd&groupBy=172800): ```javascript [ - { - time: 1578355200, - txs: 6, - received: "5000000", - sent: "5000000", - sentToSelf: "0", - rates: { - usd: 7734.45, + { + time: 1578355200, + txs: 6, + received: '5000000', + sent: '5000000', + sentToSelf: '0', + rates: { + usd: 7734.45, + }, }, - }, ]; ``` @@ -898,28 +898,28 @@ Websocket interface is provided at `/websocket/`. The interface can be explored The websocket interface provides the following requests: -- getInfo -- getBlockHash -- getAccountInfo -- getAccountUtxo -- getTransaction -- getTransactionSpecific -- getBalanceHistory -- getCurrentFiatRates -- getFiatRatesTickersList -- getFiatRatesForTimestamps -- getMempoolFilters -- getBlockFilter -- estimateFee -- sendTransaction -- ping +- getInfo +- getBlockHash +- getAccountInfo +- getAccountUtxo +- getTransaction +- getTransactionSpecific +- getBalanceHistory +- getCurrentFiatRates +- getFiatRatesTickersList +- getFiatRatesForTimestamps +- getMempoolFilters +- getBlockFilter +- estimateFee +- sendTransaction +- ping The client can subscribe to the following events: -- `subscribeNewBlock` - new block added to blockchain -- `subscribeNewTransaction` - new transaction added to blockchain (all addresses) -- `subscribeAddresses` - new transaction for a given address (list of addresses) added to mempool -- `subscribeFiatRates` - new currency rate ticker +- `subscribeNewBlock` - new block added to blockchain +- `subscribeNewTransaction` - new transaction added to blockchain (all addresses) +- `subscribeAddresses` - new transaction for a given address (list of addresses) added to mempool +- `subscribeFiatRates` - new currency rate ticker There can be always only one subscription of given event per connection, i.e. new list of addresses replaces previous list of addresses. From 1c70a269b0e4902e2f654a2727b6c7df5ee0eb59 Mon Sep 17 00:00:00 2001 From: grdddj Date: Tue, 24 Sep 2024 14:20:09 +0200 Subject: [PATCH 22/56] chore: update and enrich API docs --- docs/api.md | 255 ++++++++++++++++++++++++++++++++++------------------ 1 file changed, 169 insertions(+), 86 deletions(-) diff --git a/docs/api.md b/docs/api.md index d81534db..811a5c40 100644 --- a/docs/api.md +++ b/docs/api.md @@ -11,6 +11,8 @@ Common principles used in API V2: - all crypto amounts are transferred as strings, in the lowest denomination (satoshis, wei, ...), without decimal point - empty fields are omitted. Empty field is a string of value _null_ or _""_, a number of value _0_, an object of value _null_ or an array without elements. The reason for this is that the interface serves many different coins which use only subset of the fields. Sometimes this principle can lead to slightly confusing results, for example when transaction version is 0, the field _version_ is omitted. +See all the referred types (`typescript` interfaces) in the [blockbook-api.ts](../blockbook-api.ts) file. + ### REST API The following methods are supported: @@ -33,43 +35,47 @@ The following methods are supported: Status page returns current status of Blockbook and connected backend. ``` -GET /api +GET /api/status ``` -Response: +Response (`SystemInfo` type): + + ```javascript { "blockbook": { "coin": "Bitcoin", - "host": "blockbook", + "network": "BTC", + "host": "backend5", "version": "0.4.0", - "gitCommit": "3d9ad91", - "buildTime": "2019-05-17T14:34:00+00:00", + "gitCommit": "a0960c8e", + "buildTime": "2024-08-08T12:32:50+00:00", "syncMode": true, "initialSync": false, "inSync": true, - "bestHeight": 577261, - "lastBlockTime": "2019-05-22T18:03:33.547762973+02:00", + "bestHeight": 860730, + "lastBlockTime": "2024-09-10T08:19:04.471017534Z", "inSyncMempool": true, - "lastMempoolTime": "2019-05-22T18:10:10.27929383+02:00", - "mempoolSize": 17348, + "lastMempoolTime": "2024-09-10T08:42:39.38871351Z", + "mempoolSize": 232021, "decimals": 8, - "dbSize": 191887866502, - "about": "Blockbook - blockchain indexer for Trezor wallet https://trezor.io/. Do not use for any other purpose." + "dbSize": 761283489075, + "hasFiatRates": true, + "currentFiatRatesTime": "2024-09-10T08:42:00.898792419Z", + "historicalFiatRatesTime": "2024-09-10T00:00:00Z", + "about": "Blockbook - blockchain indexer for Trezor Suite https://trezor.io/trezor-suite. Do not use for any other purpose." }, "backend": { "chain": "main", - "blocks": 577261, - "headers": 577261, - "bestBlockHash": "0000000000000000000ca8c902aa58b3118a7f35d093e25a07f17bcacd91cabf", - "difficulty": "6704632680587.417", - "sizeOnDisk": 250504188580, - "version": "180000", - "subversion": "/Satoshi:0.18.0/", - "protocolVersion": "70015", - "timeOffset": 0, - "warnings": "" + "blocks": 860730, + "headers": 860730, + "bestBlockHash": "00000000000000000000effeb0c4460480e6a347deab95332c63007a68646ee5", + "difficulty": "89471664776970.77", + "sizeOnDisk": 681584532221, + "version": "270100", + "subversion": "/Satoshi:27.1.0/", + "protocolVersion": "70016" } } ``` @@ -82,9 +88,11 @@ GET /api/v2/block-index/ Response: + + ```javascript { - "blockHash": "ed8f3af8c10ca70a136901c6dd3adf037f0aea8a93fbe9e80939214034300f1e" + "blockHash": "0000000000000000000b7b8574bc6fd285825ec2dbcbeca149121fc05b0c828c" } ``` @@ -98,104 +106,168 @@ Get transaction returns "normalized" data about transaction, which has the same GET /api/v2/tx/ ``` -Response for Bitcoin-type coins, confirmed transaction: +Response for Bitcoin-type coins, confirmed transaction (`Tx` type): + + ```javascript { - "txid": "9e2bc8fbd40af17a6564831f84aef0cab2046d4bad19e91c09d21bff2c851851", - "version": 1, + "txid": "8c1e3dec662d1f2a5e322ccef5eca263f98eb16723c6f990be0c88c1db113fb1", + "version": 2, + "lockTime": 860729, "vin": [ { - "txid": "f124e6999bf67e710b9e8a8ac4dbb08a64aa9c264120cf98793455e36a531615", - "vout": 2, - "sequence": 4294967295, + "txid": "0eb7b574373de2c88d0dc1444f49947c681d0437d21361f9ebb4dd09c62f2a66", + "vout": 1, + "sequence": 4294967293, "n": 0, "addresses": [ - "DDhUv8JZGmSxKYV95NLnbRTUKni9cDZD3S" + "bc1qmgwnfjlda4ns3g6g3yz74w6scnn9yu2ts82yyc" ], "isAddress": true, - "value": "55795108999999", - "hex": "473...2c7ec77bb982" + "value": "10106300" } ], "vout": [ { - "value": "55585679000000", + "value": "175000", "n": 0, - "hex": "76a914feaca9d9fa7120c7c587c00c639bb18d40faadd388ac", + "hex": "76a914ecc999d554eaa3efa5e871c28f58b549c36ec51788ac", "addresses": [ - "DUMh1rPrXTrCN2Z9EHsLPg7b78rACHB2h7" + "1Nb1ykSD7J5k4RFjJQGsrD9gxBE6jzfNa9" ], "isAddress": true }, { - "value": "209329999999", + "value": "9888100", "n": 1, - "hex": "76a914ea8984be785868391d92f49c14933f47c152ea0a88ac", + "hex": "001496f152a0919487624bf4f13f46f0d20fa10d9acc", "addresses": [ - "DSXDQ6rnwLX47WFRnemctoXPHA9pLMxqXn" + "bc1qjmc49gy3jjrkyjl57yl5duxjp7ssmxkvh5t2q5" ], "isAddress": true } ], - "blockHash": "78d1f3de899a10dd2e580704226ebf9508e95e1706f177fc9c31c47f245d2502", - "blockHeight": 2647927, + "blockHash": "00000000000000000000effeb0c4460480e6a347deab95332c63007a68646ee5", + "blockHeight": 860730, "confirmations": 1, - "blockTime": 1553088212, - "size": 234, - "vsize": 153, - "value": "55795008999999", - "valueIn": "55795108999999", - "fees": "100000000", - "hex": "0100000...0011000" + "blockTime": 1725956288, + "size": 225, + "vsize": 144, + "value": "10063100", + "valueIn": "10106300", + "fees": "43200", + "hex": "02000000000101662a2fc609ddb4ebf96113d237041d687c94494f44c10d8dc8e23d3774b5b70e0100000000fdffffff0298ab0200000000001976a914ecc999d554eaa3efa5e871c28f58b549c36ec51788ac64e196000000000016001496f152a0919487624bf4f13f46f0d20fa10d9acc0247304402202bb0591180cdbbe0f639af6eb21abdb993fc5a667b09e6392d5c11b025a9187102201ef2e84fc91a5d2c6fbbc9f943482d230256a3640f8ecb83c1f3f17242cf011001210314f03889e1667feb696ee280625943195189cfabe46d54204d987f631fe6892739220d00" } ``` -Response for Bitcoin-type coins, unconfirmed transaction (_blockHeight_: -1, _confirmations_: 0, mining estimates _confirmationETABlocks_ and _confirmationETASeconds_): +Response for Bitcoin-type coins, unconfirmed transaction: + +Special fields: + +- _blockHeight_: -1 +- _confirmations_: 0 +- _confirmationETABlocks_: number +- _confirmationETASeconds_: number + + ```javascript { - "txid": "cd8ec77174e426070d0a50779232bba7312b712e2c6843d82d963d7076c61366", + "txid": "73b1ad97194e426031e5c692869de2d83dc2ff6033fc6f0ab5514345f92eaf0d", "version": 2, "vin": [ { - "txid": "47687cc4abb58d815168686465a38113a0608b2568a6d6480129d197e653f6dc", - "sequence": 4294967295, + "txid": "bccbebb64b1613ada74eefa96753088a80fefa53a10e42c66eef1899371bc096", "n": 0, - "addresses": ["bc1qka0gpenex558g8gpxmpx247mwhw695k6a7yhs4"], + "addresses": [ + "bc1q9lh77es6m8ztr7muwcec00ewn8fxakpl9jwv8y" + ], "isAddress": true, - "value": "1983687" + "value": "371042" } ], "vout": [ { - "value": "3106", + "value": "293135", "n": 0, - "hex": "0020d7da4868055fde790a8581637ab81c216e17a3f8a099283da6c4a27419ffa539", + "hex": "0014aafd7386f99f4b508ec05ee8f7edc2e07126620a", "addresses": [ - "bc1q6ldys6q9tl08jz59s93h4wquy9hp0glc5zvjs0dxcj38gx0l55uspu8x86" + "bc1q4t7h8phena94prkqtm500mwzupcjvcs2akcdy9" ], "isAddress": true }, { - "value": "1979101", + "value": "74022", "n": 1, - "hex": "0014381be30ca46ddf378ef69ebc4a601bd6ff30b754", - "addresses": ["bc1q8qd7xr9ydh0n0rhkn67y5cqm6mlnpd65dcyeeg"], + "hex": "0014a3de0fbba89c17d43093164ea955bad65bc260bf", + "addresses": [ + "bc1q500qlwagnstagvynze82j4d66eduyc9lf64ksh" + ], "isAddress": true } ], "blockHeight": -1, "confirmations": 0, - "confirmationETABlocks": 3, - "confirmationETASeconds": 2055, - "blockTime": 1675270935, - "size": 234, - "vsize": 153, - "value": "1982207", - "valueIn": "1983687", - "fees": "1480", - "hex": "020000000001...b18f00000000" + "confirmationETABlocks": 1, + "confirmationETASeconds": 619, + "blockTime": 1725959035, + "size": 222, + "vsize": 141, + "value": "367157", + "valueIn": "371042", + "fees": "3885", + "hex": "0200000000010196c01b379918ef6ec6420ea153fafe808a085367a9ef4ea7ad13164bb6ebcbbc000000000000000000020f79040000000000160014aafd7386f99f4b508ec05ee8f7edc2e07126620a2621010000000000160014a3de0fbba89c17d43093164ea955bad65bc260bf0247304402204a5bdf8a8d19b0a19044b0c0de3ced92b92e8d0c629ffca83178c85a608f719e02203841d40dd92db48715f9f41a732e139ac3cc7696a23adc87136bd8037a594e9f012102824a5e7b878f8d63887bdcb1b0982cdb0b375068b3798c4c96799476a19a389e00000000", + "rbf": true, + "coinSpecificData": { + "txid": "73b1ad97194e426031e5c692869de2d83dc2ff6033fc6f0ab5514345f92eaf0d", + "hash": "91deb6a9d0f5a37e2e83d1e602ba14cd9811fd3605f582154c9bd1337f7f4c8a", + "version": 2, + "size": 222, + "vsize": 141, + "weight": 561, + "locktime": 0, + "vin": [ + { + "txid": "bccbebb64b1613ada74eefa96753088a80fefa53a10e42c66eef1899371bc096", + "vout": 0, + "scriptSig": { + "asm": "", + "hex": "" + }, + "txinwitness": [ + "304402204a5bdf8a8d19b0a19044b0c0de3ced92b92e8d0c629ffca83178c85a608f719e02203841d40dd92db48715f9f41a732e139ac3cc7696a23adc87136bd8037a594e9f01", + "02824a5e7b878f8d63887bdcb1b0982cdb0b375068b3798c4c96799476a19a389e" + ], + "sequence": 0 + } + ], + "vout": [ + { + "value": 0.00293135, + "n": 0, + "scriptPubKey": { + "asm": "0 aafd7386f99f4b508ec05ee8f7edc2e07126620a", + "desc": "addr(bc1q4t7h8phena94prkqtm500mwzupcjvcs2akcdy9)#qmxeweuu", + "hex": "0014aafd7386f99f4b508ec05ee8f7edc2e07126620a", + "address": "bc1q4t7h8phena94prkqtm500mwzupcjvcs2akcdy9", + "type": "witness_v0_keyhash" + } + }, + { + "value": 0.00074022, + "n": 1, + "scriptPubKey": { + "asm": "0 a3de0fbba89c17d43093164ea955bad65bc260bf", + "desc": "addr(bc1q500qlwagnstagvynze82j4d66eduyc9lf64ksh)#mynfp6xy", + "hex": "0014a3de0fbba89c17d43093164ea955bad65bc260bf", + "address": "bc1q500qlwagnstagvynze82j4d66eduyc9lf64ksh", + "type": "witness_v0_keyhash" + } + } + ], + "hex": "0200000000010196c01b379918ef6ec6420ea153fafe808a085367a9ef4ea7ad13164bb6ebcbbc000000000000000000020f79040000000000160014aafd7386f99f4b508ec05ee8f7edc2e07126620a2621010000000000160014a3de0fbba89c17d43093164ea955bad65bc260bf0247304402204a5bdf8a8d19b0a19044b0c0de3ced92b92e8d0c629ffca83178c85a608f719e02203841d40dd92db48715f9f41a732e139ac3cc7696a23adc87136bd8037a594e9f012102824a5e7b878f8d63887bdcb1b0982cdb0b375068b3798c4c96799476a19a389e00000000" + } } ``` @@ -210,6 +282,8 @@ Response for Ethereum-type coins. Data of the transaction consist of: - internal transfers (type `0` transfer, type `1` contract creation, type `2` contract destruction) - _addressAliases_ - maps addresses in the transaction to names from contract or ENS. Only addresses with known names are returned. + + ```javascript { "txid": "0xa6c8ae1f91918d09cf2bd67bbac4c168849e672fd81316fa1d26bb9b4fc0f790", @@ -324,10 +398,14 @@ GET /api/v2/tx-specific/ Example response: + + ```javascript { "hex": "040000808...8e6e73cb009", "txid": "7a0a0ff6f67bac2a856c7296382b69151949878de6fb0d01a8efa197182b2913", + "authdigest": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "size": 1809, "overwintered": true, "version": 4, "versiongroupid": "892f2085", @@ -337,6 +415,7 @@ Example response: "vout": [], "vjoinsplit": [], "valueBalance": 0, + "valueBalanceZat": 0, "vShieldedSpend": [ { "cv": "50258bfa65caa9f42f4448b9194840c7da73afc8159faf7358140bfd0f237962", @@ -367,7 +446,8 @@ Example response: ], "bindingSig": "bc018af8808387...5130bb382ad8e6e73cb009", "blockhash": "0000000001c4aa394e796dd1b82e358f114535204f6f5b6cf4ad58dc439c47af", - "confirmations": 5222, + "height": 495665, + "confirmations": 2145803, "time": 1552301566, "blocktime": 1552301566 } @@ -396,30 +476,33 @@ The optional query parameters: - _contract_: return only transactions which affect specified contract (applicable only to coins which support contracts) - _secondary_: specifies secondary (fiat) currency in which the token and total balances are returned in addition to crypto values -Example response for bitcoin type coin, _details_ set to _txids_: +Example response for bitcoin type coin, _details_ set to _txids_ (`Address` type): + + ```javascript { "page": 1, "totalPages": 1, "itemsOnPage": 1000, - "address": "D5Z7XrtJNg7hAtznSDMXvfiFmMYphwuWz7", - "balance": "2432468097999991", - "totalReceived": "3992283916999979", - "totalSent": "1559815818999988", + "address": "bc1q0wd209cv5k9pd9mhk7nspacywcj038xxdhnt5u", + "balance": "4225100", + "totalReceived": "4225100", + "totalSent": "0", "unconfirmedBalance": "0", "unconfirmedTxs": 0, - "txs": 3, + "txs": 2, "txids": [ - "461dd46d5d6f56d765f82e60e6bf0727a3a1d1cb8c4144373d805b152a21d308", - "bdb5b47603c5d174eae3384c368068c8e9d2183b398ed0e31d125defa4447a10", - "5c1d2686d70d82bd8e84b5d3dc4bd0e8485e28cdc865336db6a5e40b2098277d" + "0db6010dc0815a4bdaa505bd1ccc851056b0d53c7e4ea7af39c4d648a2c0c019", + "7532920ddc506218337cceac978cce9c7f98e27ad3226dee55f3e934e0b32e80" ] } ``` Example response for ethereum type coin, _details_ set to _tokenBalances_ and _secondary_ set to _usd_. The _baseValue_ is value of the token in the base currency (ETH), _secondaryValue_ is value of the token in specified _secondary_ currency: + + ```javascript { "address": "0x2df3951b2037bA620C20Ed0B73CCF45Ea473e83B", @@ -500,7 +583,7 @@ The optional query parameters: - _derived_: return all derived addresses - _secondary_: specifies secondary (fiat) currency in which the balances are returned in addition to crypto values -Response: +Response (`Address` type): ```javascript { @@ -562,7 +645,7 @@ Coinbase utxos have field _coinbase_ set to true, however due to performance rea GET /api/v2/utxo/[?confirmed=true] ``` -Response: +Response (`Utxo[]` type): ```javascript [ @@ -606,7 +689,7 @@ Returns information about block with transactions, subject to paging. GET /api/v2/block/ ``` -Response: +Response (`Block` type): ```javascript { @@ -737,7 +820,7 @@ The query parameters: - _timestamp_: specifies a Unix timestamp to return available tickers for. -Example response: +Example response (`AvailableVsCurrencies` type): ```javascript { @@ -763,7 +846,7 @@ The optional query parameters: - _currency_: specifies a currency of returned rate ("usd", "eur", "eth"...). If not specified, all available currencies will be returned. - _timestamp_: a Unix timestamp that specifies a date to return currency rates for. If not specified, the last available rate will be returned. -Example response (no parameters): +Example response (no parameters, `FiatTicker` type): ```javascript { @@ -815,7 +898,7 @@ The optional query parameters: - _fiatcurrency_: if specified, the response will contain secondary (fiat) rate at the time of transaction. If not, all available currencies will be returned. - _groupBy_: an interval in seconds, to group results by. Default is 3600 seconds. -Example response (_fiatcurrency_ not specified): +Example response (_fiatcurrency_ not specified, `BalanceHistory[]` type): ```javascript [ @@ -927,7 +1010,7 @@ The subscribeNewTransaction event is not enabled by default. To enable support, _Note: If there is reorg on the backend (blockchain), you will get a new block hash with the same or even smaller height if the reorg is deeper_ -Websocket communication format +Websocket communication format (`WsReq` type) ```javascript { @@ -951,7 +1034,7 @@ Example for subscribing to an address (or multiple addresses) ## Legacy API V1 -The legacy API is a compatible subset of API provided by **Bitcore Insight**. It is supported only Bitcoin-type coins. The details of the REST/socket.io requests can be found in the Insight's documentation. +The legacy API is a compatible subset of API provided by **Bitcore Insight**. It is supported only for Bitcoin-type coins. The details of the REST/socket.io requests can be found in the Insight's documentation. ### REST API @@ -972,4 +1055,4 @@ Socket.io interface is provided at `/socket.io/`. The interface also can be expl The legacy API is provided as is and will not be further developed. -The legacy API is currently (as of Blockbook v0.4.0) also accessible without the _/v1/_ prefix, however in the future versions the version less access will be removed. +The legacy API is currently (as of Blockbook v0.4.0) also accessible without the _/v1/_ prefix, however in the future versions the version-less access will be removed. From 059086cd3dbc235c06b2f4113bbaebee4894d991 Mon Sep 17 00:00:00 2001 From: JoHnY Date: Wed, 9 Oct 2024 14:11:41 +0000 Subject: [PATCH 23/56] =?UTF-8?q?zec=20(+testnet)=205.10.0=20=E2=86=92=206?= =?UTF-8?q?.0.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- configs/coins/zcash.json | 6 +++--- configs/coins/zcash_testnet.json | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/configs/coins/zcash.json b/configs/coins/zcash.json index 0e010986..f1be6baf 100644 --- a/configs/coins/zcash.json +++ b/configs/coins/zcash.json @@ -22,10 +22,10 @@ "package_name": "backend-zcash", "package_revision": "satoshilabs-1", "system_user": "zcash", - "version": "5.10.0", - "binary_url": "https://download.z.cash/downloads/zcash-5.10.0-linux64-debian-bullseye.tar.gz", + "version": "6.0.0", + "binary_url": "https://download.z.cash/downloads/zcash-6.0.0-linux64-debian-bullseye.tar.gz", "verification_type": "sha256", - "verification_source": "72d06e97bab29b2a21fc52637485840335fd7fff3f5f06ad9f66c326d3f7ca1f", + "verification_source": "3cb82f490e9c8e88007a0216b5261b33ef0fda962b9258441b2def59cb272a4d", "extract_command": "tar -C backend --strip 1 -xf", "exclude_files": [], "exec_command_template": "{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/bin/zcashd -datadir={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend -conf={{.Env.BackendInstallPath}}/{{.Coin.Alias}}/{{.Coin.Alias}}.conf -pid=/run/{{.Coin.Alias}}/{{.Coin.Alias}}.pid", diff --git a/configs/coins/zcash_testnet.json b/configs/coins/zcash_testnet.json index ca5d3a4c..0a185bba 100644 --- a/configs/coins/zcash_testnet.json +++ b/configs/coins/zcash_testnet.json @@ -21,10 +21,10 @@ "backend": { "package_name": "backend-zcash-testnet", "package_revision": "satoshilabs-1", - "version": "5.10.0", - "binary_url": "https://download.z.cash/downloads/zcash-5.10.0-linux64-debian-bullseye.tar.gz", + "version": "6.0.0", + "binary_url": "https://download.z.cash/downloads/zcash-6.0.0-linux64-debian-bullseye.tar.gz", "verification_type": "sha256", - "verification_source": "72d06e97bab29b2a21fc52637485840335fd7fff3f5f06ad9f66c326d3f7ca1f", + "verification_source": "3cb82f490e9c8e88007a0216b5261b33ef0fda962b9258441b2def59cb272a4d", "extract_command": "tar -C backend --strip 1 -xf", "exclude_files": [], "exec_command_template": "{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/bin/zcashd -datadir={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend -conf={{.Env.BackendInstallPath}}/{{.Coin.Alias}}/{{.Coin.Alias}}.conf -pid=/run/{{.Coin.Alias}}/{{.Coin.Alias}}.pid", From 76664cdbf37f008865586c4d716602cc00bf8398 Mon Sep 17 00:00:00 2001 From: Martin Boehm Date: Thu, 10 Oct 2024 00:58:19 +0200 Subject: [PATCH 24/56] Refactor ethCall method to rpcCall --- bchain/basechain.go | 4 +-- bchain/coins/blockchain.go | 8 +++--- bchain/coins/eth/contract.go | 14 +++++----- bchain/coins/eth/stakingpool.go | 2 +- bchain/types.go | 2 +- blockbook-api.ts | 4 +-- build/tools/typescriptify/typescriptify.go | 4 +-- docs/env.md | 2 +- server/public_ethereumtype_test.go | 6 ++--- server/public_test.go | 6 ++--- server/websocket.go | 30 +++++++++++----------- server/ws_types.go | 4 +-- static/test-websocket.html | 24 ++++++++--------- tests/dbtestdata/fakechain_ethereumtype.go | 4 +-- 14 files changed, 57 insertions(+), 57 deletions(-) diff --git a/bchain/basechain.go b/bchain/basechain.go index df494531..c84f907f 100644 --- a/bchain/basechain.go +++ b/bchain/basechain.go @@ -77,7 +77,7 @@ func (b *BaseChain) EthereumTypeGetStakingPoolsData(addrDesc AddressDescriptor) return nil, errors.New("not supported") } -// EthereumTypeEthCall calls eth_call with given data and to address -func (b *BaseChain) EthereumTypeEthCall(data, to, from string) (string, error) { +// EthereumTypeRpcCall calls eth_call with given data and to address +func (b *BaseChain) EthereumTypeRpcCall(data, to, from string) (string, error) { return "", errors.New("not supported") } diff --git a/bchain/coins/blockchain.go b/bchain/coins/blockchain.go index cdc877ca..f5dcdc03 100644 --- a/bchain/coins/blockchain.go +++ b/bchain/coins/blockchain.go @@ -342,10 +342,10 @@ func (c *blockChainWithMetrics) EthereumTypeGetStakingPoolsData(addrDesc bchain. return c.b.EthereumTypeGetStakingPoolsData(addrDesc) } -// EthereumTypeEthCall calls eth_call with given data and to address -func (c *blockChainWithMetrics) EthereumTypeEthCall(data, to, from string) (v string, err error) { - defer func(s time.Time) { c.observeRPCLatency("EthereumTypeEthCall", s, err) }(time.Now()) - return c.b.EthereumTypeEthCall(data, to, from) +// EthereumTypeRpcCall calls eth_call with given data and to address +func (c *blockChainWithMetrics) EthereumTypeRpcCall(data, to, from string) (v string, err error) { + defer func(s time.Time) { c.observeRPCLatency("EthereumTypeRpcCall", s, err) }(time.Now()) + return c.b.EthereumTypeRpcCall(data, to, from) } type mempoolWithMetrics struct { diff --git a/bchain/coins/eth/contract.go b/bchain/coins/eth/contract.go index 0d3bd237..efc7439a 100644 --- a/bchain/coins/eth/contract.go +++ b/bchain/coins/eth/contract.go @@ -273,8 +273,8 @@ func contractGetTransfersFromTx(tx *bchain.RpcTransaction) (bchain.TokenTransfer return r, nil } -// EthereumTypeEthCall calls eth_call with given data and to address -func (b *EthereumRPC) EthereumTypeEthCall(data, to, from string) (string, error) { +// EthereumTypeRpcCall calls eth_call with given data and to address +func (b *EthereumRPC) EthereumTypeRpcCall(data, to, from string) (string, error) { ctx, cancel := context.WithTimeout(context.Background(), b.Timeout) defer cancel() var r string @@ -294,7 +294,7 @@ func (b *EthereumRPC) EthereumTypeEthCall(data, to, from string) (string, error) func (b *EthereumRPC) fetchContractInfo(address string) (*bchain.ContractInfo, error) { var contract bchain.ContractInfo - data, err := b.EthereumTypeEthCall(contractNameSignature, address, "") + data, err := b.EthereumTypeRpcCall(contractNameSignature, address, "") if err != nil { // ignore the error from the eth_call - since geth v1.9.15 they changed the behavior // and returning error "execution reverted" for some non contract addresses @@ -305,14 +305,14 @@ func (b *EthereumRPC) fetchContractInfo(address string) (*bchain.ContractInfo, e } name := strings.TrimSpace(parseSimpleStringProperty(data)) if name != "" { - data, err = b.EthereumTypeEthCall(contractSymbolSignature, address, "") + data, err = b.EthereumTypeRpcCall(contractSymbolSignature, address, "") if err != nil { // glog.Warning(errors.Annotatef(err, "Contract SymbolSignature %v", address)) return nil, nil // return nil, errors.Annotatef(err, "erc20SymbolSignature %v", address) } symbol := strings.TrimSpace(parseSimpleStringProperty(data)) - data, _ = b.EthereumTypeEthCall(contractDecimalsSignature, address, "") + data, _ = b.EthereumTypeRpcCall(contractDecimalsSignature, address, "") // if err != nil { // glog.Warning(errors.Annotatef(err, "Contract DecimalsSignature %v", address)) // // return nil, errors.Annotatef(err, "erc20DecimalsSignature %v", address) @@ -345,7 +345,7 @@ func (b *EthereumRPC) EthereumTypeGetErc20ContractBalance(addrDesc, contractDesc addr := hexutil.Encode(addrDesc)[2:] contract := hexutil.Encode(contractDesc) req := contractBalanceOfSignature + "0000000000000000000000000000000000000000000000000000000000000000"[len(addr):] + addr - data, err := b.EthereumTypeEthCall(req, contract, "") + data, err := b.EthereumTypeRpcCall(req, contract, "") if err != nil { return nil, err } @@ -369,7 +369,7 @@ func (b *EthereumRPC) GetTokenURI(contractDesc bchain.AddressDescriptor, tokenID } // try ERC721 tokenURI method and ERC1155 uri method for _, method := range []string{erc721TokenURIMethodSignature, erc1155URIMethodSignature} { - data, err := b.EthereumTypeEthCall(method+id, address, "") + data, err := b.EthereumTypeRpcCall(method+id, address, "") if err == nil && data != "" { uri := parseSimpleStringProperty(data) // try to sanitize the URI returned from the contract diff --git a/bchain/coins/eth/stakingpool.go b/bchain/coins/eth/stakingpool.go index 4a40057a..8b7cf7b8 100644 --- a/bchain/coins/eth/stakingpool.go +++ b/bchain/coins/eth/stakingpool.go @@ -61,7 +61,7 @@ func isZeroBigInt(b *big.Int) bool { func (b *EthereumRPC) everstakeBalanceTypeContractCall(signature, addr, contract string) (string, error) { req := signature + "0000000000000000000000000000000000000000000000000000000000000000"[len(addr):] + addr - return b.EthereumTypeEthCall(req, contract, "") + return b.EthereumTypeRpcCall(req, contract, "") } func (b *EthereumRPC) everstakeContractCallSimpleNumeric(signature, addr, contract string) (*big.Int, error) { diff --git a/bchain/types.go b/bchain/types.go index ee29be9d..3fd2dcfe 100644 --- a/bchain/types.go +++ b/bchain/types.go @@ -335,7 +335,7 @@ type BlockChain interface { EthereumTypeGetErc20ContractBalance(addrDesc, contractDesc AddressDescriptor) (*big.Int, error) EthereumTypeGetSupportedStakingPools() []string EthereumTypeGetStakingPoolsData(addrDesc AddressDescriptor) ([]StakingPoolData, error) - EthereumTypeEthCall(data, to, from string) (string, error) + EthereumTypeRpcCall(data, to, from string) (string, error) GetTokenURI(contractDesc AddressDescriptor, tokenID *big.Int) (string, error) } diff --git a/blockbook-api.ts b/blockbook-api.ts index ca722a37..295acff9 100644 --- a/blockbook-api.ts +++ b/blockbook-api.ts @@ -448,12 +448,12 @@ export interface WsMempoolFiltersReq { fromTimestamp: number; M?: number; } -export interface WsEthCallReq { +export interface WsRpcCallReq { from?: string; to: string; data: string; } -export interface WsEthCallRes { +export interface WsRpcCallRes { data: string; } export interface MempoolTxidFilterEntries { diff --git a/build/tools/typescriptify/typescriptify.go b/build/tools/typescriptify/typescriptify.go index 5e24f620..069572cb 100644 --- a/build/tools/typescriptify/typescriptify.go +++ b/build/tools/typescriptify/typescriptify.go @@ -60,8 +60,8 @@ func main() { t.Add(server.WsFiatRatesForTimestampsReq{}) t.Add(server.WsFiatRatesTickersListReq{}) t.Add(server.WsMempoolFiltersReq{}) - t.Add(server.WsEthCallReq{}) - t.Add(server.WsEthCallRes{}) + t.Add(server.WsRpcCallReq{}) + t.Add(server.WsRpcCallRes{}) t.Add(bchain.MempoolTxidFilterEntries{}) err := t.ConvertToFile("blockbook-api.ts") diff --git a/docs/env.md b/docs/env.md index 98383453..8d95dc98 100644 --- a/docs/env.md +++ b/docs/env.md @@ -8,4 +8,4 @@ Some behavior of Blockbook can be modified by environment variables. The variabl - `COINGECKO_API_KEY` or `_COINGECKO_API_KEY` - API key for making requests to CoinGecko in the paid tier. -- `_ALLOWED_ETH_CALL_CONTRACTS` - Contract addresses for which `ethCall` websocket requests can be made, as a comma-separated list. If omitted, `ethCall` is enabled for all addresses. +- `_ALLOWED_RPC_CALL_TO` - Addresses to which `rpcCall` websocket requests can be made, as a comma-separated list. If omitted, `rpcCall` is enabled for all addresses. diff --git a/server/public_ethereumtype_test.go b/server/public_ethereumtype_test.go index b7a6c6c9..5a953533 100644 --- a/server/public_ethereumtype_test.go +++ b/server/public_ethereumtype_test.go @@ -143,10 +143,10 @@ var websocketTestsEthereumType = []websocketTest{ want: `{"id":"0","data":{"name":"Fakecoin","shortcut":"FAKE","network":"FAKE","decimals":18,"version":"unknown","bestHeight":4321001,"bestHash":"0x2b57e15e93a0ed197417a34c2498b7187df79099572c04a6b6e6ff418f74e6ee","block0Hash":"","testnet":true,"backend":{"version":"001001","subversion":"/Fakecoin:0.0.1/"}}}`, }, { - name: "websocket ethCall", + name: "websocket rpcCall", req: websocketReq{ - Method: "ethCall", - Params: WsEthCallReq{ + Method: "rpcCall", + Params: WsRpcCallReq{ To: "0xcdA9FC258358EcaA88845f19Af595e908bb7EfE9", Data: "0x4567", }, diff --git a/server/public_test.go b/server/public_test.go index 9b8ed215..01e34e9b 100644 --- a/server/public_test.go +++ b/server/public_test.go @@ -1485,10 +1485,10 @@ var websocketTestsBitcoinType = []websocketTest{ want: `{"id":"43","data":{"P":0,"M":1,"zeroedKey":false,"blockFilter":""}}`, }, { - name: "websocket ethCall", + name: "websocket rpcCall", req: websocketReq{ - Method: "ethCall", - Params: WsEthCallReq{ + Method: "rpcCall", + Params: WsRpcCallReq{ To: "0x123", Data: "0x456", }, diff --git a/server/websocket.go b/server/websocket.go index 4a0745b4..f9093eeb 100644 --- a/server/websocket.go +++ b/server/websocket.go @@ -71,7 +71,7 @@ type WebsocketServer struct { fiatRatesSubscriptions map[string]map[*websocketChannel]string fiatRatesTokenSubscriptions map[*websocketChannel][]string fiatRatesSubscriptionsLock sync.Mutex - allowedEthCallContracts map[string]struct{} + allowedRpcCallTo map[string]struct{} } // NewWebsocketServer creates new websocket interface to blockbook and returns its handle @@ -107,13 +107,13 @@ func NewWebsocketServer(db *db.RocksDB, chain bchain.BlockChain, mempool bchain. fiatRatesSubscriptions: make(map[string]map[*websocketChannel]string), fiatRatesTokenSubscriptions: make(map[*websocketChannel][]string), } - envEthCall := os.Getenv(strings.ToUpper(is.CoinShortcut) + "_ALLOWED_ETH_CALL_CONTRACTS") - if envEthCall != "" { - s.allowedEthCallContracts = make(map[string]struct{}) - for _, c := range strings.Split(envEthCall, ",") { - s.allowedEthCallContracts[strings.ToLower(c)] = struct{}{} + envRpcCall := os.Getenv(strings.ToUpper(is.CoinShortcut) + "_ALLOWED_RPC_CALL_TO") + if envRpcCall != "" { + s.allowedRpcCallTo = make(map[string]struct{}) + for _, c := range strings.Split(envRpcCall, ",") { + s.allowedRpcCallTo[strings.ToLower(c)] = struct{}{} } - glog.Info("Support of ethCall for these contracts: ", envEthCall) + glog.Info("Support of rpcCall for these contracts: ", envRpcCall) } return s, nil } @@ -401,11 +401,11 @@ var requestHandlers = map[string]func(*WebsocketServer, *websocketChannel, *WsRe } return }, - "ethCall": func(s *WebsocketServer, c *websocketChannel, req *WsReq) (rv interface{}, err error) { - r := WsEthCallReq{} + "rpcCall": func(s *WebsocketServer, c *websocketChannel, req *WsReq) (rv interface{}, err error) { + r := WsRpcCallReq{} err = json.Unmarshal(req.Params, &r) if err == nil { - rv, err = s.ethCall(&r) + rv, err = s.rpcCall(&r) } return }, @@ -765,18 +765,18 @@ func (s *WebsocketServer) getBlockFiltersBatch(r *WsBlockFiltersBatchReq) (res i }, nil } -func (s *WebsocketServer) ethCall(r *WsEthCallReq) (*WsEthCallRes, error) { - if s.allowedEthCallContracts != nil { - _, ok := s.allowedEthCallContracts[strings.ToLower(r.To)] +func (s *WebsocketServer) rpcCall(r *WsRpcCallReq) (*WsRpcCallRes, error) { + if s.allowedRpcCallTo != nil { + _, ok := s.allowedRpcCallTo[strings.ToLower(r.To)] if !ok { return nil, errors.New("Not supported") } } - data, err := s.chain.EthereumTypeEthCall(r.Data, r.To, r.From) + data, err := s.chain.EthereumTypeRpcCall(r.Data, r.To, r.From) if err != nil { return nil, err } - return &WsEthCallRes{Data: data}, nil + return &WsRpcCallRes{Data: data}, nil } type subscriptionResponse struct { diff --git a/server/ws_types.go b/server/ws_types.go index 248e1d32..f49f02ad 100644 --- a/server/ws_types.go +++ b/server/ws_types.go @@ -139,12 +139,12 @@ type WsFiatRatesTickersListReq struct { Token string `json:"token,omitempty"` } -type WsEthCallReq struct { +type WsRpcCallReq struct { From string `json:"from,omitempty"` To string `json:"to"` Data string `json:"data"` } -type WsEthCallRes struct { +type WsRpcCallRes struct { Data string `json:"data"` } diff --git a/static/test-websocket.html b/static/test-websocket.html index 4f2cc0f6..e4e2b22b 100644 --- a/static/test-websocket.html +++ b/static/test-websocket.html @@ -536,18 +536,18 @@ }); } - function ethCall() { - const from = document.getElementById('ethCallFrom').value.trim(); - const to = document.getElementById('ethCallTo').value.trim(); - const data = document.getElementById('ethCallData').value.trim(); - const method = 'ethCall'; + function rpcCall() { + const from = document.getElementById('rpcCallFrom').value.trim(); + const to = document.getElementById('rpcCallTo').value.trim(); + const data = document.getElementById('rpcCallData').value.trim(); + const method = 'rpcCall'; const params = { from, to, data, }; send(method, params, function (result) { - document.getElementById('ethCallResult').innerText = JSON.stringify( + document.getElementById('rpcCallResult').innerText = JSON.stringify( result, ).replace(/,/g, ', '); }); @@ -1118,8 +1118,8 @@
@@ -1127,7 +1127,7 @@
-
+
diff --git a/tests/dbtestdata/fakechain_ethereumtype.go b/tests/dbtestdata/fakechain_ethereumtype.go index 09abdfe9..a8469271 100644 --- a/tests/dbtestdata/fakechain_ethereumtype.go +++ b/tests/dbtestdata/fakechain_ethereumtype.go @@ -134,8 +134,8 @@ func (c *fakeBlockChainEthereumType) EthereumTypeGetErc20ContractBalance(addrDes return big.NewInt(1000000000 + int64(addrDesc[0])*1000 + int64(contractDesc[0])), nil } -// EthereumTypeEthCall calls eth_call with given data and to address -func (c *fakeBlockChainEthereumType) EthereumTypeEthCall(data, to, from string) (string, error) { +// EthereumTypeRpcCall calls eth_call with given data and to address +func (c *fakeBlockChainEthereumType) EthereumTypeRpcCall(data, to, from string) (string, error) { return data + "abcd", nil } From 0cc953fccaba90f0becebf01ef392326db7ccc68 Mon Sep 17 00:00:00 2001 From: Martin Boehm Date: Fri, 11 Oct 2024 11:50:07 +0200 Subject: [PATCH 25/56] btc (+testnet) 27.1 -> 28.0 --- build/templates/backend/config/bitcoin.conf | 2 ++ build/templates/backend/config/bitcoin_regtest.conf | 2 ++ .../{bitcoin-signet.conf => bitcoin_signet.conf} | 2 ++ configs/coins/bitcoin.json | 10 +++++----- configs/coins/bitcoin_regtest.json | 10 +++++----- configs/coins/bitcoin_signet.json | 12 ++++++------ configs/coins/bitcoin_testnet.json | 10 +++++----- configs/coins/groestlcoin_signet.json | 10 +++++----- 8 files changed, 32 insertions(+), 26 deletions(-) rename build/templates/backend/config/{bitcoin-signet.conf => bitcoin_signet.conf} (96%) diff --git a/build/templates/backend/config/bitcoin.conf b/build/templates/backend/config/bitcoin.conf index c6f94c73..619f6785 100644 --- a/build/templates/backend/config/bitcoin.conf +++ b/build/templates/backend/config/bitcoin.conf @@ -16,6 +16,8 @@ mempoolfullrbf=1 dbcache=1000 +deprecatedrpc=warnings + {{- if .Backend.AdditionalParams}} # generated from additional_params {{- range $name, $value := .Backend.AdditionalParams}} diff --git a/build/templates/backend/config/bitcoin_regtest.conf b/build/templates/backend/config/bitcoin_regtest.conf index 0fb7aef2..3bdfc3dc 100644 --- a/build/templates/backend/config/bitcoin_regtest.conf +++ b/build/templates/backend/config/bitcoin_regtest.conf @@ -12,6 +12,8 @@ rpcworkqueue=1100 maxmempool=2000 dbcache=1000 +deprecatedrpc=warnings + {{- if .Backend.AdditionalParams}} # generated from additional_params {{- range $name, $value := .Backend.AdditionalParams}} diff --git a/build/templates/backend/config/bitcoin-signet.conf b/build/templates/backend/config/bitcoin_signet.conf similarity index 96% rename from build/templates/backend/config/bitcoin-signet.conf rename to build/templates/backend/config/bitcoin_signet.conf index c26fa574..e88a0fd5 100644 --- a/build/templates/backend/config/bitcoin-signet.conf +++ b/build/templates/backend/config/bitcoin_signet.conf @@ -13,6 +13,8 @@ rpcworkqueue=1100 maxmempool=2000 dbcache=1000 +deprecatedrpc=warnings + {{- if .Backend.AdditionalParams}} # generated from additional_params {{- range $name, $value := .Backend.AdditionalParams}} diff --git a/configs/coins/bitcoin.json b/configs/coins/bitcoin.json index 61fbb924..9e4b09ec 100644 --- a/configs/coins/bitcoin.json +++ b/configs/coins/bitcoin.json @@ -22,10 +22,10 @@ "package_name": "backend-bitcoin", "package_revision": "satoshilabs-1", "system_user": "bitcoin", - "version": "27.1", - "binary_url": "https://bitcoincore.org/bin/bitcoin-core-27.1/bitcoin-27.1-x86_64-linux-gnu.tar.gz", + "version": "28.0", + "binary_url": "https://bitcoincore.org/bin/bitcoin-core-28.0/bitcoin-28.0-x86_64-linux-gnu.tar.gz", "verification_type": "sha256", - "verification_source": "c9840607d230d65f6938b81deaec0b98fe9cb14c3a41a5b13b2c05d044a48422", + "verification_source": "7fe294b02b25b51acb8e8e0a0eb5af6bbafa7cd0c5b0e5fcbb61263104a82fbc", "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", @@ -43,8 +43,8 @@ }, "platforms": { "arm64": { - "binary_url": "https://bitcoincore.org/bin/bitcoin-core-27.1/bitcoin-27.1-aarch64-linux-gnu.tar.gz", - "verification_source": "bb878df4f8ff8fb8acfb94207c50f959c462c39e652f507c2a2db20acc6a1eee" + "binary_url": "https://bitcoincore.org/bin/bitcoin-core-28.0/bitcoin-28.0-aarch64-linux-gnu.tar.gz", + "verification_source": "7fa582d99a25c354d23e371a5848bd9e6a79702870f9cbbf1292b86e647d0f4e" } } }, diff --git a/configs/coins/bitcoin_regtest.json b/configs/coins/bitcoin_regtest.json index 96a6c898..42f94833 100644 --- a/configs/coins/bitcoin_regtest.json +++ b/configs/coins/bitcoin_regtest.json @@ -22,10 +22,10 @@ "package_name": "backend-bitcoin-regtest", "package_revision": "satoshilabs-1", "system_user": "bitcoin", - "version": "27.1", - "binary_url": "https://bitcoincore.org/bin/bitcoin-core-27.1/bitcoin-27.1-x86_64-linux-gnu.tar.gz", + "version": "28.0", + "binary_url": "https://bitcoincore.org/bin/bitcoin-core-28.0/bitcoin-28.0-x86_64-linux-gnu.tar.gz", "verification_type": "sha256", - "verification_source": "c9840607d230d65f6938b81deaec0b98fe9cb14c3a41a5b13b2c05d044a48422", + "verification_source": "7fe294b02b25b51acb8e8e0a0eb5af6bbafa7cd0c5b0e5fcbb61263104a82fbc", "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", @@ -42,8 +42,8 @@ }, "platforms": { "arm64": { - "binary_url": "https://bitcoincore.org/bin/bitcoin-core-27.1/bitcoin-27.1-aarch64-linux-gnu.tar.gz", - "verification_source": "bb878df4f8ff8fb8acfb94207c50f959c462c39e652f507c2a2db20acc6a1eee" + "binary_url": "https://bitcoincore.org/bin/bitcoin-core-28.0/bitcoin-28.0-aarch64-linux-gnu.tar.gz", + "verification_source": "7fa582d99a25c354d23e371a5848bd9e6a79702870f9cbbf1292b86e647d0f4e" } } }, diff --git a/configs/coins/bitcoin_signet.json b/configs/coins/bitcoin_signet.json index 7a94587f..c18e71cc 100644 --- a/configs/coins/bitcoin_signet.json +++ b/configs/coins/bitcoin_signet.json @@ -22,10 +22,10 @@ "package_name": "backend-bitcoin-signet", "package_revision": "satoshilabs-1", "system_user": "bitcoin", - "version": "27.1", - "binary_url": "https://bitcoincore.org/bin/bitcoin-core-27.1/bitcoin-27.1-x86_64-linux-gnu.tar.gz", + "version": "28.0", + "binary_url": "https://bitcoincore.org/bin/bitcoin-core-28.0/bitcoin-28.0-x86_64-linux-gnu.tar.gz", "verification_type": "sha256", - "verification_source": "c9840607d230d65f6938b81deaec0b98fe9cb14c3a41a5b13b2c05d044a48422", + "verification_source": "7fe294b02b25b51acb8e8e0a0eb5af6bbafa7cd0c5b0e5fcbb61263104a82fbc", "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", @@ -35,15 +35,15 @@ "service_additional_params_template": "", "protect_memory": true, "mainnet": false, - "server_config_file": "bitcoin-signet.conf", + "server_config_file": "bitcoin_signet.conf", "client_config_file": "bitcoin_client.conf", "additional_params": { "deprecatedrpc": "estimatefee" }, "platforms": { "arm64": { - "binary_url": "https://bitcoincore.org/bin/bitcoin-core-27.1/bitcoin-27.1-aarch64-linux-gnu.tar.gz", - "verification_source": "bb878df4f8ff8fb8acfb94207c50f959c462c39e652f507c2a2db20acc6a1eee" + "binary_url": "https://bitcoincore.org/bin/bitcoin-core-28.0/bitcoin-28.0-aarch64-linux-gnu.tar.gz", + "verification_source": "7fa582d99a25c354d23e371a5848bd9e6a79702870f9cbbf1292b86e647d0f4e" } } }, diff --git a/configs/coins/bitcoin_testnet.json b/configs/coins/bitcoin_testnet.json index 3b6741e1..dc6048f6 100644 --- a/configs/coins/bitcoin_testnet.json +++ b/configs/coins/bitcoin_testnet.json @@ -22,10 +22,10 @@ "package_name": "backend-bitcoin-testnet", "package_revision": "satoshilabs-1", "system_user": "bitcoin", - "version": "27.1", - "binary_url": "https://bitcoincore.org/bin/bitcoin-core-27.1/bitcoin-27.1-x86_64-linux-gnu.tar.gz", + "version": "28.0", + "binary_url": "https://bitcoincore.org/bin/bitcoin-core-28.0/bitcoin-28.0-x86_64-linux-gnu.tar.gz", "verification_type": "sha256", - "verification_source": "c9840607d230d65f6938b81deaec0b98fe9cb14c3a41a5b13b2c05d044a48422", + "verification_source": "7fe294b02b25b51acb8e8e0a0eb5af6bbafa7cd0c5b0e5fcbb61263104a82fbc", "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", @@ -42,8 +42,8 @@ }, "platforms": { "arm64": { - "binary_url": "https://bitcoincore.org/bin/bitcoin-core-27.1/bitcoin-27.1-aarch64-linux-gnu.tar.gz", - "verification_source": "bb878df4f8ff8fb8acfb94207c50f959c462c39e652f507c2a2db20acc6a1eee" + "binary_url": "https://bitcoincore.org/bin/bitcoin-core-28.0/bitcoin-28.0-aarch64-linux-gnu.tar.gz", + "verification_source": "7fa582d99a25c354d23e371a5848bd9e6a79702870f9cbbf1292b86e647d0f4e" } } }, diff --git a/configs/coins/groestlcoin_signet.json b/configs/coins/groestlcoin_signet.json index 2fd281a2..20a01996 100644 --- a/configs/coins/groestlcoin_signet.json +++ b/configs/coins/groestlcoin_signet.json @@ -35,16 +35,16 @@ "service_additional_params_template": "", "protect_memory": true, "mainnet": false, - "server_config_file": "bitcoin-signet.conf", + "server_config_file": "bitcoin_signet.conf", "client_config_file": "bitcoin_client.conf", "additional_params": { "deprecatedrpc": "estimatefee" }, "platforms": { - "arm64": { - "binary_url": "https://github.com/Groestlcoin/groestlcoin/releases/download/v27.0/groestlcoin-27.0-aarch64-linux-gnu.tar.gz", - "verification_source": "95e1a4c4f4d50709df40e2d86c4b578db053d1cb475a3384862192c1298f9de6" - } + "arm64": { + "binary_url": "https://github.com/Groestlcoin/groestlcoin/releases/download/v27.0/groestlcoin-27.0-aarch64-linux-gnu.tar.gz", + "verification_source": "95e1a4c4f4d50709df40e2d86c4b578db053d1cb475a3384862192c1298f9de6" + } } }, "blockbook": { From d8c68f2b6b7d9a08d99a6a68f8215b84d3f1f8dd Mon Sep 17 00:00:00 2001 From: Martin Boehm Date: Thu, 10 Oct 2024 01:28:38 +0200 Subject: [PATCH 26/56] Add Bitcoin Testnet4 --- bchain/coins/blockchain.go | 1 + .../backend/config/bitcoin_testnet4.conf | 38 +++++++++ configs/coins/bitcoin_testnet4.json | 80 +++++++++++++++++++ docs/ports.md | 3 +- 4 files changed, 121 insertions(+), 1 deletion(-) create mode 100644 build/templates/backend/config/bitcoin_testnet4.conf create mode 100644 configs/coins/bitcoin_testnet4.json diff --git a/bchain/coins/blockchain.go b/bchain/coins/blockchain.go index f5dcdc03..f0cfa3cc 100644 --- a/bchain/coins/blockchain.go +++ b/bchain/coins/blockchain.go @@ -67,6 +67,7 @@ var BlockChainFactories = make(map[string]blockChainFactory) func init() { BlockChainFactories["Bitcoin"] = btc.NewBitcoinRPC BlockChainFactories["Testnet"] = btc.NewBitcoinRPC + BlockChainFactories["Testnet4"] = btc.NewBitcoinRPC BlockChainFactories["Signet"] = btc.NewBitcoinRPC BlockChainFactories["Regtest"] = btc.NewBitcoinRPC BlockChainFactories["Zcash"] = zec.NewZCashRPC diff --git a/build/templates/backend/config/bitcoin_testnet4.conf b/build/templates/backend/config/bitcoin_testnet4.conf new file mode 100644 index 00000000..46a5370b --- /dev/null +++ b/build/templates/backend/config/bitcoin_testnet4.conf @@ -0,0 +1,38 @@ +{{define "main" -}} +daemon=1 +server=1 +{{if .Backend.Mainnet}}mainnet=1{{else}}testnet4=1{{end}} +nolisten=1 +txindex=1 +disablewallet=1 + +zmqpubhashtx={{template "IPC.MessageQueueBindingTemplate" .}} +zmqpubhashblock={{template "IPC.MessageQueueBindingTemplate" .}} + +rpcworkqueue=1100 +maxmempool=4096 +mempoolexpiry=8760 +mempoolfullrbf=1 + +dbcache=1000 + +deprecatedrpc=warnings + +{{- 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}} + +{{if .Backend.Mainnet}}[main]{{else}}[testnet4]{{end}} +{{generateRPCAuth .IPC.RPCUser .IPC.RPCPass -}} +rpcport={{.Ports.BackendRPC}} + +{{end}} diff --git a/configs/coins/bitcoin_testnet4.json b/configs/coins/bitcoin_testnet4.json new file mode 100644 index 00000000..75bf73e8 --- /dev/null +++ b/configs/coins/bitcoin_testnet4.json @@ -0,0 +1,80 @@ +{ + "coin": { + "name": "Testnet4", + "shortcut": "TEST", + "label": "Bitcoin Testnet4", + "alias": "bitcoin_testnet4" + }, + "ports": { + "backend_rpc": 18029, + "backend_message_queue": 48329, + "blockbook_internal": 19029, + "blockbook_public": 19129 + }, + "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-testnet4", + "package_revision": "satoshilabs-1", + "system_user": "bitcoin", + "version": "28.0", + "binary_url": "https://bitcoincore.org/bin/bitcoin-core-28.0/bitcoin-28.0-x86_64-linux-gnu.tar.gz", + "verification_type": "sha256", + "verification_source": "7fe294b02b25b51acb8e8e0a0eb5af6bbafa7cd0c5b0e5fcbb61263104a82fbc", + "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/testnet4/*.log", + "postinst_script_template": "", + "service_type": "forking", + "service_additional_params_template": "", + "protect_memory": true, + "mainnet": false, + "server_config_file": "bitcoin_testnet4.conf", + "client_config_file": "bitcoin_client.conf", + "additional_params": { + "deprecatedrpc": "estimatefee" + }, + "platforms": { + "arm64": { + "binary_url": "https://bitcoincore.org/bin/bitcoin-core-28.0/bitcoin-28.0-aarch64-linux-gnu.tar.gz", + "verification_source": "7fa582d99a25c354d23e371a5848bd9e6a79702870f9cbbf1292b86e647d0f4e" + } + } + }, + "blockbook": { + "package_name": "blockbook-bitcoin-testnet4", + "system_user": "blockbook-bitcoin", + "internal_binding_template": ":{{.Ports.BlockbookInternal}}", + "public_binding_template": ":{{.Ports.BlockbookPublic}}", + "explorer_url": "", + "additional_params": "-enablesubnewtx -extendedindex", + "block_chain": { + "parse": true, + "mempool_workers": 8, + "mempool_sub_workers": 2, + "block_addresses_to_keep": 10000, + "xpub_magic": 70617039, + "xpub_magic_segwit_p2sh": 71979618, + "xpub_magic_segwit_native": 73342198, + "slip44": 1, + "additional_params": { + "block_golomb_filter_p": 20, + "block_filter_scripts": "taproot-noordinals", + "block_filter_use_zeroed_key": true, + "mempool_golomb_filter_p": 20, + "mempool_filter_scripts": "taproot", + "mempool_filter_use_zeroed_key": false + } + } + }, + "meta": { + "package_maintainer": "IT", + "package_maintainer_email": "it@satoshilabs.com" + } +} diff --git a/docs/ports.md b/docs/ports.md index b18bfb46..bbb1bac1 100644 --- a/docs/ports.md +++ b/docs/ports.md @@ -1,7 +1,7 @@ # Registry of ports | coin | blockbook public | blockbook internal | backend rpc | backend service ports (zmq) | -|----------------------------------|------------------|--------------------|-------------|-----------------------------------------------------| +| -------------------------------- | ---------------- | ------------------ | ----------- | --------------------------------------------------- | | Ethereum Archive | 9116 | 9016 | 8016 | 38316 p2p, 8116 http, 8516 authrpc | | Bitcoin | 9130 | 9030 | 8030 | 38330 | | Bitcoin Cash | 9131 | 9031 | 8031 | 38331 | @@ -58,6 +58,7 @@ | Ethereum Testnet Holesky | 19116 | 19016 | 18016 | 18116 http, 18516 authrpc, 48316 p2p | | Bitcoin Signet | 19120 | 19020 | 18020 | 48320 | | Bitcoin Regtest | 19121 | 19021 | 18021 | 48321 | +| Bitcoin Testnet4 | 19129 | 19029 | 18029 | 48329 | | Bitcoin Testnet | 19130 | 19030 | 18030 | 48330 | | Bitcoin Cash Testnet | 19131 | 19031 | 18031 | 48331 | | Zcash Testnet | 19132 | 19032 | 18032 | 48332 | From c3cd4445781d7a0883b02b856e894883327ea46a Mon Sep 17 00:00:00 2001 From: JoHnY Date: Tue, 15 Oct 2024 13:38:31 +0000 Subject: [PATCH 27/56] =?UTF-8?q?polygon-heimdall=201.0.5=20=E2=86=92=201.?= =?UTF-8?q?0.10?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- configs/coins/polygon_heimdall.json | 10 +++++----- configs/coins/polygon_heimdall_archive.json | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/configs/coins/polygon_heimdall.json b/configs/coins/polygon_heimdall.json index 6a57ea81..1486deeb 100644 --- a/configs/coins/polygon_heimdall.json +++ b/configs/coins/polygon_heimdall.json @@ -16,16 +16,16 @@ "package_name": "backend-polygon-heimdall", "package_revision": "satoshilabs-1", "system_user": "polygon", - "version": "1.0.5", - "binary_url": "https://github.com/maticnetwork/heimdall/archive/refs/tags/v1.0.5.tar.gz", + "version": "1.0.10", + "binary_url": "https://github.com/maticnetwork/heimdall/archive/refs/tags/v1.0.10.tar.gz", "verification_type": "sha256", - "verification_source": "59727263cb3927dd47e5c00dc3c5754f0cd7680af6e1ae019b4b540b3442197c", - "extract_command": "mkdir backend/source && tar -C backend/source --strip 1 -xf v1.0.5.tar.gz && cd backend/source && make build && mv build/heimdalld ../ && rm -rf ../source && echo", + "verification_source": "9058e054de2a0090e0a8400aa23d6144d7432ac31c6b4e4b6cff684a834e612f", + "extract_command": "mkdir backend/source && tar -C backend/source --strip 1 -xf v1.0.10.tar.gz && cd backend/source && make build && mv build/heimdalld ../ && rm -rf ../source && echo", "exclude_files": [], "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/polygon_heimdall_exec.sh 2>&1 >> {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", "exec_script": "polygon_heimdall.sh", "logrotate_files_template": "{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log", - "postinst_script_template": "wget https://raw.githubusercontent.com/maticnetwork/heimdall/v1.0.5/builder/files/genesis-mainnet-v1.json -O {{.Env.BackendInstallPath}}/{{.Coin.Alias}}/genesis.json", + "postinst_script_template": "wget https://raw.githubusercontent.com/maticnetwork/heimdall/v1.0.10/builder/files/genesis-mainnet-v1.json -O {{.Env.BackendInstallPath}}/{{.Coin.Alias}}/genesis.json", "service_type": "simple", "service_additional_params_template": "", "protect_memory": true, diff --git a/configs/coins/polygon_heimdall_archive.json b/configs/coins/polygon_heimdall_archive.json index 82114a9c..228f42d0 100644 --- a/configs/coins/polygon_heimdall_archive.json +++ b/configs/coins/polygon_heimdall_archive.json @@ -16,16 +16,16 @@ "package_name": "backend-polygon-archive-heimdall", "package_revision": "satoshilabs-1", "system_user": "polygon", - "version": "1.0.5", - "binary_url": "https://github.com/maticnetwork/heimdall/archive/refs/tags/v1.0.5.tar.gz", + "version": "1.0.10", + "binary_url": "https://github.com/maticnetwork/heimdall/archive/refs/tags/v1.0.10.tar.gz", "verification_type": "sha256", - "verification_source": "59727263cb3927dd47e5c00dc3c5754f0cd7680af6e1ae019b4b540b3442197c", - "extract_command": "mkdir backend/source && tar -C backend/source --strip 1 -xf v1.0.5.tar.gz && cd backend/source && make build && mv build/heimdalld ../ && rm -rf ../source && echo", + "verification_source": "9058e054de2a0090e0a8400aa23d6144d7432ac31c6b4e4b6cff684a834e612f", + "extract_command": "mkdir backend/source && tar -C backend/source --strip 1 -xf v1.0.10.tar.gz && cd backend/source && make build && mv build/heimdalld ../ && rm -rf ../source && echo", "exclude_files": [], "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/polygon_archive_heimdall_exec.sh 2>&1 >> {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", "exec_script": "polygon_archive_heimdall.sh", "logrotate_files_template": "{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log", - "postinst_script_template": "wget https://raw.githubusercontent.com/maticnetwork/heimdall/v1.0.5/builder/files/genesis-mainnet-v1.json -O {{.Env.BackendInstallPath}}/{{.Coin.Alias}}/genesis.json", + "postinst_script_template": "wget https://raw.githubusercontent.com/maticnetwork/heimdall/v1.0.10/builder/files/genesis-mainnet-v1.json -O {{.Env.BackendInstallPath}}/{{.Coin.Alias}}/genesis.json", "service_type": "simple", "service_additional_params_template": "", "protect_memory": true, From 572d7e5075741f483f416e892adeee0c6f916711 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 17 Sep 2024 09:54:33 +0200 Subject: [PATCH 28/56] Update Firo daemon 0.14.14.0 (mandatory) --- configs/coins/firo.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/configs/coins/firo.json b/configs/coins/firo.json index 102733fc..14a0f65b 100644 --- a/configs/coins/firo.json +++ b/configs/coins/firo.json @@ -22,10 +22,10 @@ "package_name": "backend-firo", "package_revision": "satoshilabs-1", "system_user": "firo", - "version": "0.14.13.3", - "binary_url": "https://github.com/firoorg/firo/releases/download/v0.14.13.3/firo-0.14.13.3-linux64.tar.gz", + "version": "0.14.14.0", + "binary_url": "https://github.com/firoorg/firo/releases/download/v0.14.14.0/firo-0.14.14.0-linux64.tar.gz", "verification_type": "sha256", - "verification_source": "39a4729fe9ab95cf3a236b95aadd53c3a18ac8737b7bfdd8934dd5524e19d2e8", + "verification_source": "0f8c914286031830d8c9eb1ab86b3e21f349917aea7bc2ab12229ab4c638cbe8", "extract_command": "tar -C backend --strip 1 -xf", "exclude_files": [ "bin/firo-qt", From fe676b354def59e7b2dbd74db007a34007cfbdf4 Mon Sep 17 00:00:00 2001 From: JoHnY Date: Mon, 21 Oct 2024 12:32:21 +0000 Subject: [PATCH 29/56] =?UTF-8?q?prysm=205.1.0=20=E2=86=92=205.1.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- configs/coins/ethereum_archive_consensus.json | 10 +++++----- configs/coins/ethereum_consensus.json | 10 +++++----- .../ethereum_testnet_holesky_archive_consensus.json | 10 +++++----- configs/coins/ethereum_testnet_holesky_consensus.json | 10 +++++----- .../ethereum_testnet_sepolia_archive_consensus.json | 10 +++++----- configs/coins/ethereum_testnet_sepolia_consensus.json | 10 +++++----- 6 files changed, 30 insertions(+), 30 deletions(-) diff --git a/configs/coins/ethereum_archive_consensus.json b/configs/coins/ethereum_archive_consensus.json index 744350ca..4caa570a 100644 --- a/configs/coins/ethereum_archive_consensus.json +++ b/configs/coins/ethereum_archive_consensus.json @@ -19,10 +19,10 @@ "package_name": "backend-ethereum-archive-consensus", "package_revision": "satoshilabs-1", "system_user": "ethereum", - "version": "5.1.0", - "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.1.0/beacon-chain-v5.1.0-linux-amd64", + "version": "5.1.2", + "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.1.2/beacon-chain-v5.1.2-linux-amd64", "verification_type": "sha256", - "verification_source": "bc59aabe40d32959692dba260003fc5004775ac0f7fa2513a66fc28dc2f4717f", + "verification_source": "4b0d20406aebec8e19016cddf987bf92578296dac0e41c40d99223c8166b96b9", "extract_command": "mv ${ARCHIVE} backend/beacon-chain && chmod +x backend/beacon-chain && echo", "exclude_files": [], "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/beacon-chain --mainnet --accept-terms-of-use --execution-endpoint=http://localhost:{{.Ports.BackendAuthRpc}} --grpc-gateway-port=7516 --rpc-port=7517 --monitoring-port=7518 --p2p-tcp-port=3516 --p2p-udp-port=2516 --datadir={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend --jwt-secret={{.Env.BackendDataPath}}/ethereum_archive/backend/erigon/jwt.hex 2>>{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", @@ -36,8 +36,8 @@ "client_config_file": "", "platforms": { "arm64": { - "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.1.0/beacon-chain-v5.1.0-linux-arm64", - "verification_source": "74eb6c423316074641367d5655bb84bc7ae117ff6e58d95ef9d48d065eef00ef" + "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.1.2/beacon-chain-v5.1.2-linux-arm64", + "verification_source": "850d834fca3b00b3f4c508ecb96fd867aff476335ebdcd190981446a93d03e3d" } } }, diff --git a/configs/coins/ethereum_consensus.json b/configs/coins/ethereum_consensus.json index 8a80eca9..9ec1e5a2 100644 --- a/configs/coins/ethereum_consensus.json +++ b/configs/coins/ethereum_consensus.json @@ -19,10 +19,10 @@ "package_name": "backend-ethereum-consensus", "package_revision": "satoshilabs-1", "system_user": "ethereum", - "version": "5.1.0", - "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.1.0/beacon-chain-v5.1.0-linux-amd64", + "version": "5.1.2", + "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.1.2/beacon-chain-v5.1.2-linux-amd64", "verification_type": "sha256", - "verification_source": "bc59aabe40d32959692dba260003fc5004775ac0f7fa2513a66fc28dc2f4717f", + "verification_source": "4b0d20406aebec8e19016cddf987bf92578296dac0e41c40d99223c8166b96b9", "extract_command": "mv ${ARCHIVE} backend/beacon-chain && chmod +x backend/beacon-chain && echo", "exclude_files": [], "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/beacon-chain --mainnet --accept-terms-of-use --execution-endpoint=http://localhost:{{.Ports.BackendAuthRpc}} --grpc-gateway-port=7536 --rpc-port=7537 --monitoring-port=7538 --p2p-tcp-port=3536 --p2p-udp-port=2536 --datadir={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend --jwt-secret={{.Env.BackendDataPath}}/ethereum/backend/erigon/jwt.hex 2>>{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", @@ -36,8 +36,8 @@ "client_config_file": "", "platforms": { "arm64": { - "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.1.0/beacon-chain-v5.1.0-linux-arm64", - "verification_source": "74eb6c423316074641367d5655bb84bc7ae117ff6e58d95ef9d48d065eef00ef" + "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.1.2/beacon-chain-v5.1.2-linux-arm64", + "verification_source": "850d834fca3b00b3f4c508ecb96fd867aff476335ebdcd190981446a93d03e3d" } } }, diff --git a/configs/coins/ethereum_testnet_holesky_archive_consensus.json b/configs/coins/ethereum_testnet_holesky_archive_consensus.json index d9d6e325..88859fd7 100644 --- a/configs/coins/ethereum_testnet_holesky_archive_consensus.json +++ b/configs/coins/ethereum_testnet_holesky_archive_consensus.json @@ -23,10 +23,10 @@ "package_name": "backend-ethereum-testnet-holesky-archive-consensus", "package_revision": "satoshilabs-1", "system_user": "ethereum", - "version": "5.1.0", - "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.1.0/beacon-chain-v5.1.0-linux-amd64", + "version": "5.1.2", + "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.1.2/beacon-chain-v5.1.2-linux-amd64", "verification_type": "sha256", - "verification_source": "bc59aabe40d32959692dba260003fc5004775ac0f7fa2513a66fc28dc2f4717f", + "verification_source": "4b0d20406aebec8e19016cddf987bf92578296dac0e41c40d99223c8166b96b9", "extract_command": "mv ${ARCHIVE} backend/beacon-chain && chmod +x backend/beacon-chain && echo", "exclude_files": [], "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/beacon-chain --holesky --accept-terms-of-use --execution-endpoint=http://localhost:{{.Ports.BackendAuthRpc}} --grpc-gateway-port=17536 --rpc-port=17537 --monitoring-port=17538 --p2p-tcp-port=13636 --p2p-udp-port=12636 --datadir={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend --jwt-secret={{.Env.BackendDataPath}}/ethereum_testnet_holesky_archive/backend/erigon/jwt.hex --genesis-state={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/genesis.ssz 2>>{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", @@ -40,8 +40,8 @@ "client_config_file": "", "platforms": { "arm64": { - "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.1.0/beacon-chain-v5.1.0-linux-arm64", - "verification_source": "74eb6c423316074641367d5655bb84bc7ae117ff6e58d95ef9d48d065eef00ef" + "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.1.2/beacon-chain-v5.1.2-linux-arm64", + "verification_source": "850d834fca3b00b3f4c508ecb96fd867aff476335ebdcd190981446a93d03e3d" } } }, diff --git a/configs/coins/ethereum_testnet_holesky_consensus.json b/configs/coins/ethereum_testnet_holesky_consensus.json index 94314490..19774f19 100644 --- a/configs/coins/ethereum_testnet_holesky_consensus.json +++ b/configs/coins/ethereum_testnet_holesky_consensus.json @@ -23,10 +23,10 @@ "package_name": "backend-ethereum-testnet-holesky-consensus", "package_revision": "satoshilabs-1", "system_user": "ethereum", - "version": "5.1.0", - "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.1.0/beacon-chain-v5.1.0-linux-amd64", + "version": "5.1.2", + "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.1.2/beacon-chain-v5.1.2-linux-amd64", "verification_type": "sha256", - "verification_source": "bc59aabe40d32959692dba260003fc5004775ac0f7fa2513a66fc28dc2f4717f", + "verification_source": "4b0d20406aebec8e19016cddf987bf92578296dac0e41c40d99223c8166b96b9", "extract_command": "mv ${ARCHIVE} backend/beacon-chain && chmod +x backend/beacon-chain && echo", "exclude_files": [], "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/beacon-chain --holesky --accept-terms-of-use --execution-endpoint=http://localhost:{{.Ports.BackendAuthRpc}} --grpc-gateway-port=17516 --rpc-port=17517 --monitoring-port=17518 --p2p-tcp-port=13516 --p2p-udp-port=12516 --datadir={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend --jwt-secret={{.Env.BackendDataPath}}/ethereum_testnet_holesky/backend/erigon/jwt.hex --genesis-state={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/genesis.ssz 2>>{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", @@ -40,8 +40,8 @@ "client_config_file": "", "platforms": { "arm64": { - "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.1.0/beacon-chain-v5.1.0-linux-arm64", - "verification_source": "74eb6c423316074641367d5655bb84bc7ae117ff6e58d95ef9d48d065eef00ef" + "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.1.2/beacon-chain-v5.1.2-linux-arm64", + "verification_source": "850d834fca3b00b3f4c508ecb96fd867aff476335ebdcd190981446a93d03e3d" } } }, diff --git a/configs/coins/ethereum_testnet_sepolia_archive_consensus.json b/configs/coins/ethereum_testnet_sepolia_archive_consensus.json index 1faa700c..0bdbe87b 100644 --- a/configs/coins/ethereum_testnet_sepolia_archive_consensus.json +++ b/configs/coins/ethereum_testnet_sepolia_archive_consensus.json @@ -23,10 +23,10 @@ "package_name": "backend-ethereum-testnet-sepolia-archive-consensus", "package_revision": "satoshilabs-1", "system_user": "ethereum", - "version": "5.1.0", - "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.1.0/beacon-chain-v5.1.0-linux-amd64", + "version": "5.1.2", + "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.1.2/beacon-chain-v5.1.2-linux-amd64", "verification_type": "sha256", - "verification_source": "bc59aabe40d32959692dba260003fc5004775ac0f7fa2513a66fc28dc2f4717f", + "verification_source": "4b0d20406aebec8e19016cddf987bf92578296dac0e41c40d99223c8166b96b9", "extract_command": "mv ${ARCHIVE} backend/beacon-chain && chmod +x backend/beacon-chain && echo", "exclude_files": [], "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/beacon-chain --sepolia --accept-terms-of-use --execution-endpoint=http://localhost:{{.Ports.BackendAuthRpc}} --grpc-gateway-port=17586 --rpc-port=17587 --monitoring-port=17548 --p2p-tcp-port=13676 --p2p-udp-port=12676 --datadir={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend --jwt-secret={{.Env.BackendDataPath}}/ethereum_testnet_sepolia_archive/backend/erigon/jwt.hex --genesis-state={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/genesis.ssz 2>>{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", @@ -40,8 +40,8 @@ "client_config_file": "", "platforms": { "arm64": { - "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.1.0/beacon-chain-v5.1.0-linux-arm64", - "verification_source": "74eb6c423316074641367d5655bb84bc7ae117ff6e58d95ef9d48d065eef00ef" + "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.1.2/beacon-chain-v5.1.2-linux-arm64", + "verification_source": "850d834fca3b00b3f4c508ecb96fd867aff476335ebdcd190981446a93d03e3d" } } }, diff --git a/configs/coins/ethereum_testnet_sepolia_consensus.json b/configs/coins/ethereum_testnet_sepolia_consensus.json index 106b7a30..9ca379ef 100644 --- a/configs/coins/ethereum_testnet_sepolia_consensus.json +++ b/configs/coins/ethereum_testnet_sepolia_consensus.json @@ -23,10 +23,10 @@ "package_name": "backend-ethereum-testnet-sepolia-consensus", "package_revision": "satoshilabs-1", "system_user": "ethereum", - "version": "5.1.0", - "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.1.0/beacon-chain-v5.1.0-linux-amd64", + "version": "5.1.2", + "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.1.2/beacon-chain-v5.1.2-linux-amd64", "verification_type": "sha256", - "verification_source": "bc59aabe40d32959692dba260003fc5004775ac0f7fa2513a66fc28dc2f4717f", + "verification_source": "4b0d20406aebec8e19016cddf987bf92578296dac0e41c40d99223c8166b96b9", "extract_command": "mv ${ARCHIVE} backend/beacon-chain && chmod +x backend/beacon-chain && echo", "exclude_files": [], "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/beacon-chain --sepolia --accept-terms-of-use --execution-endpoint=http://localhost:{{.Ports.BackendAuthRpc}} --grpc-gateway-port=17576 --rpc-port=17577 --monitoring-port=17578 --p2p-tcp-port=13576 --p2p-udp-port=12576 --datadir={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend --jwt-secret={{.Env.BackendDataPath}}/ethereum_testnet_sepolia/backend/erigon/jwt.hex --genesis-state={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/genesis.ssz 2>>{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", @@ -40,8 +40,8 @@ "client_config_file": "", "platforms": { "arm64": { - "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.1.0/beacon-chain-v5.1.0-linux-arm64", - "verification_source": "74eb6c423316074641367d5655bb84bc7ae117ff6e58d95ef9d48d065eef00ef" + "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.1.2/beacon-chain-v5.1.2-linux-arm64", + "verification_source": "850d834fca3b00b3f4c508ecb96fd867aff476335ebdcd190981446a93d03e3d" } } }, From f373a73beaf31bd7bb33343946ac94bf2ddad8b8 Mon Sep 17 00:00:00 2001 From: wakiyamap Date: Sat, 7 Sep 2024 02:41:46 +0900 Subject: [PATCH 30/56] add tests for bitcoin testnet4 --- bchain/coins/btc/bitcoinparser.go | 19 ++ bchain/coins/btc/bitcoinparser_test.go | 55 ++++- tests/rpc/testdata/bitcoin_testnet4.json | 105 +++++++++ tests/sync/testdata/bitcoin_testnet4.json | 266 ++++++++++++++++++++++ tests/tests.json | 5 + 5 files changed, 449 insertions(+), 1 deletion(-) create mode 100644 tests/rpc/testdata/bitcoin_testnet4.json create mode 100644 tests/sync/testdata/bitcoin_testnet4.json diff --git a/bchain/coins/btc/bitcoinparser.go b/bchain/coins/btc/bitcoinparser.go index 77cbcf26..a022c18e 100644 --- a/bchain/coins/btc/bitcoinparser.go +++ b/bchain/coins/btc/bitcoinparser.go @@ -4,11 +4,28 @@ import ( "encoding/json" "math/big" + "github.com/martinboehm/btcd/wire" "github.com/martinboehm/btcutil/chaincfg" "github.com/trezor/blockbook/bchain" "github.com/trezor/blockbook/common" ) +// temp params for signet(wait btcd commit) +// magic numbers +const ( + Testnet4Magic wire.BitcoinNet = 0x283f161c +) + +// chain parameters +var ( + TestNet4Params chaincfg.Params +) + +func init() { + TestNet4Params = chaincfg.TestNet3Params + TestNet4Params.Net = Testnet4Magic +} + // BitcoinParser handle type BitcoinParser struct { *BitcoinLikeParser @@ -33,6 +50,8 @@ func GetChainParams(chain string) *chaincfg.Params { switch chain { case "test": return &chaincfg.TestNet3Params + case "testnet4": + return &TestNet4Params case "regtest": return &chaincfg.RegressionNetParams case "signet": diff --git a/bchain/coins/btc/bitcoinparser_test.go b/bchain/coins/btc/bitcoinparser_test.go index 1ca0d4ec..a697cbfd 100644 --- a/bchain/coins/btc/bitcoinparser_test.go +++ b/bchain/coins/btc/bitcoinparser_test.go @@ -467,11 +467,12 @@ func TestGetAddressesFromAddrDescTestnet(t *testing.T) { } var ( - testTx1, testTx2, testTx3 bchain.Tx + testTx1, testTx2, testTx3, testTx4 bchain.Tx testTxPacked1 = "0001e2408ba8d7af5401000000017f9a22c9cbf54bd902400df746f138f37bcf5b4d93eb755820e974ba43ed5f42040000006a4730440220037f4ed5427cde81d55b9b6a2fd08c8a25090c2c2fff3a75c1a57625ca8a7118022076c702fe55969fa08137f71afd4851c48e31082dd3c40c919c92cdbc826758d30121029f6da5623c9f9b68a9baf9c1bc7511df88fa34c6c2f71f7c62f2f03ff48dca80feffffff019c9700000000000017a9146144d57c8aff48492c9dfb914e120b20bad72d6f8773d00700" testTxPacked2 = "0007c91a899ab7da6a010000000001019d64f0c72a0d206001decbffaa722eb1044534c74eee7a5df8318e42a4323ec10000000017160014550da1f5d25a9dae2eafd6902b4194c4c6500af6ffffffff02809698000000000017a914cd668d781ece600efa4b2404dc91fd26b8b8aed8870553d7360000000017a914246655bdbd54c7e477d0ea2375e86e0db2b8f80a8702473044022076aba4ad559616905fa51d4ddd357fc1fdb428d40cb388e042cdd1da4a1b7357022011916f90c712ead9a66d5f058252efd280439ad8956a967e95d437d246710bc9012102a80a5964c5612bb769ef73147b2cf3c149bc0fd4ecb02f8097629c94ab013ffd00000000" testTxPacked3 = "00003d818bfda9aa3e02000000000102deb1999a857ab0a13d6b12fbd95ea75b409edde5f2ff747507ce42d9986a8b9d0000000000fdffffff9fd2d3361e203b2375eba6438efbef5b3075531e7e583c7cc76b7294fe7f22980000000000fdffffff02a0860100000000001600148091746745464e7555c31e9a5afceac14a02978ae7fc1c0000000000160014565ea9ff4589d3e05ba149ae6e257752bfdc2a1e0247304402207d67d320a8e813f986b35e9791935fcb736754812b7038686f5de6cfdcda99cd02201c3bb2c178e0056016437ecfe365a7eef84aa9d293ebdc566177af82e22fcdd3012103abb30c1bbe878b07b58dc169b1d061d48c60be8107f632a59778b38bf7ceea5a02473044022044f54a478cfe086e870cb026c9dcd4e14e63778bef569a4d55a6332725cd9a9802202f0e94c04e6f328fc64ad9efe552888c299750d1b8d033324825a3ff29920e030121036fcd433428aa7dc65c4f5408fa31f208c54fe4b4c6c1ae9c39a825ed4f1ac039813d0000" + testTxPacked4 = "0000a2b98ced82b6400300000000010148f8f93ebb12407809920d2ab9cc1bf01289b314eb23028c83fdab21e5fefa690100000000fdffffff0150c3000000000000160014cb888de3c89670a3061fb6ef6590f187649cca060247304402206a9db8d7157e4b0a06a1f090b9de88cdc616028b431b80617a055117877e479a02202937d6d1658d4a8afde86b245325c3bb0e769a87cb09d802bcefaa21550065e201210374aa8f312de4ebccbef55609700a39764387aa4ff5d76f1ccb4d2382e454f05b00000000" ) func init() { @@ -595,6 +596,37 @@ func init() { }, }, } + + testTx4 = bchain.Tx{ + Hex: "0300000000010148f8f93ebb12407809920d2ab9cc1bf01289b314eb23028c83fdab21e5fefa690100000000fdffffff0150c3000000000000160014cb888de3c89670a3061fb6ef6590f187649cca060247304402206a9db8d7157e4b0a06a1f090b9de88cdc616028b431b80617a055117877e479a02202937d6d1658d4a8afde86b245325c3bb0e769a87cb09d802bcefaa21550065e201210374aa8f312de4ebccbef55609700a39764387aa4ff5d76f1ccb4d2382e454f05b00000000", + Blocktime: 1724927392, + Txid: "8e3f38bf6854dd3c358be8d4f9a40a6dccc50de49616125d27af9fdbe65287eb", + LockTime: 0, + VSize: 110, + Version: 3, + Vin: []bchain.Vin{ + { + ScriptSig: bchain.ScriptSig{ + Hex: "", + }, + Txid: "69fafee521abfd838c0223eb14b38912f01bccb92a0d9209784012bb3ef9f848", + Vout: 1, + Sequence: 4294967293, + }, + }, + Vout: []bchain.Vout{ + { + ValueSat: *big.NewInt(50000), + N: 0, + ScriptPubKey: bchain.ScriptPubKey{ + Hex: "0014cb888de3c89670a3061fb6ef6590f187649cca06", + Addresses: []string{ + "tb1qewygmc7gjec2xpslkmhkty83sajfejsxqmy5dq", + }, + }, + }, + }, + } } func TestPackTx(t *testing.T) { @@ -643,6 +675,17 @@ func TestPackTx(t *testing.T) { want: testTxPacked3, wantErr: false, }, + { + name: "testnet4-1", + args: args{ + tx: testTx4, + height: 41657, + blockTime: 1724927392, + parser: NewBitcoinParser(GetChainParams("testnet4"), &Configuration{}), + }, + want: testTxPacked4, + wantErr: false, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -701,6 +744,16 @@ func TestUnpackTx(t *testing.T) { want1: 15745, wantErr: false, }, + { + name: "testnet4-1", + args: args{ + packedTx: testTxPacked4, + parser: NewBitcoinParser(GetChainParams("testnet4"), &Configuration{}), + }, + want: &testTx4, + want1: 41657, + wantErr: false, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { diff --git a/tests/rpc/testdata/bitcoin_testnet4.json b/tests/rpc/testdata/bitcoin_testnet4.json new file mode 100644 index 00000000..e61c5d87 --- /dev/null +++ b/tests/rpc/testdata/bitcoin_testnet4.json @@ -0,0 +1,105 @@ +{ + "blockHeight": 41500, + "blockHash": "000000000000000466119d6e5eb24802dcc14605f4050ac586f45eaa61da2719", + "blockTime": 1724848265, + "blockTxs": [ + "3d40148138492c4c0b91207acc2ec1cb3942e1cb51713e6851f01450452314d1", + "38924e01871d5fb25dca1bc9d17ae8cb65155fcb12a70984fc65ec85d48efd2a", + "8b77d1e7b5d7c528a59917c13f42787fa1988db744c1e9bc58f024f15fbb2ebb", + "06a9373ca11293ec51d15c5c142118fd46ceec33c0a46a865448f9916337b2ef" + ], + "txDetails": { + "38924e01871d5fb25dca1bc9d17ae8cb65155fcb12a70984fc65ec85d48efd2a": { + "hex": "0200000002a6a8a1e0e89cc206f40efc707863510b866cd0f20487446f6373c5b136ea9ab3010000006a4730440220053c7b24201514691f67154cbfd1e2ba917b3813b44b6ed81afd75bd11f16c4f022075c24b3fc21e88071148c6daa1ca4075e55da1f3f403ceb943268016744b10d1012102d1b7b25ab15f33fc693ba6c9b80b4c35fca1708008c8afac171b33f1fef4bd59fdffffffcd227a67d359ad8aaf99d9a56fdb0604a18804d40e046d21607f95a0c263e6d1000000006a473044022029297263b9b49c5652bf2179f5c94968788dc8d63d42a268980b8b9d0bda480602206c5cae1eb7b23872e02e2967eb229d8ed9cc73331dbadbd0354b82f80937a23e012103e959e8ad180e0323105e95ceea131debdbe0d77bfd54289bad77d15164942acdfdffffff03c3b0090000000000160014de4e79ce2048a42698e04e079e94c97fd6e012cf9f770e000000000017a914d9e303986df109b001b97b45f3a00d84b6c9d7278788760200000000001600144a6a08ffbb16515133284e385b0ea29812ce99251ba20000", + "txid": "38924e01871d5fb25dca1bc9d17ae8cb65155fcb12a70984fc65ec85d48efd2a", + "blocktime": 1724848265, + "time": 1724848265, + "locktime": 41499, + "vsize": 398, + "version": 2, + "vin": [ + { + "txid": "b39aea36b1c573636f448704f2d06c860b51637870fc0ef406c29ce8e0a1a8a6", + "vout": 1, + "sequence": 4294967293, + "scriptSig": { + "hex": "4730440220053c7b24201514691f67154cbfd1e2ba917b3813b44b6ed81afd75bd11f16c4f022075c24b3fc21e88071148c6daa1ca4075e55da1f3f403ceb943268016744b10d1012102d1b7b25ab15f33fc693ba6c9b80b4c35fca1708008c8afac171b33f1fef4bd59" + } + }, + { + "txid": "d1e663c2a0957f60216d040ed40488a10406db6fa5d999af8aad59d3677a22cd", + "vout": 0, + "sequence": 4294967293, + "scriptSig": { + "hex": "473044022029297263b9b49c5652bf2179f5c94968788dc8d63d42a268980b8b9d0bda480602206c5cae1eb7b23872e02e2967eb229d8ed9cc73331dbadbd0354b82f80937a23e012103e959e8ad180e0323105e95ceea131debdbe0d77bfd54289bad77d15164942acd" + } + } + ], + "vout": [ + { + "value": 0.00635075, + "n": 0, + "scriptPubKey": { + "hex": "0014de4e79ce2048a42698e04e079e94c97fd6e012cf" + } + }, + { + "value": 0.00948127, + "n": 1, + "scriptPubKey": { + "hex": "a914c9e67d2b78a38857c786ea9a2fc3e64cb6e7756487" + } + }, + { + "value": 0.00161416, + "n": 2, + "scriptPubKey": { + "hex": "00144a6a08ffbb16515133284e385b0ea29812ce9925" + } + } + ] + }, + "8b77d1e7b5d7c528a59917c13f42787fa1988db744c1e9bc58f024f15fbb2ebb": { + "hex": "0200000001cd227a67d359ad8aaf99d9a56fdb0604a18804d40e046d21607f95a0c263e6d1020000006a473044022027687d38378d1e6c991f68815217e309f1e290a8c706159455a680457ec1545002202dd0d9fc7251a5a4f7d4b76d824981b97a4c5121ec46fee4786a283debde544501210223a0cd87e2f1958998684f6c75771a95727d310cc4d30ed34ca427affe89d4c2fdffffff038876020000000000160014f6a58ba8a373263dddcb82bd6202a1157270cb4de8b00400000000001600144237fc8335d817b911332fc9df26744215266b1794d204000000000017a914e5bd951e8d6b10fab8cea5b103c71ae3a37b95bf871ba20000", + "txid": "8b77d1e7b5d7c528a59917c13f42787fa1988db744c1e9bc58f024f15fbb2ebb", + "blocktime": 1724848265, + "time": 1724848265, + "locktime": 41499, + "vsize": 251, + "version": 2, + "vin": [ + { + "txid": "d1e663c2a0957f60216d040ed40488a10406db6fa5d999af8aad59d3677a22cd", + "vout": 2, + "sequence": 4294967293, + "scriptSig": { + "hex": "473044022027687d38378d1e6c991f68815217e309f1e290a8c706159455a680457ec1545002202dd0d9fc7251a5a4f7d4b76d824981b97a4c5121ec46fee4786a283debde544501210223a0cd87e2f1958998684f6c75771a95727d310cc4d30ed34ca427affe89d4c2" + } + } + ], + "vout": [ + { + "value": 0.00161416, + "n": 0, + "scriptPubKey": { + "hex": "0014f6a58ba8a373263dddcb82bd6202a1157270cb4d" + } + }, + { + "value": 0.00307432, + "n": 1, + "scriptPubKey": { + "hex": "00144237fc8335d817b911332fc9df26744215266b17" + } + }, + { + "value": 0.00316052, + "n": 2, + "scriptPubKey": { + "hex": "a914e5bd951e8d6b10fab8cea5b103c71ae3a37b95bf87" + } + } + ] + } + } +} diff --git a/tests/sync/testdata/bitcoin_testnet4.json b/tests/sync/testdata/bitcoin_testnet4.json new file mode 100644 index 00000000..5bd3c8e2 --- /dev/null +++ b/tests/sync/testdata/bitcoin_testnet4.json @@ -0,0 +1,266 @@ +{ + "connectBlocks": { + "syncRanges": [ + {"lower": 41500, "upper": 41514} + ], + "blocks": { + "41500": { + "height": 41500, + "hash": "000000000000000466119d6e5eb24802dcc14605f4050ac586f45eaa61da2719", + "noTxs": 4, + "txDetails": [ + { + "hex": "0200000001cd227a67d359ad8aaf99d9a56fdb0604a18804d40e046d21607f95a0c263e6d1020000006a473044022027687d38378d1e6c991f68815217e309f1e290a8c706159455a680457ec1545002202dd0d9fc7251a5a4f7d4b76d824981b97a4c5121ec46fee4786a283debde544501210223a0cd87e2f1958998684f6c75771a95727d310cc4d30ed34ca427affe89d4c2fdffffff038876020000000000160014f6a58ba8a373263dddcb82bd6202a1157270cb4de8b00400000000001600144237fc8335d817b911332fc9df26744215266b1794d204000000000017a914e5bd951e8d6b10fab8cea5b103c71ae3a37b95bf871ba20000", + "txid": "8b77d1e7b5d7c528a59917c13f42787fa1988db744c1e9bc58f024f15fbb2ebb", + "time": 1724848265, + "blocktime": 1724848265, + "version": 2, + "vin": [ + { + "txid": "d1e663c2a0957f60216d040ed40488a10406db6fa5d999af8aad59d3677a22cd", + "vout": 2, + "scriptSig": { + "hex": "473044022027687d38378d1e6c991f68815217e309f1e290a8c706159455a680457ec1545002202dd0d9fc7251a5a4f7d4b76d824981b97a4c5121ec46fee4786a283debde544501210223a0cd87e2f1958998684f6c75771a95727d310cc4d30ed34ca427affe89d4c2" + }, + "sequence": 4294967293 + } + ], + "vout": [ + { + "value": 0.00161416, + "n": 0, + "scriptPubKey": { + "hex": "0014f6a58ba8a373263dddcb82bd6202a1157270cb4d" + } + }, + { + "value": 0.00307432, + "n": 1, + "scriptPubKey": { + "hex": "00144237fc8335d817b911332fc9df26744215266b17" + } + } + ] + }, + { + "hex": "02000000030a33417aa2c909c65225b024e4988b46810202a7a57da1505a4ac79405ac4da4020000006a47304402204da60448cf946bc3ac839df244eef7eb5b04f6707be70382647c1fe4443936e102201fa6b33200b4835c6b67f2c31e63a76d2a6b962cc576f1b1b5cf09b4ba8f452c0121030a15ad4bbb816e75e733c12666af2a04bb55b7108f9c075e12104ac2a82fa326fdffffffcd227a67d359ad8aaf99d9a56fdb0604a18804d40e046d21607f95a0c263e6d1010000006a47304402207875d1ec865e2fdff50e6923b97a19f86597077685cc6d9c3b6af255dbd5e8bc022026177e9010f43b62bf1aab96b7a02ea639ad63b3cb2231603d9b0573d6a0049d012102373d8f65f846d07e07f74057b77bd81b4531cf95fc45040802a4f160271b47ddfdffffff7e848dbf9c2911fb316c47d5da66009836cd21a7d282dc3d9f2f993bec88c5d7000000006a47304402202a5dbdef43698a1027514585e1198e5d6ffcfbc60792ee48d979bfb40cfe6840022004d5819608fda4d16c5920f7f7ed5b4eb6eb90aa1fb3f21153055b83e89dd57d012102d6dd02728abb6829736d1cb14758361a15fd848db4283df310dc2084151c3908fdffffff039f770e00000000001600146a18cc237247b14c7b8bcb23c504a60b6c073bdf9db90d0000000000160014dda8363d492ccc33ef8c2ad02de0632bde0111aadd9202000000000017a914fa793409354d909ceaf168b7b7f91a92e0b4ba85871ba20000", + "txid": "06a9373ca11293ec51d15c5c142118fd46ceec33c0a46a865448f9916337b2ef", + "time": 1724848265, + "blocktime": 1724848265, + "version": 2, + "vin": [ + { + "txid": "a44dac0594c74a5a50a17da5a7020281468b98e424b02552c609c9a27a41330a", + "vout": 2, + "scriptSig": { + "hex": "47304402204da60448cf946bc3ac839df244eef7eb5b04f6707be70382647c1fe4443936e102201fa6b33200b4835c6b67f2c31e63a76d2a6b962cc576f1b1b5cf09b4ba8f452c0121030a15ad4bbb816e75e733c12666af2a04bb55b7108f9c075e12104ac2a82fa326" + }, + "sequence": 4294967293 + }, + { + "txid": "d1e663c2a0957f60216d040ed40488a10406db6fa5d999af8aad59d3677a22cd", + "vout": 1, + "scriptSig": { + "hex": "47304402207875d1ec865e2fdff50e6923b97a19f86597077685cc6d9c3b6af255dbd5e8bc022026177e9010f43b62bf1aab96b7a02ea639ad63b3cb2231603d9b0573d6a0049d012102373d8f65f846d07e07f74057b77bd81b4531cf95fc45040802a4f160271b47dd" + }, + "sequence": 4294967293 + }, + { + "txid": "d7c588ec3b992f9f3ddc82d2a721cd36980066dad5476c31fb11299cbf8d847e", + "vout": 0, + "scriptSig": { + "hex": "47304402202a5dbdef43698a1027514585e1198e5d6ffcfbc60792ee48d979bfb40cfe6840022004d5819608fda4d16c5920f7f7ed5b4eb6eb90aa1fb3f21153055b83e89dd57d012102d6dd02728abb6829736d1cb14758361a15fd848db4283df310dc2084151c3908" + }, + "sequence": 4294967293 + } + ], + "vout": [ + { + "value": 0.00948127, + "n": 0, + "scriptPubKey": { + "hex": "00146a18cc237247b14c7b8bcb23c504a60b6c073bdf" + } + }, + { + "value": 0.00899485, + "n": 1, + "scriptPubKey": { + "hex": "0014dda8363d492ccc33ef8c2ad02de0632bde0111aa" + } + }, + { + "value": 0.00168669, + "n": 1, + "scriptPubKey": { + "hex": "a914fa793409354d909ceaf168b7b7f91a92e0b4ba8587" + } + } + ] + } + ] + }, + "41514": { + "height": 41514, + "hash": "0000000000000002b7bdc99aec6aa3637ed2bfda355a1124b55c6e73362d20e3", + "noTxs": 4, + "txDetails": [ + { + "txid": "dc733fabf5035aaae5e006ed18007a0017945800a934df4ec3ce39a91575b8e8", + "version": 2, + "vin": [ + { + "txid": "989a37280f12b604db89ada924157118988e786bd962e57b77c08382da404cb8", + "vout": 1, + "scriptSig": { + "hex": "473044022061df7eaac833f84457a3636f017c25a3718570071fad06488a1f2558f270e1d3022028cf6a7964d91b16af7a5b3d45d334865857b3ffeb963b03aec57c1605f9e88201210347db551a1dddc6b9e33514b617e5f0d1a877d289438a3c2b660eade0b2167bb7" + }, + "sequence": 4294967293 + }, + { + "txid": "87311755ace5410b892a84319a721058a004a160484c672d74efe49b84fba877", + "vout": 2, + "scriptSig": { + "hex": "473044022061e33861ff14d7578b8bf5e0acbe411c23c245cb66867fec4a00d4da1d79886b02205363bca58a7419b63afcb5242e129ca049b39260706bcdc5d812217bb8549734012102fb95500bc0cfc2989caf311093d81bf4fbeac8fd6d7595e634a665062da27ece" + }, + "sequence": 4294967293 + }, + { + "txid": "841b8c2713db90d8b6f299c5f5ace825f7a2a1b85314c3c556b6a60888257e84", + "vout": 0, + "scriptSig": { + "hex": "47304402202a975b7766809be1cb6b3639a7ae19939c7ca65d9e52fef9c0fac974c50ab6c402204e3bd3df8e229a76a4e18ddb5bbcc57f3edb17e275e5a720eff87264fca6e6540121039d7a392480bcddc3b5ae486e8f42928aea3db0b29960a6eba2a74535d3666e5f" + }, + "sequence": 4294967293 + } + ], + "vout": [ + { + "value": 0.00590901, + "n": 0, + "scriptPubKey": { + "hex": "76a914a385f9839ca1052e69add674e34a86b5e2fee49488ac" + } + }, + { + "value": 0.00169446, + "n": 1, + "scriptPubKey": { + "hex": "0014064c311089eee424ba61ad731dd2b2a24b634920" + } + }, + { + "value": 0.00955888, + "n": 2, + "scriptPubKey": { + "hex": "0014b0bc24934c98b2eb46dcf3dea49adb6d689bf640" + } + } + ], + "hex": "0200000003b84c40da8283c0777be562d96b788e9818711524a9ad89db04b6120f28379a98010000006a473044022061df7eaac833f84457a3636f017c25a3718570071fad06488a1f2558f270e1d3022028cf6a7964d91b16af7a5b3d45d334865857b3ffeb963b03aec57c1605f9e88201210347db551a1dddc6b9e33514b617e5f0d1a877d289438a3c2b660eade0b2167bb7fdffffff77a8fb849be4ef742d674c4860a104a05810729a31842a890b41e5ac55173187020000006a473044022061e33861ff14d7578b8bf5e0acbe411c23c245cb66867fec4a00d4da1d79886b02205363bca58a7419b63afcb5242e129ca049b39260706bcdc5d812217bb8549734012102fb95500bc0cfc2989caf311093d81bf4fbeac8fd6d7595e634a665062da27ecefdffffff847e258808a6b656c5c31453b8a1a2f725e8acf5c599f2b6d890db13278c1b84000000006a47304402202a975b7766809be1cb6b3639a7ae19939c7ca65d9e52fef9c0fac974c50ab6c402204e3bd3df8e229a76a4e18ddb5bbcc57f3edb17e275e5a720eff87264fca6e6540121039d7a392480bcddc3b5ae486e8f42928aea3db0b29960a6eba2a74535d3666e5ffdffffff0335040900000000001976a914a385f9839ca1052e69add674e34a86b5e2fee49488ace695020000000000160014064c311089eee424ba61ad731dd2b2a24b634920f0950e0000000000160014b0bc24934c98b2eb46dcf3dea49adb6d689bf64029a20000", + "time": 1724854426, + "blocktime": 1724854426 + }, + { + "txid": "83e4e72359aad484639376259de9ea0dab88aa7b9b2d0a8ab654fe151cb10cbb", + "version": 2, + "vin": [ + { + "txid": "a6384c1718c87b699b11e0aa7e7ff5806c6053146f530de59989695b4a770957", + "vout": 1, + "scriptSig": { + "hex": "" + }, + "sequence": 4294967293 + }, + { + "txid": "64d1c85d3a0f4dc94d280a63d08ff4cae640f504b7e65d4d07afd8aa6e56127f", + "vout": 1, + "scriptSig": { + "hex": "" + }, + "sequence": 4294967293 + }, + { + "txid": "9ad596bbe3bff49476127cdada75ba54e269cabb8fa8bf83c4ea78037998ba32", + "vout": 2, + "scriptSig": { + "hex": "" + }, + "sequence": 4294967293 + }, + { + "txid": "6cbe7386a8085f440a25c8b5eafaf251e29b5d9894d0b78f1a058155e3cbb64a", + "vout": 1, + "scriptSig": { + "hex": "" + }, + "sequence": 4294967293 + }, + { + "txid": "44a3af6673cfc9bd746ba5f8183b5ffb48259cf2473fd300daf803125ba19576", + "vout": 0, + "scriptSig": { + "hex": "" + }, + "sequence": 4294967293 + } + ], + "vout": [ + { + "value": 0.00590901, + "n": 0, + "scriptPubKey": { + "hex": "a914a42e6b2b8198b25bdeb2bb45677ab2180d4847ae87" + } + }, + { + "value": 0.00774515, + "n": 1, + "scriptPubKey": { + "hex": "0014601770808f0168c4dc0d927759407047f079a0f9" + } + } + ], + "hex": "020000000001055709774a5b698999e50d536f1453606c80f57f7eaae0119b697bc818174c38a60100000000fdffffff7f12566eaad8af074d5de6b704f540e6caf48fd0630a284dc94d0f3a5dc8d1640100000000fdffffff32ba98790378eac483bfa88fbbca69e254ba75dada7c127694f4bfe3bb96d59a0200000000fdffffff4ab6cbe35581051a8fb7d094985d9be251f2faeab5c8250a445f08a88673be6c0100000000fdffffff7695a15b1203f8da00d33f47f29c2548fb5f3b18f8a56b74bdc9cf7366afa3440000000000fdffffff02350409000000000017a914a42e6b2b8198b25bdeb2bb45677ab2180d4847ae8773d10b0000000000160014601770808f0168c4dc0d927759407047f079a0f9024730440220703d8e59902e1f2e06b343588d88e84433cea072b5004c5c4dff0dd9787b3d2f022070924c133eba86760eebc91e09dad2d0db08f684b1976ca1b4d1f3421f2c084d012103f4bf0506968dd6eb701d0e40ab6ea02d5179a6550a761801684bd4384c0e79eb02473044022057bf3d62109758c6bc278ab54c15d43c95aa9c0f11548e76a5e1ca8ae103508002201d9f503b33d930d128fe102f5b1622dc15c32ef00268e58980e2b61ce77c33200121024f8884e9ebe6bf9c6492a662bf4bb3d30a55072cee98c82b8a17a22111ef4cf602473044022072788e6901a2d27b2db22ebef67aec7704aacbe003d96f0b8bf118c6ae5c0040022029dacac606daa4017e6e8e78efb139de5fb846599b67d501ef5851c302dee3fc012102718eb94089203414331e1291f30ebc139b087fde31dde1cfad7db22327bc69f40247304402202c927e0ccb0ec9cb8ad76206ad5ed95572df8c600bb1eb03de0f101d287cb121022050ddb0e7768dfe16788f1a1b835a8ad3b5be6fef0a2093781977aebf6e5d8a9f0121027e18fe1411ba7a2296c47ff8397e92986ce0836897bb42270b6dd86b2814ea1302473044022028d03205ca7736a78feb0c0b507df77952dd3c2a6947cdd9f9be58ef9094f9a20220768e22de86fc6683cec1c12d72f8ea5d6d0583ba171a69e1791bb46b399eff22012102d24813d067d189c0d15bfe62a24ef4295100cd0f80b0286de1dfae66540dfc4b29a20000", + "time": 1724854426, + "blocktime": 1724854426 + } + ] + } + } + }, + "handleFork": { + "syncRanges": [ + {"lower": 41480, "upper": 41499} + ], + "fakeBlocks": { + "41497": { + "height": 41497, + "hash": "0000000000000016204d49115b14be42a5022d0b4fd3e955ebd93e0933e6c6a1" + }, + "41498": { + "height": 41498, + "hash": "00000000000000064cebdc2a2fdcc74810325b4de8b4297e6cdd4fbdda221192" + }, + "41499": { + "height": 41499, + "hash": "00000000a4da915dca73162b98b671dd60b5a52208abf159f2ea7b11f08b1989" + } + }, + "realBlocks": { + "41497": { + "height": 41497, + "hash": "00000000000000098b5976b60433bbbf44b73681282e2bf7ee6186e9767c2ced" + }, + "41498": { + "height": 41498, + "hash": "000000000af275137c4183636a8c3fbe1ed9f8b30345daa89dc09be08822efd6" + }, + "41499": { + "height": 41499, + "hash": "00000000da2db0a996113cf34bdaacb9ce31ebc6a172f640601d3aec6936f8b5" + } + } + } +} diff --git a/tests/tests.json b/tests/tests.json index 5c0a0592..f99a222d 100644 --- a/tests/tests.json +++ b/tests/tests.json @@ -30,6 +30,11 @@ "EstimateSmartFee", "EstimateFee", "GetBestBlockHash", "GetBestBlockHeight", "GetBlockHeader"], "sync": ["ConnectBlocksParallel", "ConnectBlocks", "HandleFork"] }, + "bitcoin_testnet4": { + "rpc": ["GetBlock", "GetBlockHash", "GetTransaction", "GetTransactionForMempool", "MempoolSync", + "EstimateSmartFee", "EstimateFee", "GetBestBlockHash", "GetBestBlockHeight", "GetBlockHeader"], + "sync": ["ConnectBlocksParallel", "ConnectBlocks", "HandleFork"] + }, "bitcoin_signet": { "rpc": ["GetBlock", "GetBlockHash", "GetTransaction", "GetTransactionForMempool", "MempoolSync", "EstimateSmartFee", "EstimateFee", "GetBestBlockHash", "GetBestBlockHeight", "GetBlockHeader"], From 132bd77af7dc78d8168416341dbddcc224e7f700 Mon Sep 17 00:00:00 2001 From: JoHnY Date: Tue, 12 Nov 2024 13:11:37 +0000 Subject: [PATCH 31/56] =?UTF-8?q?ltc=20(+testnet)=200.21.3=20=E2=86=92=200?= =?UTF-8?q?.21.4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- configs/coins/litecoin.json | 10 +++++----- configs/coins/litecoin_testnet.json | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/configs/coins/litecoin.json b/configs/coins/litecoin.json index 6b212245..026665c1 100644 --- a/configs/coins/litecoin.json +++ b/configs/coins/litecoin.json @@ -22,10 +22,10 @@ "package_name": "backend-litecoin", "package_revision": "satoshilabs-1", "system_user": "litecoin", - "version": "0.21.3", - "binary_url": "https://download.litecoin.org/litecoin-0.21.3/linux/litecoin-0.21.3-x86_64-linux-gnu.tar.gz", + "version": "0.21.4", + "binary_url": "https://download.litecoin.org/litecoin-0.21.4/linux/litecoin-0.21.4-x86_64-linux-gnu.tar.gz", "verification_type": "gpg", - "verification_source": "https://download.litecoin.org/litecoin-0.21.3/linux/litecoin-0.21.3-x86_64-linux-gnu.tar.gz.asc", + "verification_source": "https://download.litecoin.org/litecoin-0.21.4/linux/litecoin-0.21.4-x86_64-linux-gnu.tar.gz.asc", "extract_command": "tar -C backend --strip 1 -xf", "exclude_files": ["bin/litecoin-qt"], "exec_command_template": "{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/bin/litecoind -datadir={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend -conf={{.Env.BackendInstallPath}}/{{.Coin.Alias}}/{{.Coin.Alias}}.conf -pid=/run/{{.Coin.Alias}}/{{.Coin.Alias}}.pid", @@ -42,8 +42,8 @@ }, "platforms": { "arm64": { - "binary_url": "https://download.litecoin.org/litecoin-0.21.3/linux/litecoin-0.21.3-aarch64-linux-gnu.tar.gz", - "verification_source": "https://download.litecoin.org/litecoin-0.21.3/linux/litecoin-0.21.3-aarch64-linux-gnu.tar.gz.asc" + "binary_url": "https://download.litecoin.org/litecoin-0.21.4/linux/litecoin-0.21.4-aarch64-linux-gnu.tar.gz", + "verification_source": "https://download.litecoin.org/litecoin-0.21.4/linux/litecoin-0.21.4-aarch64-linux-gnu.tar.gz.asc" } } }, diff --git a/configs/coins/litecoin_testnet.json b/configs/coins/litecoin_testnet.json index 25d2ce57..0d0962b3 100644 --- a/configs/coins/litecoin_testnet.json +++ b/configs/coins/litecoin_testnet.json @@ -22,10 +22,10 @@ "package_name": "backend-litecoin-testnet", "package_revision": "satoshilabs-1", "system_user": "litecoin", - "version": "0.21.3", - "binary_url": "https://download.litecoin.org/litecoin-0.21.3/linux/litecoin-0.21.3-x86_64-linux-gnu.tar.gz", + "version": "0.21.4", + "binary_url": "https://download.litecoin.org/litecoin-0.21.4/linux/litecoin-0.21.4-x86_64-linux-gnu.tar.gz", "verification_type": "gpg", - "verification_source": "https://download.litecoin.org/litecoin-0.21.3/linux/litecoin-0.21.3-x86_64-linux-gnu.tar.gz.asc", + "verification_source": "https://download.litecoin.org/litecoin-0.21.4/linux/litecoin-0.21.4-x86_64-linux-gnu.tar.gz.asc", "extract_command": "tar -C backend --strip 1 -xf", "exclude_files": [ "bin/litecoin-qt" @@ -44,8 +44,8 @@ }, "platforms": { "arm64": { - "binary_url": "https://download.litecoin.org/litecoin-0.21.3/linux/litecoin-0.21.3-aarch64-linux-gnu.tar.gz", - "verification_source": "https://download.litecoin.org/litecoin-0.21.3/linux/litecoin-0.21.3-aarch64-linux-gnu.tar.gz.asc" + "binary_url": "https://download.litecoin.org/litecoin-0.21.4/linux/litecoin-0.21.4-aarch64-linux-gnu.tar.gz", + "verification_source": "https://download.litecoin.org/litecoin-0.21.4/linux/litecoin-0.21.4-aarch64-linux-gnu.tar.gz.asc" } } }, From afe4749f6d916cabb0eb9cf513db6a9cff944178 Mon Sep 17 00:00:00 2001 From: JoHnY Date: Tue, 12 Nov 2024 12:36:43 +0000 Subject: [PATCH 32/56] =?UTF-8?q?eth=20(+testnets)=202.60.8=20=E2=86=92=20?= =?UTF-8?q?2.60.10?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- configs/coins/ethereum.json | 10 +++++----- configs/coins/ethereum_archive.json | 10 +++++----- configs/coins/ethereum_testnet_holesky.json | 10 +++++----- configs/coins/ethereum_testnet_holesky_archive.json | 10 +++++----- configs/coins/ethereum_testnet_sepolia.json | 10 +++++----- configs/coins/ethereum_testnet_sepolia_archive.json | 10 +++++----- 6 files changed, 30 insertions(+), 30 deletions(-) diff --git a/configs/coins/ethereum.json b/configs/coins/ethereum.json index 90aab017..c81e8660 100644 --- a/configs/coins/ethereum.json +++ b/configs/coins/ethereum.json @@ -22,10 +22,10 @@ "package_name": "backend-ethereum", "package_revision": "satoshilabs-1", "system_user": "ethereum", - "version": "2.60.8", - "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/2.60.8/erigon_2.60.8_linux_amd64.tar.gz", + "version": "2.60.10", + "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/v2.60.10/erigon_v2.60.10_linux_amd64.tar.gz", "verification_type": "sha256", - "verification_source": "02e9f46a0689c458045db113f9b356fb23f549e4bc2815826301e874a94f52d4", + "verification_source": "e22dc039846f2aee3d180b1dfb7d1b8282377d76ab4654137ed4abfec5d8e2af", "extract_command": "tar -C backend --strip-components=1 -xf", "exclude_files": [], "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/erigon --chain mainnet --snap.keepblocks --db.size.limit 15TB --prune c --prune.c.older 1000000 -torrent.download.rate 32mb --nat none --datadir {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/erigon --port {{.Ports.BackendP2P}} --ws --ws.port {{.Ports.BackendRPC}} --http --http.port {{.Ports.BackendRPC}} --http.addr 127.0.0.1 --http.corsdomain \"*\" --http.vhosts \"*\" --http.api \"eth,net,web3,debug,txpool\" --authrpc.port {{.Ports.BackendAuthRpc}} --private.api.addr \"\" --torrent.port {{.Ports.BackendHttp}} --log.dir.path {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend --log.dir.prefix {{.Coin.Alias}}'", @@ -39,8 +39,8 @@ "client_config_file": "", "platforms": { "arm64": { - "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/2.60.8/erigon_2.60.8_linux_arm64.tar.gz", - "verification_source": "0c19123af4bcf510e70a98de6bc882cf55c4b66cef841fdcedb8aa7c6c65d698" + "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/v2.60.10/erigon_v2.60.10_linux_arm64.tar.gz", + "verification_source": "68cb9baf937d19446de91bc1efccf389b4a2452233b3a5ef1cf5cd8a91b9ce95" } } }, diff --git a/configs/coins/ethereum_archive.json b/configs/coins/ethereum_archive.json index ecf662e0..6bab2239 100644 --- a/configs/coins/ethereum_archive.json +++ b/configs/coins/ethereum_archive.json @@ -22,10 +22,10 @@ "package_name": "backend-ethereum-archive", "package_revision": "satoshilabs-1", "system_user": "ethereum", - "version": "2.60.8", - "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/2.60.8/erigon_2.60.8_linux_amd64.tar.gz", + "version": "2.60.10", + "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/v2.60.10/erigon_v2.60.10_linux_amd64.tar.gz", "verification_type": "sha256", - "verification_source": "02e9f46a0689c458045db113f9b356fb23f549e4bc2815826301e874a94f52d4", + "verification_source": "e22dc039846f2aee3d180b1dfb7d1b8282377d76ab4654137ed4abfec5d8e2af", "extract_command": "tar -C backend --strip-components=1 -xf", "exclude_files": [], "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/erigon --chain mainnet --snap.keepblocks --db.size.limit 15TB --prune c --prune.c.older 1000000 -torrent.download.rate 32mb --nat none --datadir {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/erigon --port {{.Ports.BackendP2P}} --ws --ws.port {{.Ports.BackendRPC}} --http --http.port {{.Ports.BackendRPC}} --http.addr 127.0.0.1 --http.corsdomain \"*\" --http.vhosts \"*\" --http.api \"eth,net,web3,debug,txpool\" --authrpc.port {{.Ports.BackendAuthRpc}} --private.api.addr \"\" --torrent.port {{.Ports.BackendHttp}} --log.dir.path {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend --log.dir.prefix {{.Coin.Alias}}'", @@ -39,8 +39,8 @@ "client_config_file": "", "platforms": { "arm64": { - "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/2.60.8/erigon_2.60.8_linux_arm64.tar.gz", - "verification_source": "0c19123af4bcf510e70a98de6bc882cf55c4b66cef841fdcedb8aa7c6c65d698" + "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/v2.60.10/erigon_v2.60.10_linux_arm64.tar.gz", + "verification_source": "68cb9baf937d19446de91bc1efccf389b4a2452233b3a5ef1cf5cd8a91b9ce95" } } }, diff --git a/configs/coins/ethereum_testnet_holesky.json b/configs/coins/ethereum_testnet_holesky.json index 88dbaac2..7dceab36 100644 --- a/configs/coins/ethereum_testnet_holesky.json +++ b/configs/coins/ethereum_testnet_holesky.json @@ -22,10 +22,10 @@ "package_name": "backend-ethereum-testnet-holesky", "package_revision": "satoshilabs-1", "system_user": "ethereum", - "version": "2.60.8", - "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/2.60.8/erigon_2.60.8_linux_amd64.tar.gz", + "version": "2.60.10", + "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/v2.60.10/erigon_v2.60.10_linux_amd64.tar.gz", "verification_type": "sha256", - "verification_source": "02e9f46a0689c458045db113f9b356fb23f549e4bc2815826301e874a94f52d4", + "verification_source": "e22dc039846f2aee3d180b1dfb7d1b8282377d76ab4654137ed4abfec5d8e2af", "extract_command": "tar -C backend --strip-components=1 -xf", "exclude_files": [], "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/erigon --chain holesky --snap.keepblocks --db.size.limit 15TB --prune c --prune.c.older 1000000 -torrent.download.rate 32mb --nat none --datadir {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/erigon --port {{.Ports.BackendP2P}} --ws --ws.port {{.Ports.BackendRPC}} --http --http.port {{.Ports.BackendRPC}} --http.addr 127.0.0.1 --http.corsdomain \"*\" --http.vhosts \"*\" --http.api \"eth,net,web3,debug,txpool\" --authrpc.port {{.Ports.BackendAuthRpc}} --private.api.addr \"\" --torrent.port {{.Ports.BackendHttp}} --log.dir.path {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend --log.dir.prefix {{.Coin.Alias}}'", @@ -39,8 +39,8 @@ "client_config_file": "", "platforms": { "arm64": { - "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/2.60.8/erigon_2.60.8_linux_arm64.tar.gz", - "verification_source": "0c19123af4bcf510e70a98de6bc882cf55c4b66cef841fdcedb8aa7c6c65d698" + "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/v2.60.10/erigon_v2.60.10_linux_arm64.tar.gz", + "verification_source": "68cb9baf937d19446de91bc1efccf389b4a2452233b3a5ef1cf5cd8a91b9ce95" } } }, diff --git a/configs/coins/ethereum_testnet_holesky_archive.json b/configs/coins/ethereum_testnet_holesky_archive.json index 99191e83..3474b63a 100644 --- a/configs/coins/ethereum_testnet_holesky_archive.json +++ b/configs/coins/ethereum_testnet_holesky_archive.json @@ -23,10 +23,10 @@ "package_name": "backend-ethereum-testnet-holesky-archive", "package_revision": "satoshilabs-1", "system_user": "ethereum", - "version": "2.60.8", - "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/2.60.8/erigon_2.60.8_linux_amd64.tar.gz", + "version": "2.60.10", + "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/v2.60.10/erigon_v2.60.10_linux_amd64.tar.gz", "verification_type": "sha256", - "verification_source": "02e9f46a0689c458045db113f9b356fb23f549e4bc2815826301e874a94f52d4", + "verification_source": "e22dc039846f2aee3d180b1dfb7d1b8282377d76ab4654137ed4abfec5d8e2af", "extract_command": "tar -C backend --strip-components=1 -xf", "exclude_files": [], "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/erigon --chain holesky --snap.keepblocks --db.size.limit 15TB --prune c --prune.c.older 1000000 -torrent.download.rate 32mb --nat none --datadir {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/erigon --port {{.Ports.BackendP2P}} --ws --ws.port {{.Ports.BackendRPC}} --http --http.port {{.Ports.BackendRPC}} --http.addr 127.0.0.1 --http.corsdomain \"*\" --http.vhosts \"*\" --http.api \"eth,net,web3,debug,txpool\" --authrpc.port {{.Ports.BackendAuthRpc}} --private.api.addr \"\" --torrent.port {{.Ports.BackendHttp}} --log.dir.path {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend --log.dir.prefix {{.Coin.Alias}}'", @@ -40,8 +40,8 @@ "client_config_file": "", "platforms": { "arm64": { - "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/2.60.8/erigon_2.60.8_linux_arm64.tar.gz", - "verification_source": "0c19123af4bcf510e70a98de6bc882cf55c4b66cef841fdcedb8aa7c6c65d698" + "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/v2.60.10/erigon_v2.60.10_linux_arm64.tar.gz", + "verification_source": "68cb9baf937d19446de91bc1efccf389b4a2452233b3a5ef1cf5cd8a91b9ce95" } } }, diff --git a/configs/coins/ethereum_testnet_sepolia.json b/configs/coins/ethereum_testnet_sepolia.json index 195faa55..dfca9bf9 100644 --- a/configs/coins/ethereum_testnet_sepolia.json +++ b/configs/coins/ethereum_testnet_sepolia.json @@ -22,10 +22,10 @@ "package_name": "backend-ethereum-testnet-sepolia", "package_revision": "satoshilabs-1", "system_user": "ethereum", - "version": "2.60.8", - "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/2.60.8/erigon_2.60.8_linux_amd64.tar.gz", + "version": "2.60.10", + "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/v2.60.10/erigon_v2.60.10_linux_amd64.tar.gz", "verification_type": "sha256", - "verification_source": "02e9f46a0689c458045db113f9b356fb23f549e4bc2815826301e874a94f52d4", + "verification_source": "e22dc039846f2aee3d180b1dfb7d1b8282377d76ab4654137ed4abfec5d8e2af", "extract_command": "tar -C backend --strip-components=1 -xf", "exclude_files": [], "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/erigon --chain sepolia --snap.keepblocks --db.size.limit 15TB --prune c --prune.c.older 1000000 -torrent.download.rate 32mb --nat none --datadir {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/erigon --port {{.Ports.BackendP2P}} --ws --ws.port {{.Ports.BackendRPC}} --http --http.port {{.Ports.BackendRPC}} --http.addr 127.0.0.1 --http.corsdomain \"*\" --http.vhosts \"*\" --http.api \"eth,net,web3,debug,txpool\" --authrpc.port {{.Ports.BackendAuthRpc}} --private.api.addr \"\" --torrent.port {{.Ports.BackendHttp}} --log.dir.path {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend --log.dir.prefix {{.Coin.Alias}}'", @@ -39,8 +39,8 @@ "client_config_file": "", "platforms": { "arm64": { - "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/2.60.8/erigon_2.60.8_linux_arm64.tar.gz", - "verification_source": "0c19123af4bcf510e70a98de6bc882cf55c4b66cef841fdcedb8aa7c6c65d698" + "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/v2.60.10/erigon_v2.60.10_linux_arm64.tar.gz", + "verification_source": "68cb9baf937d19446de91bc1efccf389b4a2452233b3a5ef1cf5cd8a91b9ce95" } } }, diff --git a/configs/coins/ethereum_testnet_sepolia_archive.json b/configs/coins/ethereum_testnet_sepolia_archive.json index 2ab9faea..35926e52 100644 --- a/configs/coins/ethereum_testnet_sepolia_archive.json +++ b/configs/coins/ethereum_testnet_sepolia_archive.json @@ -23,10 +23,10 @@ "package_name": "backend-ethereum-testnet-sepolia-archive", "package_revision": "satoshilabs-1", "system_user": "ethereum", - "version": "2.60.8", - "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/2.60.8/erigon_2.60.8_linux_amd64.tar.gz", + "version": "2.60.10", + "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/v2.60.10/erigon_v2.60.10_linux_amd64.tar.gz", "verification_type": "sha256", - "verification_source": "02e9f46a0689c458045db113f9b356fb23f549e4bc2815826301e874a94f52d4", + "verification_source": "e22dc039846f2aee3d180b1dfb7d1b8282377d76ab4654137ed4abfec5d8e2af", "extract_command": "tar -C backend --strip-components=1 -xf", "exclude_files": [], "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/erigon --chain sepolia --snap.keepblocks --db.size.limit 15TB --prune c --prune.c.older 1000000 -torrent.download.rate 32mb --nat none --datadir {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/erigon --port {{.Ports.BackendP2P}} --ws --ws.port {{.Ports.BackendRPC}} --http --http.port {{.Ports.BackendRPC}} --http.addr 127.0.0.1 --http.corsdomain \"*\" --http.vhosts \"*\" --http.api \"eth,net,web3,debug,txpool\" --authrpc.port {{.Ports.BackendAuthRpc}} --private.api.addr \"\" --torrent.port {{.Ports.BackendHttp}} --log.dir.path {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend --log.dir.prefix {{.Coin.Alias}}'", @@ -40,8 +40,8 @@ "client_config_file": "", "platforms": { "arm64": { - "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/2.60.8/erigon_2.60.8_linux_arm64.tar.gz", - "verification_source": "0c19123af4bcf510e70a98de6bc882cf55c4b66cef841fdcedb8aa7c6c65d698" + "binary_url": "https://github.com/ledgerwatch/erigon/releases/download/v2.60.10/erigon_v2.60.10_linux_arm64.tar.gz", + "verification_source": "68cb9baf937d19446de91bc1efccf389b4a2452233b3a5ef1cf5cd8a91b9ce95" } } }, From d6aaa09e0627c8f971771abc4102499e655077cd Mon Sep 17 00:00:00 2001 From: kevin <35275952+kaladinlight@users.noreply.github.com> Date: Mon, 25 Nov 2024 13:36:07 -0700 Subject: [PATCH 33/56] Add Arbitrum One and Arbitrum Nova Support (#1112) * add arbitrum one and arbitrum nova support * fix archive parent chain ports * fix exec script config * update nitro-node version --- Makefile | 5 +- bchain/coins/arbitrum/arbitrumrpc.go | 77 +++++++++++++++++++ bchain/coins/blockchain.go | 5 ++ build/docker/deb/Dockerfile | 10 +++ build/templates/backend/Makefile | 12 ++- build/templates/backend/scripts/arbitrum.sh | 34 ++++++++ .../backend/scripts/arbitrum_archive.sh | 35 +++++++++ .../backend/scripts/arbitrum_nova.sh | 34 ++++++++ .../backend/scripts/arbitrum_nova_archive.sh | 35 +++++++++ build/tools/templates.go | 2 + configs/coins/arbitrum.json | 65 ++++++++++++++++ configs/coins/arbitrum_archive.json | 67 ++++++++++++++++ configs/coins/arbitrum_nova.json | 65 ++++++++++++++++ configs/coins/arbitrum_nova_archive.json | 67 ++++++++++++++++ docs/ports.md | 4 + 15 files changed, 514 insertions(+), 3 deletions(-) create mode 100644 bchain/coins/arbitrum/arbitrumrpc.go create mode 100755 build/templates/backend/scripts/arbitrum.sh create mode 100755 build/templates/backend/scripts/arbitrum_archive.sh create mode 100755 build/templates/backend/scripts/arbitrum_nova.sh create mode 100755 build/templates/backend/scripts/arbitrum_nova_archive.sh create mode 100644 configs/coins/arbitrum.json create mode 100644 configs/coins/arbitrum_archive.json create mode 100644 configs/coins/arbitrum_nova.json create mode 100644 configs/coins/arbitrum_nova_archive.json diff --git a/Makefile b/Makefile index dfe5b5f3..54475015 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,7 @@ BIN_IMAGE = blockbook-build DEB_IMAGE = blockbook-build-deb PACKAGER = $(shell id -u):$(shell id -g) +DOCKER_VERSION = $(shell docker version --format '{{.Client.Version}}') BASE_IMAGE = $$(awk -F= '$$1=="ID" { print $$2 ;}' /etc/os-release):$$(awk -F= '$$1=="VERSION_ID" { print $$2 ;}' /etc/os-release | tr -d '"') NO_CACHE = false TCMALLOC = @@ -27,7 +28,7 @@ test-all: .bin-image docker run -t --rm -e PACKAGER=$(PACKAGER) -v "$(CURDIR):/src" --network="host" $(BIN_IMAGE) make test-all ARGS="$(ARGS)" deb-backend-%: .deb-image - docker run -t --rm -e PACKAGER=$(PACKAGER) -v "$(CURDIR):/src" -v "$(CURDIR)/build:/out" $(DEB_IMAGE) /build/build-deb.sh backend $* $(ARGS) + docker run -t --rm -e PACKAGER=$(PACKAGER) -v /var/run/docker.sock:/var/run/docker.sock -v "$(CURDIR):/src" -v "$(CURDIR)/build:/out" $(DEB_IMAGE) /build/build-deb.sh backend $* $(ARGS) deb-blockbook-%: .deb-image docker run -t --rm -e PACKAGER=$(PACKAGER) -v "$(CURDIR):/src" -v "$(CURDIR)/build:/out" $(DEB_IMAGE) /build/build-deb.sh blockbook $* $(ARGS) @@ -55,7 +56,7 @@ build-images: clean-images .deb-image: .bin-image @if [ $$(build/tools/image_status.sh $(DEB_IMAGE):latest build/docker) != "ok" ]; then \ echo "Building image $(DEB_IMAGE)..."; \ - docker build --no-cache=$(NO_CACHE) -t $(DEB_IMAGE) build/docker/deb; \ + docker build --no-cache=$(NO_CACHE) --build-arg DOCKER_VERSION=$(DOCKER_VERSION) -t $(DEB_IMAGE) build/docker/deb; \ else \ echo "Image $(DEB_IMAGE) is up to date"; \ fi diff --git a/bchain/coins/arbitrum/arbitrumrpc.go b/bchain/coins/arbitrum/arbitrumrpc.go new file mode 100644 index 00000000..e8c25354 --- /dev/null +++ b/bchain/coins/arbitrum/arbitrumrpc.go @@ -0,0 +1,77 @@ +package arbitrum + +import ( + "context" + "encoding/json" + + "github.com/golang/glog" + "github.com/juju/errors" + "github.com/trezor/blockbook/bchain" + "github.com/trezor/blockbook/bchain/coins/eth" +) + +const ( + ArbitrumOneMainNet eth.Network = 42161 + ArbitrumNovaMainNet eth.Network = 42170 +) + +// ArbitrumRPC is an interface to JSON-RPC arbitrum service. +type ArbitrumRPC struct { + *eth.EthereumRPC +} + +// NewArbitrumRPC returns new ArbitrumRPC instance. +func NewArbitrumRPC(config json.RawMessage, pushHandler func(bchain.NotificationType)) (bchain.BlockChain, error) { + c, err := eth.NewEthereumRPC(config, pushHandler) + if err != nil { + return nil, err + } + + s := &ArbitrumRPC{ + EthereumRPC: c.(*eth.EthereumRPC), + } + + return s, nil +} + +// Initialize arbitrum rpc interface +func (b *ArbitrumRPC) Initialize() error { + b.OpenRPC = eth.OpenRPC + + rc, ec, err := b.OpenRPC(b.ChainConfig.RPCURL) + if err != nil { + return err + } + + // set chain specific + b.Client = ec + b.RPC = rc + b.NewBlock = eth.NewEthereumNewBlock() + b.NewTx = eth.NewEthereumNewTx() + + ctx, cancel := context.WithTimeout(context.Background(), b.Timeout) + defer cancel() + + id, err := b.Client.NetworkID(ctx) + if err != nil { + return err + } + + // parameters for getInfo request + switch eth.Network(id.Uint64()) { + case ArbitrumOneMainNet: + b.MainNetChainID = ArbitrumOneMainNet + b.Testnet = false + b.Network = "livenet" + case ArbitrumNovaMainNet: + b.MainNetChainID = ArbitrumNovaMainNet + b.Testnet = false + b.Network = "livenet" + default: + return errors.Errorf("Unknown network id %v", id) + } + + glog.Info("rpc: block chain ", b.Network) + + return nil +} diff --git a/bchain/coins/blockchain.go b/bchain/coins/blockchain.go index f0cfa3cc..f3dac986 100644 --- a/bchain/coins/blockchain.go +++ b/bchain/coins/blockchain.go @@ -11,6 +11,7 @@ import ( "github.com/juju/errors" "github.com/trezor/blockbook/bchain" + "github.com/trezor/blockbook/bchain/coins/arbitrum" "github.com/trezor/blockbook/bchain/coins/avalanche" "github.com/trezor/blockbook/bchain/coins/bch" "github.com/trezor/blockbook/bchain/coins/bellcoin" @@ -142,6 +143,10 @@ func init() { BlockChainFactories["Polygon Archive"] = polygon.NewPolygonRPC BlockChainFactories["Optimism"] = optimism.NewOptimismRPC BlockChainFactories["Optimism Archive"] = optimism.NewOptimismRPC + BlockChainFactories["Arbitrum"] = arbitrum.NewArbitrumRPC + BlockChainFactories["Arbitrum Archive"] = arbitrum.NewArbitrumRPC + BlockChainFactories["Arbitrum Nova"] = arbitrum.NewArbitrumRPC + BlockChainFactories["Arbitrum Nova Archive"] = arbitrum.NewArbitrumRPC } // NewBlockChain creates bchain.BlockChain and bchain.Mempool for the coin passed by the parameter coin diff --git a/build/docker/deb/Dockerfile b/build/docker/deb/Dockerfile index b6632379..fd8fa114 100644 --- a/build/docker/deb/Dockerfile +++ b/build/docker/deb/Dockerfile @@ -9,6 +9,16 @@ RUN apt-get update && \ apt-get install -y devscripts debhelper make dh-exec zstd && \ apt-get clean +# install docker cli +ARG DOCKER_VERSION + +RUN if [ -z "$DOCKER_VERSION" ]; then echo "DOCKER_VERSION is a required build arg" && exit 1; fi + +RUN wget -O docker.tgz "https://download.docker.com/linux/static/stable/x86_64/docker-${DOCKER_VERSION}.tgz" && \ + tar -xzf docker.tgz --strip 1 -C /usr/local/bin/ && \ + rm docker.tgz && \ + docker --version + ADD gpg-keys /tmp/gpg-keys RUN gpg --batch --import /tmp/gpg-keys/* diff --git a/build/templates/backend/Makefile b/build/templates/backend/Makefile index 5b9e0bd4..de5440aa 100644 --- a/build/templates/backend/Makefile +++ b/build/templates/backend/Makefile @@ -2,6 +2,16 @@ ARCHIVE := $(shell basename {{.Backend.BinaryURL}}) all: + mkdir backend +{{- if ne .Backend.DockerImage "" }} + docker container inspect extract > /dev/null 2>&1 && docker rm extract || true + docker create --name extract {{.Backend.DockerImage}} +{{- if eq .Backend.VerificationType "docker"}} + [ "$$(docker inspect --format='{{`{{index .RepoDigests 0}}`}}' {{.Backend.DockerImage}} | sed 's/.*@sha256://')" = "{{.Backend.VerificationSource}}" ] +{{- end}} + {{.Backend.ExtractCommand}} + docker rm extract +{{- else }} wget {{.Backend.BinaryURL}} {{- if eq .Backend.VerificationType "gpg"}} wget {{.Backend.VerificationSource}} -O checksum @@ -13,8 +23,8 @@ all: {{- else if eq .Backend.VerificationType "sha256"}} [ "$$(sha256sum ${ARCHIVE} | cut -d ' ' -f 1)" = "{{.Backend.VerificationSource}}" ] {{- end}} - mkdir backend {{.Backend.ExtractCommand}} ${ARCHIVE} +{{- end}} {{- if .Backend.ExcludeFiles}} # generated from exclude_files {{- range $index, $name := .Backend.ExcludeFiles}} diff --git a/build/templates/backend/scripts/arbitrum.sh b/build/templates/backend/scripts/arbitrum.sh new file mode 100755 index 00000000..0872739c --- /dev/null +++ b/build/templates/backend/scripts/arbitrum.sh @@ -0,0 +1,34 @@ +#!/bin/sh + +{{define "main" -}} + +set -e + +INSTALL_DIR={{.Env.BackendInstallPath}}/{{.Coin.Alias}} +DATA_DIR={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend + +NITRO_BIN=$INSTALL_DIR/nitro + +$NITRO_BIN \ + --chain.name arb1 \ + --init.latest pruned \ + --init.download-path $DATA_DIR/tmp \ + --auth.jwtsecret $DATA_DIR/jwtsecret \ + --persistent.chain $DATA_DIR \ + --parent-chain.connection.url http://127.0.0.1:8136 \ + --parent-chain.blob-client.beacon-url http://127.0.0.1:7536 \ + --http.addr 127.0.0.1 \ + --http.port {{.Ports.BackendHttp}} \ + --http.api eth,net,web3,debug,txpool,arb \ + --http.vhosts '*' \ + --http.corsdomain '*' \ + --ws.addr 127.0.0.1 \ + --ws.api eth,net,web3,debug,txpool,arb \ + --ws.port {{.Ports.BackendRPC}} \ + --ws.origins '*' \ + --file-logging.enable='false' \ + --node.staker.enable='false' \ + --execution.tx-lookup-limit 0 \ + --validation.wasm.allowed-wasm-module-roots "$INSTALL_DIR/nitro-legacy/machines,$INSTALL_DIR/target/machines" + +{{end}} \ No newline at end of file diff --git a/build/templates/backend/scripts/arbitrum_archive.sh b/build/templates/backend/scripts/arbitrum_archive.sh new file mode 100755 index 00000000..27c7d6da --- /dev/null +++ b/build/templates/backend/scripts/arbitrum_archive.sh @@ -0,0 +1,35 @@ +#!/bin/sh + +{{define "main" -}} + +set -e + +INSTALL_DIR={{.Env.BackendInstallPath}}/{{.Coin.Alias}} +DATA_DIR={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend + +NITRO_BIN=$INSTALL_DIR/nitro + +$NITRO_BIN \ + --chain.name arb1 \ + --init.latest archive \ + --init.download-path $DATA_DIR/tmp \ + --auth.jwtsecret $DATA_DIR/jwtsecret \ + --persistent.chain $DATA_DIR \ + --parent-chain.connection.url http://127.0.0.1:8116 \ + --parent-chain.blob-client.beacon-url http://127.0.0.1:7516 \ + --http.addr 127.0.0.1 \ + --http.port {{.Ports.BackendHttp}} \ + --http.api eth,net,web3,debug,txpool,arb \ + --http.vhosts '*' \ + --http.corsdomain '*' \ + --ws.addr 127.0.0.1 \ + --ws.api eth,net,web3,debug,txpool,arb \ + --ws.port {{.Ports.BackendRPC}} \ + --ws.origins '*' \ + --file-logging.enable='false' \ + --node.staker.enable='false' \ + --execution.caching.archive \ + --execution.tx-lookup-limit 0 \ + --validation.wasm.allowed-wasm-module-roots "$INSTALL_DIR/nitro-legacy/machines,$INSTALL_DIR/target/machines" + +{{end}} \ No newline at end of file diff --git a/build/templates/backend/scripts/arbitrum_nova.sh b/build/templates/backend/scripts/arbitrum_nova.sh new file mode 100755 index 00000000..3f15e4ef --- /dev/null +++ b/build/templates/backend/scripts/arbitrum_nova.sh @@ -0,0 +1,34 @@ +#!/bin/sh + +{{define "main" -}} + +set -e + +INSTALL_DIR={{.Env.BackendInstallPath}}/{{.Coin.Alias}} +DATA_DIR={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend + +NITRO_BIN=$INSTALL_DIR/nitro + +$NITRO_BIN \ + --chain.name nova \ + --init.latest pruned \ + --init.download-path $DATA_DIR/tmp \ + --auth.jwtsecret $DATA_DIR/jwtsecret \ + --persistent.chain $DATA_DIR \ + --parent-chain.connection.url http://127.0.0.1:8136 \ + --parent-chain.blob-client.beacon-url http://127.0.0.1:7536 \ + --http.addr 127.0.0.1 \ + --http.port {{.Ports.BackendHttp}} \ + --http.api eth,net,web3,debug,txpool,arb \ + --http.vhosts '*' \ + --http.corsdomain '*' \ + --ws.addr 127.0.0.1 \ + --ws.api eth,net,web3,debug,txpool,arb \ + --ws.port {{.Ports.BackendRPC}} \ + --ws.origins '*' \ + --file-logging.enable='false' \ + --node.staker.enable='false' \ + --execution.tx-lookup-limit 0 \ + --validation.wasm.allowed-wasm-module-roots "$INSTALL_DIR/nitro-legacy/machines,$INSTALL_DIR/target/machines" + +{{end}} \ No newline at end of file diff --git a/build/templates/backend/scripts/arbitrum_nova_archive.sh b/build/templates/backend/scripts/arbitrum_nova_archive.sh new file mode 100755 index 00000000..eb150f79 --- /dev/null +++ b/build/templates/backend/scripts/arbitrum_nova_archive.sh @@ -0,0 +1,35 @@ +#!/bin/sh + +{{define "main" -}} + +set -e + +INSTALL_DIR={{.Env.BackendInstallPath}}/{{.Coin.Alias}} +DATA_DIR={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend + +NITRO_BIN=$INSTALL_DIR/nitro + +$NITRO_BIN \ + --chain.name nova \ + --init.latest archive \ + --init.download-path $DATA_DIR/tmp \ + --auth.jwtsecret $DATA_DIR/jwtsecret \ + --persistent.chain $DATA_DIR \ + --parent-chain.connection.url http://127.0.0.1:8116 \ + --parent-chain.blob-client.beacon-url http://127.0.0.1:7516 \ + --http.addr 127.0.0.1 \ + --http.port {{.Ports.BackendHttp}} \ + --http.api eth,net,web3,debug,txpool,arb \ + --http.vhosts '*' \ + --http.corsdomain '*' \ + --ws.addr 127.0.0.1 \ + --ws.api eth,net,web3,debug,txpool,arb \ + --ws.port {{.Ports.BackendRPC}} \ + --ws.origins '*' \ + --file-logging.enable='false' \ + --node.staker.enable='false' \ + --execution.caching.archive \ + --execution.tx-lookup-limit 0 \ + --validation.wasm.allowed-wasm-module-roots "$INSTALL_DIR/nitro-legacy/machines,$INSTALL_DIR/target/machines" + +{{end}} \ No newline at end of file diff --git a/build/tools/templates.go b/build/tools/templates.go index 8dfb9fb0..03113d2a 100644 --- a/build/tools/templates.go +++ b/build/tools/templates.go @@ -21,6 +21,7 @@ type Backend struct { SystemUser string `json:"system_user"` Version string `json:"version"` BinaryURL string `json:"binary_url"` + DockerImage string `json:"docker_image"` VerificationType string `json:"verification_type"` VerificationSource string `json:"verification_source"` ExtractCommand string `json:"extract_command"` @@ -204,6 +205,7 @@ func LoadConfig(configsDir, coin string) (*Config, error) { case "gpg": case "sha256": case "gpg-sha256": + case "docker": default: return nil, fmt.Errorf("Invalid verification type: %s", config.Backend.VerificationType) } diff --git a/configs/coins/arbitrum.json b/configs/coins/arbitrum.json new file mode 100644 index 00000000..223fa6f9 --- /dev/null +++ b/configs/coins/arbitrum.json @@ -0,0 +1,65 @@ +{ + "coin": { + "name": "Arbitrum", + "shortcut": "ETH", + "label": "Arbitrum", + "alias": "arbitrum" + }, + "ports": { + "backend_rpc": 8205, + "backend_p2p": 38405, + "backend_http": 8305, + "blockbook_internal": 9205, + "blockbook_public": 9305 + }, + "ipc": { + "rpc_url_template": "ws://127.0.0.1:{{.Ports.BackendRPC}}", + "rpc_timeout": 25 + }, + "backend": { + "package_name": "backend-arbitrum", + "package_revision": "satoshilabs-1", + "system_user": "arbitrum", + "version": "3.2.1", + "docker_image": "offchainlabs/nitro-node:v3.2.1-d81324d", + "verification_type": "docker", + "verification_source": "724ebdcca39cd0c28ffd025ecea8d1622a376f41344201b729afb60352cbc306", + "extract_command": "docker cp extract:/home/user/target backend/target; docker cp extract:/home/user/nitro-legacy backend/nitro-legacy; docker cp extract:/usr/local/bin/nitro backend/nitro", + "exclude_files": [], + "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/arbitrum_exec.sh 2>> {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", + "exec_script": "arbitrum.sh", + "logrotate_files_template": "{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log", + "postinst_script_template": "openssl rand -hex 32 > {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/jwtsecret", + "service_type": "simple", + "service_additional_params_template": "", + "protect_memory": true, + "mainnet": true, + "server_config_file": "", + "client_config_file": "" + }, + "blockbook": { + "package_name": "blockbook-arbitrum", + "system_user": "blockbook-arbitrum", + "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, + "additional_params": { + "mempoolTxTimeoutHours": 48, + "queryBackendOnMempoolResync": false, + "fiat_rates": "coingecko", + "fiat_rates_vs_currencies": "AED,ARS,AUD,BDT,BHD,BMD,BRL,CAD,CHF,CLP,CNY,CZK,DKK,EUR,GBP,HKD,HUF,IDR,ILS,INR,JPY,KRW,KWD,LKR,MMK,MXN,MYR,NGN,NOK,NZD,PHP,PKR,PLN,RUB,SAR,SEK,SGD,THB,TRY,TWD,UAH,USD,VEF,VND,ZAR,BTC,ETH", + "fiat_rates_params": "{\"url\": \"https://api.coingecko.com/api/v3\", \"coin\": \"ethereum\",\"platformIdentifier\": \"ethereum\",\"platformVsCurrency\": \"eth\",\"periodSeconds\": 900}" + } + } + }, + "meta": { + "package_maintainer": "IT", + "package_maintainer_email": "it@satoshilabs.com" + } +} diff --git a/configs/coins/arbitrum_archive.json b/configs/coins/arbitrum_archive.json new file mode 100644 index 00000000..4d672f80 --- /dev/null +++ b/configs/coins/arbitrum_archive.json @@ -0,0 +1,67 @@ +{ + "coin": { + "name": "Arbitrum Archive", + "shortcut": "ETH", + "label": "Arbitrum", + "alias": "arbitrum_archive" + }, + "ports": { + "backend_rpc": 8306, + "backend_p2p": 38406, + "blockbook_internal": 9206, + "blockbook_public": 9306 + }, + "ipc": { + "rpc_url_template": "ws://127.0.0.1:{{.Ports.BackendRPC}}", + "rpc_timeout": 25 + }, + "backend": { + "package_name": "backend-arbitrum-archive", + "package_revision": "satoshilabs-1", + "system_user": "arbitrum", + "version": "3.2.1", + "docker_image": "offchainlabs/nitro-node:v3.2.1-d81324d", + "verification_type": "docker", + "verification_source": "724ebdcca39cd0c28ffd025ecea8d1622a376f41344201b729afb60352cbc306", + "extract_command": "docker cp extract:/home/user/target backend/target; docker cp extract:/home/user/nitro-legacy backend/nitro-legacy; docker cp extract:/usr/local/bin/nitro backend/nitro", + "exclude_files": [], + "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/arbitrum_archive_exec.sh 2>> {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", + "exec_script": "arbitrum_archive.sh", + "logrotate_files_template": "{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log", + "postinst_script_template": "openssl rand -hex 32 > {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/jwtsecret", + "service_type": "simple", + "service_additional_params_template": "", + "protect_memory": true, + "mainnet": true, + "server_config_file": "", + "client_config_file": "" + }, + "blockbook": { + "package_name": "blockbook-arbitrum-archive", + "system_user": "blockbook-arbitrum", + "internal_binding_template": ":{{.Ports.BlockbookInternal}}", + "public_binding_template": ":{{.Ports.BlockbookPublic}}", + "explorer_url": "", + "additional_params": "-workers=16", + "block_chain": { + "parse": true, + "mempool_workers": 8, + "mempool_sub_workers": 2, + "block_addresses_to_keep": 600, + "additional_params": { + "address_aliases": true, + "mempoolTxTimeoutHours": 48, + "processInternalTransactions": true, + "queryBackendOnMempoolResync": false, + "fiat_rates": "coingecko", + "fiat_rates_vs_currencies": "AED,ARS,AUD,BDT,BHD,BMD,BRL,CAD,CHF,CLP,CNY,CZK,DKK,EUR,GBP,HKD,HUF,IDR,ILS,INR,JPY,KRW,KWD,LKR,MMK,MXN,MYR,NGN,NOK,NZD,PHP,PKR,PLN,RUB,SAR,SEK,SGD,THB,TRY,TWD,UAH,USD,VEF,VND,ZAR,BTC,ETH", + "fiat_rates_params": "{\"url\": \"https://api.coingecko.com/api/v3\", \"coin\": \"ethereum\",\"platformIdentifier\": \"ethereum\",\"platformVsCurrency\": \"eth\",\"periodSeconds\": 900}", + "fourByteSignatures": "https://www.4byte.directory/api/v1/signatures/" + } + } + }, + "meta": { + "package_maintainer": "IT", + "package_maintainer_email": "it@satoshilabs.com" + } +} diff --git a/configs/coins/arbitrum_nova.json b/configs/coins/arbitrum_nova.json new file mode 100644 index 00000000..0d0a252b --- /dev/null +++ b/configs/coins/arbitrum_nova.json @@ -0,0 +1,65 @@ +{ + "coin": { + "name": "Arbitrum Nova", + "shortcut": "ETH", + "label": "Arbitrum Nova", + "alias": "arbitrum_nova" + }, + "ports": { + "backend_rpc": 8207, + "backend_p2p": 38407, + "backend_http": 8307, + "blockbook_internal": 9207, + "blockbook_public": 9307 + }, + "ipc": { + "rpc_url_template": "ws://127.0.0.1:{{.Ports.BackendRPC}}", + "rpc_timeout": 25 + }, + "backend": { + "package_name": "backend-arbitrum-nova", + "package_revision": "satoshilabs-1", + "system_user": "arbitrum", + "version": "3.2.1", + "docker_image": "offchainlabs/nitro-node:v3.2.1-d81324d", + "verification_type": "docker", + "verification_source": "724ebdcca39cd0c28ffd025ecea8d1622a376f41344201b729afb60352cbc306", + "extract_command": "docker cp extract:/home/user/target backend/target; docker cp extract:/home/user/nitro-legacy backend/nitro-legacy; docker cp extract:/usr/local/bin/nitro backend/nitro", + "exclude_files": [], + "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/arbitrum_nova_exec.sh 2>> {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", + "exec_script": "arbitrum_nova.sh", + "logrotate_files_template": "{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log", + "postinst_script_template": "openssl rand -hex 32 > {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/jwtsecret", + "service_type": "simple", + "service_additional_params_template": "", + "protect_memory": true, + "mainnet": true, + "server_config_file": "", + "client_config_file": "" + }, + "blockbook": { + "package_name": "blockbook-arbitrum-nova", + "system_user": "blockbook-arbitrum", + "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, + "additional_params": { + "mempoolTxTimeoutHours": 48, + "queryBackendOnMempoolResync": false, + "fiat_rates": "coingecko", + "fiat_rates_vs_currencies": "AED,ARS,AUD,BDT,BHD,BMD,BRL,CAD,CHF,CLP,CNY,CZK,DKK,EUR,GBP,HKD,HUF,IDR,ILS,INR,JPY,KRW,KWD,LKR,MMK,MXN,MYR,NGN,NOK,NZD,PHP,PKR,PLN,RUB,SAR,SEK,SGD,THB,TRY,TWD,UAH,USD,VEF,VND,ZAR,BTC,ETH", + "fiat_rates_params": "{\"url\": \"https://api.coingecko.com/api/v3\", \"coin\": \"ethereum\",\"platformIdentifier\": \"ethereum\",\"platformVsCurrency\": \"eth\",\"periodSeconds\": 900}" + } + } + }, + "meta": { + "package_maintainer": "IT", + "package_maintainer_email": "it@satoshilabs.com" + } +} diff --git a/configs/coins/arbitrum_nova_archive.json b/configs/coins/arbitrum_nova_archive.json new file mode 100644 index 00000000..05105976 --- /dev/null +++ b/configs/coins/arbitrum_nova_archive.json @@ -0,0 +1,67 @@ +{ + "coin": { + "name": "Arbitrum Nova Archive", + "shortcut": "ETH", + "label": "Arbitrum Nova", + "alias": "arbitrum_nova_archive" + }, + "ports": { + "backend_rpc": 8308, + "backend_p2p": 38408, + "blockbook_internal": 9208, + "blockbook_public": 9308 + }, + "ipc": { + "rpc_url_template": "ws://127.0.0.1:{{.Ports.BackendRPC}}", + "rpc_timeout": 25 + }, + "backend": { + "package_name": "backend-arbitrum-nova-archive", + "package_revision": "satoshilabs-1", + "system_user": "arbitrum", + "version": "3.2.1", + "docker_image": "offchainlabs/nitro-node:v3.2.1-d81324d", + "verification_type": "docker", + "verification_source": "724ebdcca39cd0c28ffd025ecea8d1622a376f41344201b729afb60352cbc306", + "extract_command": "docker cp extract:/home/user/target backend/target; docker cp extract:/home/user/nitro-legacy backend/nitro-legacy; docker cp extract:/usr/local/bin/nitro backend/nitro", + "exclude_files": [], + "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/arbitrum_nova_archive_exec.sh 2>> {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", + "exec_script": "arbitrum_nova_archive.sh", + "logrotate_files_template": "{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log", + "postinst_script_template": "openssl rand -hex 32 > {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/jwtsecret", + "service_type": "simple", + "service_additional_params_template": "", + "protect_memory": true, + "mainnet": true, + "server_config_file": "", + "client_config_file": "" + }, + "blockbook": { + "package_name": "blockbook-arbitrum-nova-archive", + "system_user": "blockbook-arbitrum", + "internal_binding_template": ":{{.Ports.BlockbookInternal}}", + "public_binding_template": ":{{.Ports.BlockbookPublic}}", + "explorer_url": "", + "additional_params": "-workers=16", + "block_chain": { + "parse": true, + "mempool_workers": 8, + "mempool_sub_workers": 2, + "block_addresses_to_keep": 600, + "additional_params": { + "address_aliases": true, + "mempoolTxTimeoutHours": 48, + "processInternalTransactions": true, + "queryBackendOnMempoolResync": false, + "fiat_rates": "coingecko", + "fiat_rates_vs_currencies": "AED,ARS,AUD,BDT,BHD,BMD,BRL,CAD,CHF,CLP,CNY,CZK,DKK,EUR,GBP,HKD,HUF,IDR,ILS,INR,JPY,KRW,KWD,LKR,MMK,MXN,MYR,NGN,NOK,NZD,PHP,PKR,PLN,RUB,SAR,SEK,SGD,THB,TRY,TWD,UAH,USD,VEF,VND,ZAR,BTC,ETH", + "fiat_rates_params": "{\"url\": \"https://api.coingecko.com/api/v3\", \"coin\": \"ethereum\",\"platformIdentifier\": \"ethereum\",\"platformVsCurrency\": \"eth\",\"periodSeconds\": 900}", + "fourByteSignatures": "https://www.4byte.directory/api/v1/signatures/" + } + } + }, + "meta": { + "package_maintainer": "IT", + "package_maintainer_email": "it@satoshilabs.com" + } +} diff --git a/docs/ports.md b/docs/ports.md index bbb1bac1..fe51bbb8 100644 --- a/docs/ports.md +++ b/docs/ports.md @@ -55,6 +55,10 @@ | Avalanche Archive | 9199 | 9099 | 8099 | 38399 p2p | | Optimism | 9300 | 9200 | 8200 | 38400 p2p, 8300 http, 8400 authrpc | | Optimism Archive | 9302 | 9202 | 8202 | 38402 p2p, 8302 http, 8402 authrpc | +| Arbitrum | 9305 | 9205 | 8205 | 38405 p2p, 8305 http | +| Arbitrum Archive | 9306 | 9206 | 8306 | 38406 p2p | +| Arbitrum Nova | 9307 | 9207 | 8207 | 38407 p2p, 8307 http | +| Arbitrum Nova Archive | 9308 | 9208 | 8308 | 38408 p2p | | Ethereum Testnet Holesky | 19116 | 19016 | 18016 | 18116 http, 18516 authrpc, 48316 p2p | | Bitcoin Signet | 19120 | 19020 | 18020 | 48320 | | Bitcoin Regtest | 19121 | 19021 | 18021 | 48321 | From 04a5d8d95dfb6375f083b33f845c73b688de60e2 Mon Sep 17 00:00:00 2001 From: grdddj Date: Tue, 15 Oct 2024 12:07:16 +0200 Subject: [PATCH 34/56] chore: add make style target for gofmt formatting --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 54475015..9c015504 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ PACKAGER = $(shell id -u):$(shell id -g) DOCKER_VERSION = $(shell docker version --format '{{.Client.Version}}') BASE_IMAGE = $$(awk -F= '$$1=="ID" { print $$2 ;}' /etc/os-release):$$(awk -F= '$$1=="VERSION_ID" { print $$2 ;}' /etc/os-release | tr -d '"') NO_CACHE = false -TCMALLOC = +TCMALLOC = PORTABLE = 0 ARGS ?= @@ -80,3 +80,6 @@ clean-bin-image: clean-deb-image: - docker rmi $(DEB_IMAGE) + +style: + find . -name "*.go" -exec gofmt -w {} \; From 66b4ddbe01d724f718e882e2387dabda190a7e44 Mon Sep 17 00:00:00 2001 From: grdddj Date: Tue, 15 Oct 2024 12:07:39 +0200 Subject: [PATCH 35/56] chore: apply make style gofmt formatting --- bchain/coins/ecash/ecashparser.go | 2 +- bchain/coins/firo/firoparser.go | 17 ++++++++--------- build/tools/trezor-common/sync-coins.go | 2 +- common/jsonnumber.go | 4 +++- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/bchain/coins/ecash/ecashparser.go b/bchain/coins/ecash/ecashparser.go index e4547ae8..2b4ef881 100644 --- a/bchain/coins/ecash/ecashparser.go +++ b/bchain/coins/ecash/ecashparser.go @@ -3,11 +3,11 @@ package ecash import ( "fmt" - "github.com/pirk/ecashutil" "github.com/martinboehm/btcutil" "github.com/martinboehm/btcutil/chaincfg" "github.com/martinboehm/btcutil/txscript" "github.com/pirk/ecashaddr-converter/address" + "github.com/pirk/ecashutil" "github.com/trezor/blockbook/bchain" "github.com/trezor/blockbook/bchain/coins/btc" ) diff --git a/bchain/coins/firo/firoparser.go b/bchain/coins/firo/firoparser.go index d2b9e1f0..cfdf9c4a 100644 --- a/bchain/coins/firo/firoparser.go +++ b/bchain/coins/firo/firoparser.go @@ -14,13 +14,13 @@ import ( ) const ( - OpZeroCoinMint = 0xc1 - OpZeroCoinSpend = 0xc2 - OpSigmaMint = 0xc3 - OpSigmaSpend = 0xc4 - OpLelantusMint = 0xc5 - OpLelantusJMint = 0xc6 - OpLelantusJoinSplit = 0xc7 + OpZeroCoinMint = 0xc1 + OpZeroCoinSpend = 0xc2 + OpSigmaMint = 0xc3 + OpSigmaSpend = 0xc4 + OpLelantusMint = 0xc5 + OpLelantusJMint = 0xc6 + OpLelantusJoinSplit = 0xc7 OpLelantusJoinSplitPayload = 0xc9 MainnetMagic wire.BitcoinNet = 0xe3d9fef1 @@ -194,7 +194,6 @@ func (p *FiroParser) ParseBlock(b []byte) (*bchain.Block, error) { break } } - if !isAllZero { // hash data @@ -344,7 +343,7 @@ type MTPHashDataRoot struct { } type MTPHashData struct { - BlockMTP [128][128]uint64 + BlockMTP [128][128]uint64 } type MTPBlockHeader struct { diff --git a/build/tools/trezor-common/sync-coins.go b/build/tools/trezor-common/sync-coins.go index f4e90ba1..acb5518e 100644 --- a/build/tools/trezor-common/sync-coins.go +++ b/build/tools/trezor-common/sync-coins.go @@ -1,4 +1,4 @@ -//usr/bin/go run $0 $@ ; exit +// usr/bin/go run $0 $@ ; exit package main import ( diff --git a/common/jsonnumber.go b/common/jsonnumber.go index d209fbe2..d6eab76c 100644 --- a/common/jsonnumber.go +++ b/common/jsonnumber.go @@ -6,7 +6,9 @@ import ( ) // JSONNumber is used instead of json.Number after upgrade to go 1.14 -// to handle data which can be numbers in double quotes or possibly not numbers at all +// +// to handle data which can be numbers in double quotes or possibly not numbers at all +// // see https://github.com/golang/go/issues/37308 type JSONNumber string From 4ba04f119b1294ed9508fabc13ca7988a6e828d3 Mon Sep 17 00:00:00 2001 From: gruve-p Date: Mon, 25 Nov 2024 21:37:55 +0100 Subject: [PATCH 36/56] Groestlcoin: Bump to 28.0 (#1139) --- configs/coins/groestlcoin.json | 10 +++++----- configs/coins/groestlcoin_regtest.json | 10 +++++----- configs/coins/groestlcoin_signet.json | 10 +++++----- configs/coins/groestlcoin_testnet.json | 10 +++++----- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/configs/coins/groestlcoin.json b/configs/coins/groestlcoin.json index c8ae6342..18b8f5cc 100644 --- a/configs/coins/groestlcoin.json +++ b/configs/coins/groestlcoin.json @@ -22,10 +22,10 @@ "package_name": "backend-groestlcoin", "package_revision": "satoshilabs-1", "system_user": "groestlcoin", - "version": "27.0", - "binary_url": "https://github.com/Groestlcoin/groestlcoin/releases/download/v27.0/groestlcoin-27.0-x86_64-linux-gnu.tar.gz", + "version": "28.0", + "binary_url": "https://github.com/Groestlcoin/groestlcoin/releases/download/v28.0/groestlcoin-28.0-x86_64-linux-gnu.tar.gz", "verification_type": "sha256", - "verification_source": "5189f036913e2033b5fe95ba8f3fc027e9c5bd286d2150e9133cd4a2fd69a7a0", + "verification_source": "540d5d7c6bb0449763567ea7c2559e124d61b82a6b2798701d5759458d9c21d7", "extract_command": "tar -C backend --strip 1 -xf", "exclude_files": ["bin/groestlcoin-qt"], "exec_command_template": "{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/bin/groestlcoind -datadir={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend -conf={{.Env.BackendInstallPath}}/{{.Coin.Alias}}/{{.Coin.Alias}}.conf -pid=/run/{{.Coin.Alias}}/{{.Coin.Alias}}.pid", @@ -42,8 +42,8 @@ }, "platforms": { "arm64": { - "binary_url": "https://github.com/Groestlcoin/groestlcoin/releases/download/v27.0/groestlcoin-27.0-aarch64-linux-gnu.tar.gz", - "verification_source": "95e1a4c4f4d50709df40e2d86c4b578db053d1cb475a3384862192c1298f9de6" + "binary_url": "https://github.com/Groestlcoin/groestlcoin/releases/download/v28.0/groestlcoin-28.0-aarch64-linux-gnu.tar.gz", + "verification_source": "092c6ff333a3defe2603b91c55aea6415e554a2bbc6abb3ad43ac712fa9b63b1" } } }, diff --git a/configs/coins/groestlcoin_regtest.json b/configs/coins/groestlcoin_regtest.json index 0a62a9bf..aaa4ba27 100644 --- a/configs/coins/groestlcoin_regtest.json +++ b/configs/coins/groestlcoin_regtest.json @@ -22,10 +22,10 @@ "package_name": "backend-groestlcoin-regtest", "package_revision": "satoshilabs-1", "system_user": "groestlcoin", - "version": "27.0", - "binary_url": "https://github.com/Groestlcoin/groestlcoin/releases/download/v27.0/groestlcoin-27.0-x86_64-linux-gnu.tar.gz", + "version": "28.0", + "binary_url": "https://github.com/Groestlcoin/groestlcoin/releases/download/v28.0/groestlcoin-28.0-x86_64-linux-gnu.tar.gz", "verification_type": "sha256", - "verification_source": "5189f036913e2033b5fe95ba8f3fc027e9c5bd286d2150e9133cd4a2fd69a7a0", + "verification_source": "540d5d7c6bb0449763567ea7c2559e124d61b82a6b2798701d5759458d9c21d7", "extract_command": "tar -C backend --strip 1 -xf", "exclude_files": ["bin/groestlcoin-qt"], "exec_command_template": "{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/bin/groestlcoind -datadir={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend -conf={{.Env.BackendInstallPath}}/{{.Coin.Alias}}/{{.Coin.Alias}}.conf -pid=/run/{{.Coin.Alias}}/{{.Coin.Alias}}.pid", @@ -42,8 +42,8 @@ }, "platforms": { "arm64": { - "binary_url": "https://github.com/Groestlcoin/groestlcoin/releases/download/v27.0/groestlcoin-27.0-aarch64-linux-gnu.tar.gz", - "verification_source": "95e1a4c4f4d50709df40e2d86c4b578db053d1cb475a3384862192c1298f9de6" + "binary_url": "https://github.com/Groestlcoin/groestlcoin/releases/download/v28.0/groestlcoin-28.0-aarch64-linux-gnu.tar.gz", + "verification_source": "092c6ff333a3defe2603b91c55aea6415e554a2bbc6abb3ad43ac712fa9b63b1" } } }, diff --git a/configs/coins/groestlcoin_signet.json b/configs/coins/groestlcoin_signet.json index 20a01996..53df59f7 100644 --- a/configs/coins/groestlcoin_signet.json +++ b/configs/coins/groestlcoin_signet.json @@ -22,10 +22,10 @@ "package_name": "backend-groestlcoin-signet", "package_revision": "satoshilabs-1", "system_user": "groestlcoin", - "version": "27.0", - "binary_url": "https://github.com/Groestlcoin/groestlcoin/releases/download/v27.0/groestlcoin-27.0-x86_64-linux-gnu.tar.gz", + "version": "28.0", + "binary_url": "https://github.com/Groestlcoin/groestlcoin/releases/download/v28.0/groestlcoin-28.0-x86_64-linux-gnu.tar.gz", "verification_type": "sha256", - "verification_source": "5189f036913e2033b5fe95ba8f3fc027e9c5bd286d2150e9133cd4a2fd69a7a0", + "verification_source": "540d5d7c6bb0449763567ea7c2559e124d61b82a6b2798701d5759458d9c21d7", "extract_command": "tar -C backend --strip 1 -xf", "exclude_files": ["bin/groestlcoin-qt"], "exec_command_template": "{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/bin/groestlcoind -datadir={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend -conf={{.Env.BackendInstallPath}}/{{.Coin.Alias}}/{{.Coin.Alias}}.conf -pid=/run/{{.Coin.Alias}}/{{.Coin.Alias}}.pid", @@ -42,8 +42,8 @@ }, "platforms": { "arm64": { - "binary_url": "https://github.com/Groestlcoin/groestlcoin/releases/download/v27.0/groestlcoin-27.0-aarch64-linux-gnu.tar.gz", - "verification_source": "95e1a4c4f4d50709df40e2d86c4b578db053d1cb475a3384862192c1298f9de6" + "binary_url": "https://github.com/Groestlcoin/groestlcoin/releases/download/v28.0/groestlcoin-28.0-aarch64-linux-gnu.tar.gz", + "verification_source": "092c6ff333a3defe2603b91c55aea6415e554a2bbc6abb3ad43ac712fa9b63b1" } } }, diff --git a/configs/coins/groestlcoin_testnet.json b/configs/coins/groestlcoin_testnet.json index 435fc1f3..7106edef 100644 --- a/configs/coins/groestlcoin_testnet.json +++ b/configs/coins/groestlcoin_testnet.json @@ -22,10 +22,10 @@ "package_name": "backend-groestlcoin-testnet", "package_revision": "satoshilabs-1", "system_user": "groestlcoin", - "version": "27.0", - "binary_url": "https://github.com/Groestlcoin/groestlcoin/releases/download/v27.0/groestlcoin-27.0-x86_64-linux-gnu.tar.gz", + "version": "28.0", + "binary_url": "https://github.com/Groestlcoin/groestlcoin/releases/download/v28.0/groestlcoin-28.0-x86_64-linux-gnu.tar.gz", "verification_type": "sha256", - "verification_source": "5189f036913e2033b5fe95ba8f3fc027e9c5bd286d2150e9133cd4a2fd69a7a0", + "verification_source": "540d5d7c6bb0449763567ea7c2559e124d61b82a6b2798701d5759458d9c21d7", "extract_command": "tar -C backend --strip 1 -xf", "exclude_files": ["bin/groestlcoin-qt"], "exec_command_template": "{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/bin/groestlcoind -datadir={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend -conf={{.Env.BackendInstallPath}}/{{.Coin.Alias}}/{{.Coin.Alias}}.conf -pid=/run/{{.Coin.Alias}}/{{.Coin.Alias}}.pid", @@ -42,8 +42,8 @@ }, "platforms": { "arm64": { - "binary_url": "https://github.com/Groestlcoin/groestlcoin/releases/download/v27.0/groestlcoin-27.0-aarch64-linux-gnu.tar.gz", - "verification_source": "95e1a4c4f4d50709df40e2d86c4b578db053d1cb475a3384862192c1298f9de6" + "binary_url": "https://github.com/Groestlcoin/groestlcoin/releases/download/v28.0/groestlcoin-28.0-aarch64-linux-gnu.tar.gz", + "verification_source": "092c6ff333a3defe2603b91c55aea6415e554a2bbc6abb3ad43ac712fa9b63b1" } } }, From 6eb3ba220181f504cada096c9220eeb24bca7a00 Mon Sep 17 00:00:00 2001 From: CodeFace Date: Mon, 4 Nov 2024 11:47:46 +0800 Subject: [PATCH 37/56] bump Qtum 27.1 --- configs/coins/qtum.json | 6 +++--- configs/coins/qtum_testnet.json | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/configs/coins/qtum.json b/configs/coins/qtum.json index 5bfbae99..7699106a 100644 --- a/configs/coins/qtum.json +++ b/configs/coins/qtum.json @@ -22,10 +22,10 @@ "package_name": "backend-qtum", "package_revision": "satoshilabs-1", "system_user": "qtum", - "version": "24.1", - "binary_url": "https://github.com/qtumproject/qtum/releases/download/v24.1/qtum-24.1-x86_64-linux-gnu.tar.gz", + "version": "27.1", + "binary_url": "https://github.com/qtumproject/qtum/releases/download/v27.1/qtum-27.1-x86_64-linux-gnu.tar.gz", "verification_type": "sha256", - "verification_source": "13f7ca5c352732772e924bd07db0e8327e0a850edd9c89e7d191e0734990621c", + "verification_source": "0b1f612f0762184240c785c66b548f2dab8eed5e25481c635806ddf81807aa86", "extract_command": "tar -C backend --strip 1 -xf", "exclude_files": [ "bin/qtum-qt" diff --git a/configs/coins/qtum_testnet.json b/configs/coins/qtum_testnet.json index 1ceeef11..ed1218de 100644 --- a/configs/coins/qtum_testnet.json +++ b/configs/coins/qtum_testnet.json @@ -22,10 +22,10 @@ "package_name": "backend-qtum-testnet", "package_revision": "satoshilabs-1", "system_user": "qtum", - "version": "24.1", - "binary_url": "https://github.com/qtumproject/qtum/releases/download/v24.1/qtum-24.1-x86_64-linux-gnu.tar.gz", + "version": "27.1", + "binary_url": "https://github.com/qtumproject/qtum/releases/download/v27.1/qtum-27.1-x86_64-linux-gnu.tar.gz", "verification_type": "sha256", - "verification_source": "13f7ca5c352732772e924bd07db0e8327e0a850edd9c89e7d191e0734990621c", + "verification_source": "0b1f612f0762184240c785c66b548f2dab8eed5e25481c635806ddf81807aa86", "extract_command": "tar -C backend --strip 1 -xf", "exclude_files": [ "bin/qtum-qt" From 1fe4ee04f3dfda534c57ceeb5d8e02cacc5d786f Mon Sep 17 00:00:00 2001 From: Martin Boehm Date: Wed, 4 Sep 2024 13:36:30 +0200 Subject: [PATCH 38/56] Migration from MATIC to POL --- configs/coins/polygon.json | 4 ++-- configs/coins/polygon_archive.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/configs/coins/polygon.json b/configs/coins/polygon.json index 39ab85aa..3a71d101 100644 --- a/configs/coins/polygon.json +++ b/configs/coins/polygon.json @@ -1,8 +1,8 @@ { "coin": { "name": "Polygon", - "shortcut": "MATIC", - "network": "MATIC", + "shortcut": "POL", + "network": "POL", "label": "Polygon", "alias": "polygon_bor" }, diff --git a/configs/coins/polygon_archive.json b/configs/coins/polygon_archive.json index 6c26246d..817d22bf 100644 --- a/configs/coins/polygon_archive.json +++ b/configs/coins/polygon_archive.json @@ -1,8 +1,8 @@ { "coin": { "name": "Polygon Archive", - "shortcut": "MATIC", - "network": "MATIC", + "shortcut": "POL", + "network": "POL", "label": "Polygon", "alias": "polygon_archive_bor" }, From 19a902360ed93e5c2f7faa86577c64414448ecf7 Mon Sep 17 00:00:00 2001 From: Martin Boehm Date: Mon, 25 Nov 2024 09:25:26 +0100 Subject: [PATCH 39/56] EthereumType: Remove fetching of contract details from sync --- api/worker.go | 33 ++++++++++++++++++++++++++------- bchain/coins/eth/ethrpc.go | 14 ++++++++------ bchain/types.go | 3 ++- 3 files changed, 36 insertions(+), 14 deletions(-) diff --git a/api/worker.go b/api/worker.go index 799c90e8..6954c99b 100644 --- a/api/worker.go +++ b/api/worker.go @@ -172,9 +172,18 @@ func (w *Worker) getAddressAliases(addresses map[string]struct{}) AddressAliases } for a := range addresses { if w.chainType == bchain.ChainEthereumType { - ci, err := w.db.GetContractInfoForAddress(a) - if err == nil && ci != nil && ci.Name != "" { - aliases[a] = AddressAlias{Type: "Contract", Alias: ci.Name} + addrDesc, err := w.chainParser.GetAddrDescFromAddress(a) + if err != nil || addrDesc == nil { + continue + } + ci, err := w.db.GetContractInfo(addrDesc, bchain.UnknownTokenType) + if err == nil && ci != nil { + if ci.Type == bchain.UnhandledTokenType { + ci, _, err = w.getContractDescriptorInfo(addrDesc, bchain.UnknownTokenType) + } + if err == nil && ci != nil && ci.Name != "" { + aliases[a] = AddressAlias{Type: "Contract", Alias: ci.Name} + } } } n := w.db.GetAddressAlias(a) @@ -608,7 +617,7 @@ func (w *Worker) GetTransactionFromMempoolTx(mempoolTx *bchain.MempoolTx) (*Tx, return r, nil } -func (w *Worker) getContractInfo(contract string, typeFromContext bchain.TokenTypeName) (*bchain.ContractInfo, bool, error) { +func (w *Worker) GetContractInfo(contract string, typeFromContext bchain.TokenTypeName) (*bchain.ContractInfo, bool, error) { cd, err := w.chainParser.GetAddrDescFromAddress(contract) if err != nil { return nil, false, err @@ -648,7 +657,7 @@ func (w *Worker) getContractDescriptorInfo(cd bchain.AddressDescriptor, typeFrom glog.Errorf("StoreContractInfo error %v, contract %v", err, cd) } } - } else if (len(contractInfo.Name) > 0 && contractInfo.Name[0] == 0) || (len(contractInfo.Symbol) > 0 && contractInfo.Symbol[0] == 0) { + } else if (contractInfo.Type == bchain.UnhandledTokenType || len(contractInfo.Name) > 0 && contractInfo.Name[0] == 0) || (len(contractInfo.Symbol) > 0 && contractInfo.Symbol[0] == 0) { // fix contract name/symbol that was parsed as a string consisting of zeroes blockchainContractInfo, err := w.chain.GetContractInfo(cd) if err != nil { @@ -667,6 +676,10 @@ func (w *Worker) getContractDescriptorInfo(cd bchain.AddressDescriptor, typeFrom if blockchainContractInfo != nil { contractInfo.Decimals = blockchainContractInfo.Decimals } + if contractInfo.Type == bchain.UnhandledTokenType { + glog.Infof("Contract %v %v [%s] handled", cd, typeFromContext, contractInfo.Name) + contractInfo.Type = typeFromContext + } if err = w.db.StoreContractInfo(contractInfo); err != nil { glog.Errorf("StoreContractInfo error %v, contract %v", err, cd) } @@ -687,7 +700,7 @@ func (w *Worker) getEthereumTokensTransfers(transfers bchain.TokenTransfers, add if info, ok := contractCache[t.Contract]; ok { contractInfo = info } else { - info, _, err := w.getContractInfo(t.Contract, typeName) + info, _, err := w.GetContractInfo(t.Contract, typeName) if err != nil { glog.Errorf("getContractInfo error %v, contract %v", err, t.Contract) continue @@ -1124,10 +1137,16 @@ func (w *Worker) getEthereumTypeAddressBalances(addrDesc bchain.AddressDescripto d.tokens = d.tokens[:j] sort.Sort(d.tokens) } - d.contractInfo, err = w.db.GetContractInfo(addrDesc, "") + d.contractInfo, err = w.db.GetContractInfo(addrDesc, bchain.UnknownTokenType) if err != nil { return nil, nil, err } + if d.contractInfo != nil && d.contractInfo.Type == bchain.UnhandledTokenType { + d.contractInfo, _, err = w.getContractDescriptorInfo(addrDesc, bchain.UnknownTokenType) + if err != nil { + return nil, nil, err + } + } if filter.FromHeight == 0 && filter.ToHeight == 0 { // compute total results for paging if filter.Vout == AddressFilterVoutOff { diff --git a/bchain/coins/eth/ethrpc.go b/bchain/coins/eth/ethrpc.go index b9eb843e..c2c5b111 100644 --- a/bchain/coins/eth/ethrpc.go +++ b/bchain/coins/eth/ethrpc.go @@ -610,13 +610,15 @@ type rpcTraceResult struct { } func (b *EthereumRPC) getCreationContractInfo(contract string, height uint32) *bchain.ContractInfo { - ci, err := b.fetchContractInfo(contract) - if ci == nil || err != nil { - ci = &bchain.ContractInfo{ - Contract: contract, - } + // do not fetch fetchContractInfo in sync, it slows it down + // the contract will be fetched only when asked by a client + // ci, err := b.fetchContractInfo(contract) + // if ci == nil || err != nil { + ci := &bchain.ContractInfo{ + Contract: contract, } - ci.Type = bchain.UnknownTokenType + // } + ci.Type = bchain.UnhandledTokenType ci.CreatedInBlock = height return ci } diff --git a/bchain/types.go b/bchain/types.go index 3fd2dcfe..b33a5834 100644 --- a/bchain/types.go +++ b/bchain/types.go @@ -131,7 +131,8 @@ type TokenTypeName string // Token types const ( - UnknownTokenType TokenTypeName = "" + UnknownTokenType TokenTypeName = "" + UnhandledTokenType TokenTypeName = "-" // XPUBAddressTokenType is address derived from xpub XPUBAddressTokenType TokenTypeName = "XPUBAddress" From a55c69a8a1a52cb2da2c1d870a30bf5d1639feba Mon Sep 17 00:00:00 2001 From: Martin Boehm Date: Mon, 25 Nov 2024 10:30:44 +0100 Subject: [PATCH 40/56] EthereumType: admin interface to read and update contract info --- server/html_templates.go | 60 +++++++++++++++++++ server/internal.go | 63 +++++++++++++++++++- server/public.go | 57 ------------------ static/internal_templates/contract_info.html | 39 ++++++++++++ static/internal_templates/index.html | 10 +++- 5 files changed, 166 insertions(+), 63 deletions(-) create mode 100644 static/internal_templates/contract_info.html diff --git a/server/html_templates.go b/server/html_templates.go index a06ff0e6..470134c1 100644 --- a/server/html_templates.go +++ b/server/html_templates.go @@ -35,6 +35,66 @@ type htmlTemplates[TD any] struct { postHtmlTemplateHandler func(data *TD, w http.ResponseWriter, r *http.Request) } +func (s *htmlTemplates[TD]) jsonHandler(handler func(r *http.Request, apiVersion int) (interface{}, error), apiVersion int) func(w http.ResponseWriter, r *http.Request) { + type jsonError struct { + Text string `json:"error"` + HTTPStatus int `json:"-"` + } + handlerName := getFunctionName(handler) + return func(w http.ResponseWriter, r *http.Request) { + var data interface{} + var err error + defer func() { + if e := recover(); e != nil { + glog.Error(handlerName, " recovered from panic: ", e) + debug.PrintStack() + if s.debug { + data = jsonError{fmt.Sprint("Internal server error: recovered from panic ", e), http.StatusInternalServerError} + } else { + data = jsonError{"Internal server error", http.StatusInternalServerError} + } + } + w.Header().Set("Content-Type", "application/json; charset=utf-8") + if e, isError := data.(jsonError); isError { + w.WriteHeader(e.HTTPStatus) + } + err = json.NewEncoder(w).Encode(data) + if err != nil { + glog.Warning("json encode ", err) + } + if s.metrics != nil { + s.metrics.ExplorerPendingRequests.With((common.Labels{"method": handlerName})).Dec() + } + }() + if s.metrics != nil { + s.metrics.ExplorerPendingRequests.With((common.Labels{"method": handlerName})).Inc() + } + data, err = handler(r, apiVersion) + if err != nil || data == nil { + if apiErr, ok := err.(*api.APIError); ok { + if apiErr.Public { + data = jsonError{apiErr.Error(), http.StatusBadRequest} + } else { + data = jsonError{apiErr.Error(), http.StatusInternalServerError} + } + } else { + if err != nil { + glog.Error(handlerName, " error: ", err) + } + if s.debug { + if data != nil { + data = jsonError{fmt.Sprintf("Internal server error: %v, data %+v", err, data), http.StatusInternalServerError} + } else { + data = jsonError{fmt.Sprintf("Internal server error: %v", err), http.StatusInternalServerError} + } + } else { + data = jsonError{"Internal server error", http.StatusInternalServerError} + } + } + } + } +} + func (s *htmlTemplates[TD]) htmlTemplateHandler(handler func(w http.ResponseWriter, r *http.Request) (tpl, *TD, error)) func(w http.ResponseWriter, r *http.Request) { handlerName := getFunctionName(handler) return func(w http.ResponseWriter, r *http.Request) { diff --git a/server/internal.go b/server/internal.go index 3560f0fa..2544c05b 100644 --- a/server/internal.go +++ b/server/internal.go @@ -5,11 +5,15 @@ import ( "encoding/json" "fmt" "html/template" + "io" "net/http" "path/filepath" "sort" + "strconv" + "strings" "github.com/golang/glog" + "github.com/juju/errors" "github.com/prometheus/client_golang/prometheus/promhttp" "github.com/trezor/blockbook/api" "github.com/trezor/blockbook/bchain" @@ -72,6 +76,8 @@ func NewInternalServer(binding, certFiles string, db *db.RocksDB, chain bchain.B serveMux.HandleFunc(path+"admin/ws-limit-exceeding-ips", s.htmlTemplateHandler(s.wsLimitExceedingIPs)) if s.chainParser.GetChainType() == bchain.ChainEthereumType { serveMux.HandleFunc(path+"admin/internal-data-errors", s.htmlTemplateHandler(s.internalDataErrors)) + serveMux.HandleFunc(path+"admin/contract-info", s.htmlTemplateHandler(s.contractInfoPage)) + serveMux.HandleFunc(path+"admin/contract-info/", s.jsonHandler(s.apiContractInfo, 0)) } return s, nil } @@ -118,7 +124,8 @@ func (s *InternalServer) index(w http.ResponseWriter, r *http.Request) { const ( adminIndexTpl = iota + errorInternalTpl + 1 adminInternalErrorsTpl - adminLimitExceedingIPS + adminLimitExceedingIPSTpl + adminContractInfoTpl internalTplCount ) @@ -173,7 +180,8 @@ func (s *InternalServer) parseTemplates() []*template.Template { t[errorInternalTpl] = createTemplate("./static/internal_templates/error.html", "./static/internal_templates/base.html") t[adminIndexTpl] = createTemplate("./static/internal_templates/index.html", "./static/internal_templates/base.html") t[adminInternalErrorsTpl] = createTemplate("./static/internal_templates/block_internal_data_errors.html", "./static/internal_templates/base.html") - t[adminLimitExceedingIPS] = createTemplate("./static/internal_templates/ws_limit_exceeding_ips.html", "./static/internal_templates/base.html") + t[adminLimitExceedingIPSTpl] = createTemplate("./static/internal_templates/ws_limit_exceeding_ips.html", "./static/internal_templates/base.html") + t[adminContractInfoTpl] = createTemplate("./static/internal_templates/contract_info.html", "./static/internal_templates/base.html") return t } @@ -213,5 +221,54 @@ func (s *InternalServer) wsLimitExceedingIPs(w http.ResponseWriter, r *http.Requ }) data.WsLimitExceedingIPs = ips data.WsGetAccountInfoLimit = s.is.WsGetAccountInfoLimit - return adminLimitExceedingIPS, data, nil + return adminLimitExceedingIPSTpl, data, nil +} + +func (s *InternalServer) contractInfoPage(w http.ResponseWriter, r *http.Request) (tpl, *InternalTemplateData, error) { + data := s.newTemplateData(r) + return adminContractInfoTpl, data, nil +} + +func (s *InternalServer) apiContractInfo(r *http.Request, apiVersion int) (interface{}, error) { + if r.Method == http.MethodPost { + return s.updateContracts(r) + } + var contractAddress string + i := strings.LastIndexByte(r.URL.Path, '/') + if i > 0 { + contractAddress = r.URL.Path[i+1:] + } + if len(contractAddress) == 0 { + return nil, api.NewAPIError("Missing contract address", true) + } + + contractInfo, valid, err := s.api.GetContractInfo(contractAddress, bchain.UnknownTokenType) + if err != nil { + return nil, api.NewAPIError(err.Error(), true) + } + if !valid { + return nil, api.NewAPIError("Not a contract", true) + } + return contractInfo, nil +} + +func (s *InternalServer) updateContracts(r *http.Request) (interface{}, error) { + data, err := io.ReadAll(r.Body) + if err != nil { + return nil, api.NewAPIError("Cannot get request body", true) + } + var contractInfos []bchain.ContractInfo + err = json.Unmarshal(data, &contractInfos) + if err != nil { + return nil, errors.Annotatef(err, "Cannot unmarshal body to array of ContractInfo objects") + } + for i := range contractInfos { + c := &contractInfos[i] + err := s.db.StoreContractInfo(c) + if err != nil { + return nil, api.NewAPIError("Error updating contract "+c.Contract+" "+err.Error(), true) + } + + } + return "{\"success\":\"Updated " + strconv.Itoa(len(contractInfos)) + " contracts\"}", nil } diff --git a/server/public.go b/server/public.go index d21da713..05e8f477 100644 --- a/server/public.go +++ b/server/public.go @@ -14,7 +14,6 @@ import ( "reflect" "regexp" "runtime" - "runtime/debug" "sort" "strconv" "strings" @@ -289,62 +288,6 @@ func getFunctionName(i interface{}) string { return name } -func (s *PublicServer) jsonHandler(handler func(r *http.Request, apiVersion int) (interface{}, error), apiVersion int) func(w http.ResponseWriter, r *http.Request) { - type jsonError struct { - Text string `json:"error"` - HTTPStatus int `json:"-"` - } - handlerName := getFunctionName(handler) - return func(w http.ResponseWriter, r *http.Request) { - var data interface{} - var err error - defer func() { - if e := recover(); e != nil { - glog.Error(handlerName, " recovered from panic: ", e) - debug.PrintStack() - if s.debug { - data = jsonError{fmt.Sprint("Internal server error: recovered from panic ", e), http.StatusInternalServerError} - } else { - data = jsonError{"Internal server error", http.StatusInternalServerError} - } - } - w.Header().Set("Content-Type", "application/json; charset=utf-8") - if e, isError := data.(jsonError); isError { - w.WriteHeader(e.HTTPStatus) - } - err = json.NewEncoder(w).Encode(data) - if err != nil { - glog.Warning("json encode ", err) - } - s.metrics.ExplorerPendingRequests.With((common.Labels{"method": handlerName})).Dec() - }() - s.metrics.ExplorerPendingRequests.With((common.Labels{"method": handlerName})).Inc() - data, err = handler(r, apiVersion) - if err != nil || data == nil { - if apiErr, ok := err.(*api.APIError); ok { - if apiErr.Public { - data = jsonError{apiErr.Error(), http.StatusBadRequest} - } else { - data = jsonError{apiErr.Error(), http.StatusInternalServerError} - } - } else { - if err != nil { - glog.Error(handlerName, " error: ", err) - } - if s.debug { - if data != nil { - data = jsonError{fmt.Sprintf("Internal server error: %v, data %+v", err, data), http.StatusInternalServerError} - } else { - data = jsonError{fmt.Sprintf("Internal server error: %v", err), http.StatusInternalServerError} - } - } else { - data = jsonError{"Internal server error", http.StatusInternalServerError} - } - } - } - } -} - func (s *PublicServer) newTemplateData(r *http.Request) *TemplateData { t := &TemplateData{ CoinName: s.is.Coin, diff --git a/static/internal_templates/contract_info.html b/static/internal_templates/contract_info.html new file mode 100644 index 00000000..57cbfece --- /dev/null +++ b/static/internal_templates/contract_info.html @@ -0,0 +1,39 @@ +{{define "specific"}} {{if eq .ChainType 1}} + +
+
+
+ +
+
+ +
+
+
+
+ To update contract, use POST request to /admin/contract-info/ endpoint. Example: +
+
+            curl -k -v  \
+            'https://<internaladdress>/admin/contract-info/' \
+            -H 'Content-Type: application/json' \
+            --data '[{ContractInfo},{ContractInfo},...]'        
+        
+
+
+{{else}} Not supported {{end}}{{end}} diff --git a/static/internal_templates/index.html b/static/internal_templates/index.html index 5fef7011..7a94bce8 100644 --- a/static/internal_templates/index.html +++ b/static/internal_templates/index.html @@ -1,10 +1,14 @@ {{define "specific"}} {{if eq .ChainType 1}} -{{end}} -{{end}} \ No newline at end of file + +{{end}}{{end}} From 46156d296f02796ace474f25a65ad15aac29d219 Mon Sep 17 00:00:00 2001 From: Martin Boehm Date: Sat, 7 Dec 2024 14:07:39 +0100 Subject: [PATCH 41/56] Fix refetch internal data --- api/ethereumtype.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/ethereumtype.go b/api/ethereumtype.go index b4aa9446..1f98f2ee 100644 --- a/api/ethereumtype.go +++ b/api/ethereumtype.go @@ -62,7 +62,7 @@ func (w *Worker) RefetchInternalDataRoutine() { if block != nil { blockSpecificData, _ = block.CoinSpecificData.(*bchain.EthereumBlockSpecificData) } - if err != nil || block == nil || blockSpecificData == nil || blockSpecificData.InternalDataError != "" { + if err != nil || block == nil || (blockSpecificData != nil && blockSpecificData.InternalDataError != "") { glog.Errorf("Refetching internal data for %d %s, error %v, retrying", ie.Height, ie.Hash, err) // try for second time to fetch the data - the 2nd attempt after the first unsuccessful has many times higher probability of success // probably something to do with data preloaded to cache on the backend From e283ac8915f001f3e32d725ea78c989be55c9bc2 Mon Sep 17 00:00:00 2001 From: JoHnY Date: Thu, 5 Dec 2024 15:59:08 +0000 Subject: [PATCH 42/56] =?UTF-8?q?doge=20(+testnet)=201.14.7=20=E2=86=92=20?= =?UTF-8?q?1.14.9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- configs/coins/dogecoin.json | 10 +++++----- configs/coins/dogecoin_testnet.json | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/configs/coins/dogecoin.json b/configs/coins/dogecoin.json index 4f3d4d59..f1200432 100644 --- a/configs/coins/dogecoin.json +++ b/configs/coins/dogecoin.json @@ -22,10 +22,10 @@ "package_name": "backend-dogecoin", "package_revision": "satoshilabs-1", "system_user": "dogecoin", - "version": "1.14.7", - "binary_url": "https://github.com/dogecoin/dogecoin/releases/download/v1.14.7/dogecoin-1.14.7-x86_64-linux-gnu.tar.gz", + "version": "1.14.9", + "binary_url": "https://github.com/dogecoin/dogecoin/releases/download/v1.14.9/dogecoin-1.14.9-x86_64-linux-gnu.tar.gz", "verification_type": "sha256", - "verification_source": "9cd22fb3ebba4d407c2947f4241b9e78c759f29cdf32de8863aea6aeed21cf8b", + "verification_source": "4f227117b411a7c98622c970986e27bcfc3f547a72bef65e7d9e82989175d4f8", "extract_command": "tar -C backend --strip 1 -xf", "exclude_files": ["bin/dogecoin-qt"], "exec_command_template": "{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/bin/dogecoind -datadir={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend -conf={{.Env.BackendInstallPath}}/{{.Coin.Alias}}/{{.Coin.Alias}}.conf -pid=/run/{{.Coin.Alias}}/{{.Coin.Alias}}.pid", @@ -45,8 +45,8 @@ }, "platforms": { "arm64": { - "binary_url": "https://github.com/dogecoin/dogecoin/releases/download/v1.14.7/dogecoin-1.14.7-aarch64-linux-gnu.tar.gz", - "verification_source": "b8fb8050b19283d1ab3c261aaca96d84f2a17f93b52fcff9e252f390b0564f31", + "binary_url": "https://github.com/dogecoin/dogecoin/releases/download/v1.14.9/dogecoin-1.14.9-aarch64-linux-gnu.tar.gz", + "verification_source": "6928c895a20d0bcb6d5c7dcec753d35c884a471aaf8ad4242a89a96acb4f2985", "exclude_files": [] } } diff --git a/configs/coins/dogecoin_testnet.json b/configs/coins/dogecoin_testnet.json index d16ab587..8103ba70 100644 --- a/configs/coins/dogecoin_testnet.json +++ b/configs/coins/dogecoin_testnet.json @@ -22,10 +22,10 @@ "package_name": "backend-dogecoin-testnet", "package_revision": "satoshilabs-1", "system_user": "dogecoin", - "version": "1.14.7", - "binary_url": "https://github.com/dogecoin/dogecoin/releases/download/v1.14.7/dogecoin-1.14.7-x86_64-linux-gnu.tar.gz", + "version": "1.14.9", + "binary_url": "https://github.com/dogecoin/dogecoin/releases/download/v1.14.9/dogecoin-1.14.9-x86_64-linux-gnu.tar.gz", "verification_type": "sha256", - "verification_source": "9cd22fb3ebba4d407c2947f4241b9e78c759f29cdf32de8863aea6aeed21cf8b", + "verification_source": "4f227117b411a7c98622c970986e27bcfc3f547a72bef65e7d9e82989175d4f8", "extract_command": "tar -C backend --strip 1 -xf", "exclude_files": [ "bin/dogecoin-qt" @@ -47,8 +47,8 @@ }, "platforms": { "arm64": { - "binary_url": "https://github.com/dogecoin/dogecoin/releases/download/v1.14.7/dogecoin-1.14.7-aarch64-linux-gnu.tar.gz", - "verification_source": "b8fb8050b19283d1ab3c261aaca96d84f2a17f93b52fcff9e252f390b0564f31", + "binary_url": "https://github.com/dogecoin/dogecoin/releases/download/v1.14.9/dogecoin-1.14.9-aarch64-linux-gnu.tar.gz", + "verification_source": "6928c895a20d0bcb6d5c7dcec753d35c884a471aaf8ad4242a89a96acb4f2985", "exclude_files": [] } } From a4f173036490ee722367f90725ec3b07fb203607 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Musil?= Date: Mon, 9 Dec 2024 11:30:02 +0100 Subject: [PATCH 43/56] Show raw tx hex in UI (#1162) * Fix Network configuration parameter * feat: allow for showing raw transaction hex for ETH transactions * chore: remove comments from JS code to avoid parsing issues in tests * temp: comment out failing tx template tests * chore: trim text from copyable before writing it to clipboard * chore: improve the design of Transaction hex * chore: add wrap to element showing raw hex data * fixup! chore: add wrap to element showing raw hex data * chore: remove redundant style, make HTML prettier * Revert "temp: comment out failing tx template tests" This reverts commit f104ebbf5111583b46996d7527a26c08cd9e29b6. * chore: put rawTx javascript functionality into main.js * chore: modify the expected HTML for changed tx template * feat: support the raw transaction hex also for BTC-like coins * chore: add on-hover effect for active button - make the background white * Minify javascript and styles --------- Co-authored-by: Martin Boehm --- api/worker.go | 5 + bchain/basechain.go | 4 + bchain/coins/blockchain.go | 5 + bchain/coins/eth/ethrpc.go | 24 +++- bchain/coins/eth/stakingpool.go | 4 +- bchain/types.go | 1 + blockbook.go | 2 +- configs/coins/arbitrum.json | 125 ++++++++++---------- configs/coins/arbitrum_archive.json | 129 +++++++++++---------- configs/coins/bsc.json | 2 +- configs/coins/bsc_archive.json | 2 +- fiat/coingecko.go | 4 +- server/public.go | 16 ++- server/public_ethereumtype_test.go | 8 +- server/public_test.go | 32 ++--- server/websocket.go | 2 +- static/css/main.css | 6 +- static/css/main.min.3.css | 1 - static/css/main.min.4.css | 1 + static/js/main.js | 76 +++++++++++- static/js/main.min.3.js | 1 - static/js/main.min.4.js | 1 + static/templates/tx.html | 18 ++- tests/dbtestdata/fakechain_ethereumtype.go | 5 + 24 files changed, 305 insertions(+), 169 deletions(-) delete mode 100644 static/css/main.min.3.css create mode 100644 static/css/main.min.4.css delete mode 100644 static/js/main.min.3.js create mode 100644 static/js/main.min.4.js diff --git a/api/worker.go b/api/worker.go index 6954c99b..d478f85c 100644 --- a/api/worker.go +++ b/api/worker.go @@ -207,6 +207,11 @@ func (w *Worker) GetTransaction(txid string, spendingTxs bool, specificJSON bool return tx, nil } +// GetRawTransaction gets raw transaction data in hex format from txid +func (w *Worker) GetRawTransaction(txid string) (string, error) { + return w.chain.EthereumTypeGetRawTransaction(txid) +} + // getTransaction reads transaction data from txid func (w *Worker) getTransaction(txid string, spendingTxs bool, specificJSON bool, addresses map[string]struct{}) (*Tx, error) { bchainTx, height, err := w.txCache.GetTransaction(txid) diff --git a/bchain/basechain.go b/bchain/basechain.go index c84f907f..e6da4281 100644 --- a/bchain/basechain.go +++ b/bchain/basechain.go @@ -81,3 +81,7 @@ func (b *BaseChain) EthereumTypeGetStakingPoolsData(addrDesc AddressDescriptor) func (b *BaseChain) EthereumTypeRpcCall(data, to, from string) (string, error) { return "", errors.New("not supported") } + +func (b *BaseChain) EthereumTypeGetRawTransaction(txid string) (string, error) { + return "", errors.New("not supported") +} diff --git a/bchain/coins/blockchain.go b/bchain/coins/blockchain.go index f3dac986..77e7206a 100644 --- a/bchain/coins/blockchain.go +++ b/bchain/coins/blockchain.go @@ -354,6 +354,11 @@ func (c *blockChainWithMetrics) EthereumTypeRpcCall(data, to, from string) (v st return c.b.EthereumTypeRpcCall(data, to, from) } +func (c *blockChainWithMetrics) EthereumTypeGetRawTransaction(txid string) (v string, err error) { + defer func(s time.Time) { c.observeRPCLatency("EthereumTypeGetRawTransaction", s, err) }(time.Now()) + return c.b.EthereumTypeGetRawTransaction(txid) +} + type mempoolWithMetrics struct { mempool bchain.Mempool m *common.Metrics diff --git a/bchain/coins/eth/ethrpc.go b/bchain/coins/eth/ethrpc.go index c2c5b111..1412b0e7 100644 --- a/bchain/coins/eth/ethrpc.go +++ b/bchain/coins/eth/ethrpc.go @@ -40,6 +40,7 @@ const ( type Configuration struct { CoinName string `json:"coin_name"` CoinShortcut string `json:"coin_shortcut"` + Network string `json:"network"` RPCURL string `json:"rpc_url"` RPCTimeout int `json:"rpc_timeout"` BlockAddressesToKeep int `json:"block_addresses_to_keep"` @@ -159,7 +160,12 @@ func (b *EthereumRPC) Initialize() error { return errors.Errorf("Unknown network id %v", id) } - err = b.initStakingPools(b.ChainConfig.CoinShortcut) + networkConfig := b.ChainConfig.Network + if networkConfig == "" { + networkConfig = b.ChainConfig.CoinShortcut + } + + err = b.initStakingPools(networkConfig) if err != nil { return err } @@ -988,21 +994,31 @@ func (b *EthereumRPC) EthereumTypeEstimateGas(params map[string]interface{}) (ui // SendRawTransaction sends raw transaction func (b *EthereumRPC) SendRawTransaction(hex string) (string, error) { + return b.callRpcStringResult("eth_sendRawTransaction", hex) +} + +// EthereumTypeGetRawTransaction gets raw transaction in hex format +func (b *EthereumRPC) EthereumTypeGetRawTransaction(txid string) (string, error) { + return b.callRpcStringResult("eth_getRawTransactionByHash", txid) +} + +// Helper function for calling ETH RPC with parameters and getting string result +func (b *EthereumRPC) callRpcStringResult(rpcMethod string, args ...interface{}) (string, error) { ctx, cancel := context.WithTimeout(context.Background(), b.Timeout) defer cancel() var raw json.RawMessage - err := b.RPC.CallContext(ctx, &raw, "eth_sendRawTransaction", hex) + err := b.RPC.CallContext(ctx, &raw, rpcMethod, args...) if err != nil { return "", err } else if len(raw) == 0 { - return "", errors.New("SendRawTransaction: failed") + return "", errors.New(rpcMethod + " : failed") } var result string if err := json.Unmarshal(raw, &result); err != nil { return "", errors.Annotatef(err, "raw result %v", raw) } if result == "" { - return "", errors.New("SendRawTransaction: failed, empty result") + return "", errors.New(rpcMethod + " : failed, empty result") } return result, nil } diff --git a/bchain/coins/eth/stakingpool.go b/bchain/coins/eth/stakingpool.go index 8b7cf7b8..f773dae9 100644 --- a/bchain/coins/eth/stakingpool.go +++ b/bchain/coins/eth/stakingpool.go @@ -11,9 +11,9 @@ import ( "github.com/trezor/blockbook/bchain" ) -func (b *EthereumRPC) initStakingPools(coinShortcut string) error { +func (b *EthereumRPC) initStakingPools(network string) error { // for now only single staking pool - envVar := strings.ToUpper(coinShortcut) + "_STAKING_POOL_CONTRACT" + envVar := strings.ToUpper(network) + "_STAKING_POOL_CONTRACT" envValue := os.Getenv(envVar) if envValue != "" { parts := strings.Split(envValue, "/") diff --git a/bchain/types.go b/bchain/types.go index b33a5834..8f1c2543 100644 --- a/bchain/types.go +++ b/bchain/types.go @@ -337,6 +337,7 @@ type BlockChain interface { EthereumTypeGetSupportedStakingPools() []string EthereumTypeGetStakingPoolsData(addrDesc AddressDescriptor) ([]StakingPoolData, error) EthereumTypeRpcCall(data, to, from string) (string, error) + EthereumTypeGetRawTransaction(txid string) (string, error) GetTokenURI(contractDesc AddressDescriptor, tokenID *big.Int) (string, error) } diff --git a/blockbook.go b/blockbook.go index a0065ec6..6675aec3 100644 --- a/blockbook.go +++ b/blockbook.go @@ -507,7 +507,7 @@ func newInternalState(config *common.Config, d *db.RocksDB, enableSubNewTx bool) is.Host = name } - is.WsGetAccountInfoLimit, _ = strconv.Atoi(os.Getenv(strings.ToUpper(is.CoinShortcut) + "_WS_GETACCOUNTINFO_LIMIT")) + is.WsGetAccountInfoLimit, _ = strconv.Atoi(os.Getenv(strings.ToUpper(is.GetNetwork()) + "_WS_GETACCOUNTINFO_LIMIT")) if is.WsGetAccountInfoLimit > 0 { glog.Info("WsGetAccountInfoLimit enabled with limit ", is.WsGetAccountInfoLimit) is.WsLimitExceedingIPs = make(map[string]int) diff --git a/configs/coins/arbitrum.json b/configs/coins/arbitrum.json index 223fa6f9..b1f01711 100644 --- a/configs/coins/arbitrum.json +++ b/configs/coins/arbitrum.json @@ -1,65 +1,66 @@ { - "coin": { - "name": "Arbitrum", - "shortcut": "ETH", - "label": "Arbitrum", - "alias": "arbitrum" - }, - "ports": { - "backend_rpc": 8205, - "backend_p2p": 38405, - "backend_http": 8305, - "blockbook_internal": 9205, - "blockbook_public": 9305 - }, - "ipc": { - "rpc_url_template": "ws://127.0.0.1:{{.Ports.BackendRPC}}", - "rpc_timeout": 25 - }, - "backend": { - "package_name": "backend-arbitrum", - "package_revision": "satoshilabs-1", - "system_user": "arbitrum", - "version": "3.2.1", - "docker_image": "offchainlabs/nitro-node:v3.2.1-d81324d", - "verification_type": "docker", - "verification_source": "724ebdcca39cd0c28ffd025ecea8d1622a376f41344201b729afb60352cbc306", - "extract_command": "docker cp extract:/home/user/target backend/target; docker cp extract:/home/user/nitro-legacy backend/nitro-legacy; docker cp extract:/usr/local/bin/nitro backend/nitro", - "exclude_files": [], - "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/arbitrum_exec.sh 2>> {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", - "exec_script": "arbitrum.sh", - "logrotate_files_template": "{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log", - "postinst_script_template": "openssl rand -hex 32 > {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/jwtsecret", - "service_type": "simple", - "service_additional_params_template": "", - "protect_memory": true, - "mainnet": true, - "server_config_file": "", - "client_config_file": "" - }, - "blockbook": { - "package_name": "blockbook-arbitrum", - "system_user": "blockbook-arbitrum", - "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, - "additional_params": { - "mempoolTxTimeoutHours": 48, - "queryBackendOnMempoolResync": false, - "fiat_rates": "coingecko", - "fiat_rates_vs_currencies": "AED,ARS,AUD,BDT,BHD,BMD,BRL,CAD,CHF,CLP,CNY,CZK,DKK,EUR,GBP,HKD,HUF,IDR,ILS,INR,JPY,KRW,KWD,LKR,MMK,MXN,MYR,NGN,NOK,NZD,PHP,PKR,PLN,RUB,SAR,SEK,SGD,THB,TRY,TWD,UAH,USD,VEF,VND,ZAR,BTC,ETH", - "fiat_rates_params": "{\"url\": \"https://api.coingecko.com/api/v3\", \"coin\": \"ethereum\",\"platformIdentifier\": \"ethereum\",\"platformVsCurrency\": \"eth\",\"periodSeconds\": 900}" - } + "coin": { + "name": "Arbitrum", + "shortcut": "ETH", + "network": "ARB", + "label": "Arbitrum", + "alias": "arbitrum" + }, + "ports": { + "backend_rpc": 8205, + "backend_p2p": 38405, + "backend_http": 8305, + "blockbook_internal": 9205, + "blockbook_public": 9305 + }, + "ipc": { + "rpc_url_template": "ws://127.0.0.1:{{.Ports.BackendRPC}}", + "rpc_timeout": 25 + }, + "backend": { + "package_name": "backend-arbitrum", + "package_revision": "satoshilabs-1", + "system_user": "arbitrum", + "version": "3.2.1", + "docker_image": "offchainlabs/nitro-node:v3.2.1-d81324d", + "verification_type": "docker", + "verification_source": "724ebdcca39cd0c28ffd025ecea8d1622a376f41344201b729afb60352cbc306", + "extract_command": "docker cp extract:/home/user/target backend/target; docker cp extract:/home/user/nitro-legacy backend/nitro-legacy; docker cp extract:/usr/local/bin/nitro backend/nitro", + "exclude_files": [], + "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/arbitrum_exec.sh 2>> {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", + "exec_script": "arbitrum.sh", + "logrotate_files_template": "{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log", + "postinst_script_template": "openssl rand -hex 32 > {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/jwtsecret", + "service_type": "simple", + "service_additional_params_template": "", + "protect_memory": true, + "mainnet": true, + "server_config_file": "", + "client_config_file": "" + }, + "blockbook": { + "package_name": "blockbook-arbitrum", + "system_user": "blockbook-arbitrum", + "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, + "additional_params": { + "mempoolTxTimeoutHours": 48, + "queryBackendOnMempoolResync": false, + "fiat_rates": "coingecko", + "fiat_rates_vs_currencies": "AED,ARS,AUD,BDT,BHD,BMD,BRL,CAD,CHF,CLP,CNY,CZK,DKK,EUR,GBP,HKD,HUF,IDR,ILS,INR,JPY,KRW,KWD,LKR,MMK,MXN,MYR,NGN,NOK,NZD,PHP,PKR,PLN,RUB,SAR,SEK,SGD,THB,TRY,TWD,UAH,USD,VEF,VND,ZAR,BTC,ETH", + "fiat_rates_params": "{\"url\": \"https://api.coingecko.com/api/v3\", \"coin\": \"ethereum\",\"platformIdentifier\": \"ethereum\",\"platformVsCurrency\": \"eth\",\"periodSeconds\": 900}" + } + } + }, + "meta": { + "package_maintainer": "IT", + "package_maintainer_email": "it@satoshilabs.com" } - }, - "meta": { - "package_maintainer": "IT", - "package_maintainer_email": "it@satoshilabs.com" - } } diff --git a/configs/coins/arbitrum_archive.json b/configs/coins/arbitrum_archive.json index 4d672f80..f01d6c67 100644 --- a/configs/coins/arbitrum_archive.json +++ b/configs/coins/arbitrum_archive.json @@ -1,67 +1,68 @@ { - "coin": { - "name": "Arbitrum Archive", - "shortcut": "ETH", - "label": "Arbitrum", - "alias": "arbitrum_archive" - }, - "ports": { - "backend_rpc": 8306, - "backend_p2p": 38406, - "blockbook_internal": 9206, - "blockbook_public": 9306 - }, - "ipc": { - "rpc_url_template": "ws://127.0.0.1:{{.Ports.BackendRPC}}", - "rpc_timeout": 25 - }, - "backend": { - "package_name": "backend-arbitrum-archive", - "package_revision": "satoshilabs-1", - "system_user": "arbitrum", - "version": "3.2.1", - "docker_image": "offchainlabs/nitro-node:v3.2.1-d81324d", - "verification_type": "docker", - "verification_source": "724ebdcca39cd0c28ffd025ecea8d1622a376f41344201b729afb60352cbc306", - "extract_command": "docker cp extract:/home/user/target backend/target; docker cp extract:/home/user/nitro-legacy backend/nitro-legacy; docker cp extract:/usr/local/bin/nitro backend/nitro", - "exclude_files": [], - "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/arbitrum_archive_exec.sh 2>> {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", - "exec_script": "arbitrum_archive.sh", - "logrotate_files_template": "{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log", - "postinst_script_template": "openssl rand -hex 32 > {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/jwtsecret", - "service_type": "simple", - "service_additional_params_template": "", - "protect_memory": true, - "mainnet": true, - "server_config_file": "", - "client_config_file": "" - }, - "blockbook": { - "package_name": "blockbook-arbitrum-archive", - "system_user": "blockbook-arbitrum", - "internal_binding_template": ":{{.Ports.BlockbookInternal}}", - "public_binding_template": ":{{.Ports.BlockbookPublic}}", - "explorer_url": "", - "additional_params": "-workers=16", - "block_chain": { - "parse": true, - "mempool_workers": 8, - "mempool_sub_workers": 2, - "block_addresses_to_keep": 600, - "additional_params": { - "address_aliases": true, - "mempoolTxTimeoutHours": 48, - "processInternalTransactions": true, - "queryBackendOnMempoolResync": false, - "fiat_rates": "coingecko", - "fiat_rates_vs_currencies": "AED,ARS,AUD,BDT,BHD,BMD,BRL,CAD,CHF,CLP,CNY,CZK,DKK,EUR,GBP,HKD,HUF,IDR,ILS,INR,JPY,KRW,KWD,LKR,MMK,MXN,MYR,NGN,NOK,NZD,PHP,PKR,PLN,RUB,SAR,SEK,SGD,THB,TRY,TWD,UAH,USD,VEF,VND,ZAR,BTC,ETH", - "fiat_rates_params": "{\"url\": \"https://api.coingecko.com/api/v3\", \"coin\": \"ethereum\",\"platformIdentifier\": \"ethereum\",\"platformVsCurrency\": \"eth\",\"periodSeconds\": 900}", - "fourByteSignatures": "https://www.4byte.directory/api/v1/signatures/" - } + "coin": { + "name": "Arbitrum Archive", + "shortcut": "ETH", + "network": "ARB", + "label": "Arbitrum", + "alias": "arbitrum_archive" + }, + "ports": { + "backend_rpc": 8306, + "backend_p2p": 38406, + "blockbook_internal": 9206, + "blockbook_public": 9306 + }, + "ipc": { + "rpc_url_template": "ws://127.0.0.1:{{.Ports.BackendRPC}}", + "rpc_timeout": 25 + }, + "backend": { + "package_name": "backend-arbitrum-archive", + "package_revision": "satoshilabs-1", + "system_user": "arbitrum", + "version": "3.2.1", + "docker_image": "offchainlabs/nitro-node:v3.2.1-d81324d", + "verification_type": "docker", + "verification_source": "724ebdcca39cd0c28ffd025ecea8d1622a376f41344201b729afb60352cbc306", + "extract_command": "docker cp extract:/home/user/target backend/target; docker cp extract:/home/user/nitro-legacy backend/nitro-legacy; docker cp extract:/usr/local/bin/nitro backend/nitro", + "exclude_files": [], + "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/arbitrum_archive_exec.sh 2>> {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", + "exec_script": "arbitrum_archive.sh", + "logrotate_files_template": "{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log", + "postinst_script_template": "openssl rand -hex 32 > {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/jwtsecret", + "service_type": "simple", + "service_additional_params_template": "", + "protect_memory": true, + "mainnet": true, + "server_config_file": "", + "client_config_file": "" + }, + "blockbook": { + "package_name": "blockbook-arbitrum-archive", + "system_user": "blockbook-arbitrum", + "internal_binding_template": ":{{.Ports.BlockbookInternal}}", + "public_binding_template": ":{{.Ports.BlockbookPublic}}", + "explorer_url": "", + "additional_params": "-workers=16", + "block_chain": { + "parse": true, + "mempool_workers": 8, + "mempool_sub_workers": 2, + "block_addresses_to_keep": 600, + "additional_params": { + "address_aliases": true, + "mempoolTxTimeoutHours": 48, + "processInternalTransactions": true, + "queryBackendOnMempoolResync": false, + "fiat_rates": "coingecko", + "fiat_rates_vs_currencies": "AED,ARS,AUD,BDT,BHD,BMD,BRL,CAD,CHF,CLP,CNY,CZK,DKK,EUR,GBP,HKD,HUF,IDR,ILS,INR,JPY,KRW,KWD,LKR,MMK,MXN,MYR,NGN,NOK,NZD,PHP,PKR,PLN,RUB,SAR,SEK,SGD,THB,TRY,TWD,UAH,USD,VEF,VND,ZAR,BTC,ETH", + "fiat_rates_params": "{\"url\": \"https://api.coingecko.com/api/v3\", \"coin\": \"ethereum\",\"platformIdentifier\": \"ethereum\",\"platformVsCurrency\": \"eth\",\"periodSeconds\": 900}", + "fourByteSignatures": "https://www.4byte.directory/api/v1/signatures/" + } + } + }, + "meta": { + "package_maintainer": "IT", + "package_maintainer_email": "it@satoshilabs.com" } - }, - "meta": { - "package_maintainer": "IT", - "package_maintainer_email": "it@satoshilabs.com" - } } diff --git a/configs/coins/bsc.json b/configs/coins/bsc.json index 8d15e80d..db599b3a 100644 --- a/configs/coins/bsc.json +++ b/configs/coins/bsc.json @@ -2,7 +2,7 @@ "coin": { "name": "BNB Smart Chain", "shortcut": "BNB", - "network": "BNB", + "network": "BSC", "label": "BNB Smart Chain", "alias": "bsc" }, diff --git a/configs/coins/bsc_archive.json b/configs/coins/bsc_archive.json index df80c6d0..0b460876 100644 --- a/configs/coins/bsc_archive.json +++ b/configs/coins/bsc_archive.json @@ -2,7 +2,7 @@ "coin": { "name": "BNB Smart Chain Archive", "shortcut": "BNB", - "network": "BNB", + "network": "BSC", "label": "BNB Smart Chain", "alias": "bsc_archive" }, diff --git a/fiat/coingecko.go b/fiat/coingecko.go index b7e89708..68c7722c 100644 --- a/fiat/coingecko.go +++ b/fiat/coingecko.go @@ -59,7 +59,7 @@ type marketChartPrices struct { } // NewCoinGeckoDownloader creates a coingecko structure that implements the RatesDownloaderInterface -func NewCoinGeckoDownloader(db *db.RocksDB, coinShortcut string, url string, coin string, platformIdentifier string, platformVsCurrency string, allowedVsCurrencies string, timeFormat string, metrics *common.Metrics, throttleDown bool) RatesDownloaderInterface { +func NewCoinGeckoDownloader(db *db.RocksDB, network string, url string, coin string, platformIdentifier string, platformVsCurrency string, allowedVsCurrencies string, timeFormat string, metrics *common.Metrics, throttleDown bool) RatesDownloaderInterface { throttlingDelayMs := 0 // No delay by default if throttleDown { throttlingDelayMs = DefaultThrottleDelayMs @@ -67,7 +67,7 @@ func NewCoinGeckoDownloader(db *db.RocksDB, coinShortcut string, url string, coi allowedVsCurrenciesMap := getAllowedVsCurrenciesMap(allowedVsCurrencies) - apiKey := os.Getenv(strings.ToUpper(coinShortcut) + "_COINGECKO_API_KEY") + apiKey := os.Getenv(strings.ToUpper(network) + "_COINGECKO_API_KEY") if apiKey == "" { apiKey = os.Getenv("COINGECKO_API_KEY") } diff --git a/server/public.go b/server/public.go index 05e8f477..e2d8c119 100644 --- a/server/public.go +++ b/server/public.go @@ -186,6 +186,7 @@ func (s *PublicServer) ConnectFullPublicInterface() { serveMux.HandleFunc(path+"api/block-filters/", s.jsonHandler(s.apiBlockFilters, apiDefault)) serveMux.HandleFunc(path+"api/tx-specific/", s.jsonHandler(s.apiTxSpecific, apiDefault)) serveMux.HandleFunc(path+"api/tx/", s.jsonHandler(s.apiTx, apiDefault)) + serveMux.HandleFunc(path+"api/rawtx/", s.jsonHandler(s.apiRawTx, apiDefault)) serveMux.HandleFunc(path+"api/address/", s.jsonHandler(s.apiAddress, apiDefault)) serveMux.HandleFunc(path+"api/xpub/", s.jsonHandler(s.apiXpub, apiDefault)) serveMux.HandleFunc(path+"api/utxo/", s.jsonHandler(s.apiUtxo, apiDefault)) @@ -303,7 +304,7 @@ func (s *PublicServer) newTemplateData(r *http.Request) *TemplateData { t.MultiTokenName = bchain.EthereumTokenTypeMap[bchain.MultiToken] } if !s.debug { - t.Minified = ".min.3" + t.Minified = ".min.4" } if s.is.HasFiatRates { // get the secondary coin and if it should be shown either from query parameters "secondary" and "use_secondary" @@ -1288,6 +1289,19 @@ func (s *PublicServer) apiTx(r *http.Request, apiVersion int) (interface{}, erro return tx, err } +func (s *PublicServer) apiRawTx(r *http.Request, apiVersion int) (interface{}, error) { + var txid string + i := strings.LastIndexByte(r.URL.Path, '/') + if i > 0 { + txid = r.URL.Path[i+1:] + } + if len(txid) == 0 { + return "", api.NewAPIError("Missing txid", true) + } + s.metrics.ExplorerViews.With(common.Labels{"action": "api-raw-tx"}).Inc() + return s.api.GetRawTransaction(txid) +} + func (s *PublicServer) apiTxSpecific(r *http.Request, apiVersion int) (interface{}, error) { var txid string i := strings.LastIndexByte(r.URL.Path, '/') diff --git a/server/public_ethereumtype_test.go b/server/public_ethereumtype_test.go index 5a953533..a0714f47 100644 --- a/server/public_ethereumtype_test.go +++ b/server/public_ethereumtype_test.go @@ -26,7 +26,7 @@ func httpTestsEthereumType(t *testing.T, ts *httptest.Server) { status: http.StatusOK, contentType: "text/html; charset=utf-8", body: []string{ - `Trezor Fake Coin Explorer

Address address7b.eth

0x7B62EB7fe80350DC7EC945C0B73242cb9877FB1b

0.000000000123450123 FAKE
0.00 USD

Confirmed
Balance0.000000000123450123 FAKE0.00 USD
Transactions2
Non-contract Transactions0
Internal Transactions0
Nonce123
ContractQuantityValueTransfers#
Contract 130.000000001000123013 S13-1
Contract 740.001000123074 S74-1
ContractTokensTransfers#
Contract 20511

Transactions

ERC721 Token Transfers
ERC20 Token Transfers
address7b.eth
 
871.180000950184 S74-
 
address7b.eth
7.674999999999991915 S13-
`, + `Trezor Fake Coin Explorer

Address address7b.eth

0x7B62EB7fe80350DC7EC945C0B73242cb9877FB1b

0.000000000123450123 FAKE
0.00 USD

Confirmed
Balance0.000000000123450123 FAKE0.00 USD
Transactions2
Non-contract Transactions0
Internal Transactions0
Nonce123
ContractQuantityValueTransfers#
Contract 130.000000001000123013 S13-1
Contract 740.001000123074 S74-1
ContractTokensTransfers#
Contract 20511

Transactions

ERC721 Token Transfers
ERC20 Token Transfers
address7b.eth
 
871.180000950184 S74-
 
address7b.eth
7.674999999999991915 S13-
`, }, }, { @@ -35,7 +35,7 @@ func httpTestsEthereumType(t *testing.T, ts *httptest.Server) { status: http.StatusOK, contentType: "text/html; charset=utf-8", body: []string{ - `Trezor Fake Coin Explorer

Address

0x5Dc6288b35E0807A3d6fEB89b3a2Ff4aB773168e

0.000000000123450093 FAKE
0.00 USD

Confirmed
Balance0.000000000123450093 FAKE0.00 USD
Transactions1
Non-contract Transactions1
Internal Transactions0
Nonce93
ContractTokensTransfers#
Contract 1111 S111 of ID 1776, 10 S111 of ID 18981

Transactions

0x5Dc6288b35E0807A3d6fEB89b3a2Ff4aB773168e
 
0 FAKE0.00 USD0.00 USD
ERC1155 Token Transfers
 
0x5Dc6288b35E0807A3d6fEB89b3a2Ff4aB773168e
1 S111 of ID 1776, 10 S111 of ID 1898
`, + `Trezor Fake Coin Explorer

Address

0x5Dc6288b35E0807A3d6fEB89b3a2Ff4aB773168e

0.000000000123450093 FAKE
0.00 USD

Confirmed
Balance0.000000000123450093 FAKE0.00 USD
Transactions1
Non-contract Transactions1
Internal Transactions0
Nonce93
ContractTokensTransfers#
Contract 1111 S111 of ID 1776, 10 S111 of ID 18981

Transactions

0x5Dc6288b35E0807A3d6fEB89b3a2Ff4aB773168e
 
0 FAKE0.00 USD0.00 USD
ERC1155 Token Transfers
 
0x5Dc6288b35E0807A3d6fEB89b3a2Ff4aB773168e
1 S111 of ID 1776, 10 S111 of ID 1898
`, }, }, { @@ -44,14 +44,14 @@ func httpTestsEthereumType(t *testing.T, ts *httptest.Server) { status: http.StatusOK, contentType: "text/html; charset=utf-8", body: []string{ - `Trezor Fake Coin Explorer

Transaction

0xa9cd088aba2131000da6f38a33c20169baee476218deea6b78720700b895b101
In BlockUnconfirmed
StatusSuccess
Value0 FAKE0.00 USD0.00 USD
Gas Used / Limit52025 / 78037
Gas Price0.00000004 FAKE0.00 USD0.00 USD (40 Gwei)
Fees0.002081 FAKE4.16 USD18.55 USD
RBFON
Nonce208
 
0 FAKE0.00 USD0.00 USD
ERC20 Token Transfers
Input Data

0xa9059cbb000000000000000000000000555ee11fbddc0e49a9bab358a8941ad95ffdb48f00000000000000000000000000000000000000000000021e19e0c9bab2400000
transfer(address, uint256)
#TypeData
0address0x555Ee11FBDDc0E49A9bAB358A8941AD95fFDB48f
1uint25610000000000000000000000
Raw Transaction
`, + `Trezor Fake Coin Explorer

Transaction

0xa9cd088aba2131000da6f38a33c20169baee476218deea6b78720700b895b101
In BlockUnconfirmed
StatusSuccess
Value0 FAKE0.00 USD0.00 USD
Gas Used / Limit52025 / 78037
Gas Price0.00000004 FAKE0.00 USD0.00 USD (40 Gwei)
Fees0.002081 FAKE4.16 USD18.55 USD
RBFON
Nonce208
 
0 FAKE0.00 USD0.00 USD
ERC20 Token Transfers
Input Data

0xa9059cbb000000000000000000000000555ee11fbddc0e49a9bab358a8941ad95ffdb48f00000000000000000000000000000000000000000000021e19e0c9bab2400000
transfer(address, uint256)
#TypeData
0address0x555Ee11FBDDc0E49A9bAB358A8941AD95fFDB48f
1uint25610000000000000000000000
`, }, }, { name: "explorerTokenDetail " + dbtestdata.EthAddr7b, r: newGetRequest(ts.URL + "/nft/" + dbtestdata.EthAddrContractCd + "/" + "1"), status: http.StatusOK, contentType: "text/html; charset=utf-8", - body: []string{`Trezor Fake Coin Explorer

NFT Token Detail

Token ID1
Contract0xcdA9FC258358EcaA88845f19Af595e908bb7EfE9
Contract 205
Contract typeERC20
`}, + body: []string{`Trezor Fake Coin Explorer

NFT Token Detail

Token ID1
Contract0xcdA9FC258358EcaA88845f19Af595e908bb7EfE9
Contract 205
Contract typeERC20
`}, }, { name: "apiIndex", diff --git a/server/public_test.go b/server/public_test.go index 01e34e9b..550afefe 100644 --- a/server/public_test.go +++ b/server/public_test.go @@ -283,7 +283,7 @@ func httpTestsBitcoinType(t *testing.T, ts *httptest.Server) { status: http.StatusOK, contentType: "text/html; charset=utf-8", body: []string{ - `Trezor Fake Coin Explorer

Transaction

fdd824a780cbb718eeb766eb05d83fdefc793a27082cd5e67f856d69798cf7db
Mined Time1639 days 11 hours ago
In Block00000000eb0443fd7dc4a1ed5c686a8e995057805f9a161d9a5a77a95e72b7b6
In Block Height225494
Total Input0 FAKE
Total Output13.60030331 FAKE
Fees0 FAKE
No Inputs (Newly Generated Coins)
 
Unparsed address0 FAKE×
Raw Transaction
`, + `Trezor Fake Coin Explorer

Transaction

fdd824a780cbb718eeb766eb05d83fdefc793a27082cd5e67f856d69798cf7db
Mined Time1639 days 11 hours ago
In Block00000000eb0443fd7dc4a1ed5c686a8e995057805f9a161d9a5a77a95e72b7b6
In Block Height225494
Total Input0 FAKE
Total Output13.60030331 FAKE
Fees0 FAKE
No Inputs (Newly Generated Coins)
 
Unparsed address0 FAKE×
`, }, }, { @@ -292,7 +292,7 @@ func httpTestsBitcoinType(t *testing.T, ts *httptest.Server) { status: http.StatusOK, contentType: "text/html; charset=utf-8", body: []string{ - `Trezor Fake Coin Explorer

Address

mtGXQvBowMkBpnhLckhxhbwYK44Gs9eEtz

0.00012345 FAKE

Confirmed
Total Received0.00024690 FAKE
Total Sent0.00012345 FAKE
Final Balance0.00012345 FAKE
No. Transactions2

Transactions

mtGXQvBowMkBpnhLckhxhbwYK44Gs9eEtz0.00012345 FAKE
 
OP_RETURN 2020f1686f6a200 FAKE×
No Inputs
 
mtGXQvBowMkBpnhLckhxhbwYK44Gs9eEtz0.00012345 FAKE
mtGXQvBowMkBpnhLckhxhbwYK44Gs9eEtz0.00012345 FAKE×
`, + `Trezor Fake Coin Explorer

Address

mtGXQvBowMkBpnhLckhxhbwYK44Gs9eEtz

0.00012345 FAKE

Confirmed
Total Received0.00024690 FAKE
Total Sent0.00012345 FAKE
Final Balance0.00012345 FAKE
No. Transactions2

Transactions

mtGXQvBowMkBpnhLckhxhbwYK44Gs9eEtz0.00012345 FAKE
 
OP_RETURN 2020f1686f6a200 FAKE×
No Inputs
 
mtGXQvBowMkBpnhLckhxhbwYK44Gs9eEtz0.00012345 FAKE
mtGXQvBowMkBpnhLckhxhbwYK44Gs9eEtz0.00012345 FAKE×
`, }, }, { @@ -301,7 +301,7 @@ func httpTestsBitcoinType(t *testing.T, ts *httptest.Server) { status: http.StatusOK, contentType: "text/html; charset=utf-8", body: []string{ - `Trezor Fake Coin Explorer

Transaction

3d90d15ed026dc45e19ffb52875ed18fa9e8012ad123d7f7212176e2b0ebdb71
Mined Time1639 days 11 hours ago
In Block00000000eb0443fd7dc4a1ed5c686a8e995057805f9a161d9a5a77a95e72b7b6
In Block Height225494
Total Input3172.83951062 FAKE
Total Output3172.83951000 FAKE
Fees0.00000062 FAKE
Raw Transaction
`, + `Trezor Fake Coin Explorer

Transaction

3d90d15ed026dc45e19ffb52875ed18fa9e8012ad123d7f7212176e2b0ebdb71
Mined Time1639 days 11 hours ago
In Block00000000eb0443fd7dc4a1ed5c686a8e995057805f9a161d9a5a77a95e72b7b6
In Block Height225494
Total Input3172.83951062 FAKE
Total Output3172.83951000 FAKE
Fees0.00000062 FAKE
`, }, }, { @@ -310,7 +310,7 @@ func httpTestsBitcoinType(t *testing.T, ts *httptest.Server) { status: http.StatusOK, contentType: "text/html; charset=utf-8", body: []string{ - `Trezor Fake Coin Explorer

Error

Transaction not found

`, + `Trezor Fake Coin Explorer

Error

Transaction not found

`, }, }, { @@ -319,7 +319,7 @@ func httpTestsBitcoinType(t *testing.T, ts *httptest.Server) { status: http.StatusOK, contentType: "text/html; charset=utf-8", body: []string{ - `Trezor Fake Coin Explorer

Blocks

HeightHashTimestampTransactionsSize
22549400000000eb0443fd7dc4a1ed5c686a8e995057805f9a161d9a5a77a95e72b7b61639 days 11 hours ago42345678
2254930000000076fbbed90fd75b0e18856aa35baa984e9c9d444cf746ad85e94e29971640 days 9 hours ago21234567
`, + `Trezor Fake Coin Explorer

Blocks

HeightHashTimestampTransactionsSize
22549400000000eb0443fd7dc4a1ed5c686a8e995057805f9a161d9a5a77a95e72b7b61639 days 11 hours ago42345678
2254930000000076fbbed90fd75b0e18856aa35baa984e9c9d444cf746ad85e94e29971640 days 9 hours ago21234567
`, }, }, { @@ -328,7 +328,7 @@ func httpTestsBitcoinType(t *testing.T, ts *httptest.Server) { status: http.StatusOK, contentType: "text/html; charset=utf-8", body: []string{ - `Trezor Fake Coin Explorer

Block

225494
00000000eb0443fd7dc4a1ed5c686a8e995057805f9a161d9a5a77a95e72b7b6
Transactions4
Height225494
Confirmations1
Timestamp1639 days 11 hours ago
Size (bytes)2345678
Version
Merkle Root
Nonce
Bits
Difficulty

Transactions

 
OP_RETURN 2020f1686f6a200 FAKE×
No Inputs (Newly Generated Coins)
 
Unparsed address0 FAKE×
`, + `Trezor Fake Coin Explorer

Block

225494
00000000eb0443fd7dc4a1ed5c686a8e995057805f9a161d9a5a77a95e72b7b6
Transactions4
Height225494
Confirmations1
Timestamp1639 days 11 hours ago
Size (bytes)2345678
Version
Merkle Root
Nonce
Bits
Difficulty

Transactions

 
OP_RETURN 2020f1686f6a200 FAKE×
No Inputs (Newly Generated Coins)
 
Unparsed address0 FAKE×
`, }, }, { @@ -337,7 +337,7 @@ func httpTestsBitcoinType(t *testing.T, ts *httptest.Server) { status: http.StatusOK, contentType: "text/html; charset=utf-8", body: []string{ - `Trezor Fake Coin Explorer

Application status

Synchronization with backend is disabled, the state of index is not up to date.

OP_RETURN 2020f1686f6a200 FAKE×
No Inputs (Newly Generated Coins)
 
Unparsed address0 FAKE×
`, + `Trezor Fake Coin Explorer

Block

225494
00000000eb0443fd7dc4a1ed5c686a8e995057805f9a161d9a5a77a95e72b7b6

Blockbook

CoinFakecoin
Host
Version / Commit / Buildunknown / unknown / unknown
Synchronized
true
Last Block225494
Last Block Update`, + `Trezor Fake Coin Explorer

Application status

Synchronization with backend is disabled, the state of index is not up to date.

`, `

Blockbook

CoinFakecoin
Host
Version / Commit / Buildunknown / unknown / unknown
Synchronized
true
Last Block225494
Last Block Update`, `
Mempool in Sync
false
Last Mempool Update
Transactions in Mempool0
Current Fiat rates

Backend

Chainfakecoin
Version001001
Subversion/Fakecoin:0.0.1/
Last Block2
Difficulty
Blockbook - blockchain indexer for Trezor Suite https://trezor.io/trezor-suite. Do not use for any other purpose.
`, }, @@ -348,7 +348,7 @@ func httpTestsBitcoinType(t *testing.T, ts *httptest.Server) { status: http.StatusOK, contentType: "text/html; charset=utf-8", body: []string{ - `Trezor Fake Coin Explorer

Block

225494
00000000eb0443fd7dc4a1ed5c686a8e995057805f9a161d9a5a77a95e72b7b6
Transactions4
Height225494
Confirmations1
Timestamp1639 days 11 hours ago
Size (bytes)2345678
Version
Merkle Root
Nonce
Bits
Difficulty

Transactions

Transactions4
Height225494
Confirmations1
Timestamp1639 days 11 hours ago
Size (bytes)2345678
Version
Merkle Root
Nonce
Bits
Difficulty

Transactions

 
OP_RETURN 2020f1686f6a200 FAKE×
No Inputs (Newly Generated Coins)
 
Unparsed address0 FAKE×
`, }, }, { @@ -357,7 +357,7 @@ func httpTestsBitcoinType(t *testing.T, ts *httptest.Server) { status: http.StatusOK, contentType: "text/html; charset=utf-8", body: []string{ - `Trezor Fake Coin Explorer

Block

225494
00000000eb0443fd7dc4a1ed5c686a8e995057805f9a161d9a5a77a95e72b7b6
Transactions4
Height225494
Confirmations1
Timestamp1639 days 11 hours ago
Size (bytes)2345678
Version
Merkle Root
Nonce
Bits
Difficulty

Transactions

 
OP_RETURN 2020f1686f6a200 FAKE×
No Inputs (Newly Generated Coins)
 
Unparsed address0 FAKE×
`, + `Trezor Fake Coin Explorer

Block

225494
00000000eb0443fd7dc4a1ed5c686a8e995057805f9a161d9a5a77a95e72b7b6
Transactions4
Height225494
Confirmations1
Timestamp1639 days 11 hours ago
Size (bytes)2345678
Version
Merkle Root
Nonce
Bits
Difficulty

Transactions

 
OP_RETURN 2020f1686f6a200 FAKE×
No Inputs (Newly Generated Coins)
 
Unparsed address0 FAKE×
`, }, }, { @@ -366,7 +366,7 @@ func httpTestsBitcoinType(t *testing.T, ts *httptest.Server) { status: http.StatusOK, contentType: "text/html; charset=utf-8", body: []string{ - `Trezor Fake Coin Explorer

Transaction

fdd824a780cbb718eeb766eb05d83fdefc793a27082cd5e67f856d69798cf7db
Mined Time1639 days 11 hours ago
In Block00000000eb0443fd7dc4a1ed5c686a8e995057805f9a161d9a5a77a95e72b7b6
In Block Height225494
Total Input0 FAKE
Total Output13.60030331 FAKE
Fees0 FAKE
No Inputs (Newly Generated Coins)
 
Unparsed address0 FAKE×
Raw Transaction
`, + `Trezor Fake Coin Explorer

Transaction

fdd824a780cbb718eeb766eb05d83fdefc793a27082cd5e67f856d69798cf7db
Mined Time1639 days 11 hours ago
In Block00000000eb0443fd7dc4a1ed5c686a8e995057805f9a161d9a5a77a95e72b7b6
In Block Height225494
Total Input0 FAKE
Total Output13.60030331 FAKE
Fees0 FAKE
No Inputs (Newly Generated Coins)
 
Unparsed address0 FAKE×
`, }, }, { @@ -375,7 +375,7 @@ func httpTestsBitcoinType(t *testing.T, ts *httptest.Server) { status: http.StatusOK, contentType: "text/html; charset=utf-8", body: []string{ - `Trezor Fake Coin Explorer

Address

mtGXQvBowMkBpnhLckhxhbwYK44Gs9eEtz

0.00012345 FAKE

Confirmed
Total Received0.00024690 FAKE
Total Sent0.00012345 FAKE
Final Balance0.00012345 FAKE
No. Transactions2

Transactions

mtGXQvBowMkBpnhLckhxhbwYK44Gs9eEtz0.00012345 FAKE
 
OP_RETURN 2020f1686f6a200 FAKE×
No Inputs
 
mtGXQvBowMkBpnhLckhxhbwYK44Gs9eEtz0.00012345 FAKE
mtGXQvBowMkBpnhLckhxhbwYK44Gs9eEtz0.00012345 FAKE×
`, + `Trezor Fake Coin Explorer

Address

mtGXQvBowMkBpnhLckhxhbwYK44Gs9eEtz

0.00012345 FAKE

Confirmed
Total Received0.00024690 FAKE
Total Sent0.00012345 FAKE
Final Balance0.00012345 FAKE
No. Transactions2

Transactions

mtGXQvBowMkBpnhLckhxhbwYK44Gs9eEtz0.00012345 FAKE
 
OP_RETURN 2020f1686f6a200 FAKE×
No Inputs
 
mtGXQvBowMkBpnhLckhxhbwYK44Gs9eEtz0.00012345 FAKE
mtGXQvBowMkBpnhLckhxhbwYK44Gs9eEtz0.00012345 FAKE×
`, }, }, { @@ -384,7 +384,7 @@ func httpTestsBitcoinType(t *testing.T, ts *httptest.Server) { status: http.StatusOK, contentType: "text/html; charset=utf-8", body: []string{ - `Trezor Fake Coin Explorer

XPUB

upub5E1xjDmZ7Hhej6LPpS8duATdKXnRYui7bDYj6ehfFGzWDZtmCmQkZhc3Zb7kgRLtHWd16QFxyP86JKL3ShZEBFX88aciJ3xyocuyhZZ8g6q

1186.419755 FAKE

Confirmed
Total Received1186.41975501 FAKE
Total Sent0.00000001 FAKE
Final Balance1186.41975500 FAKE
No. Transactions2
Used XPUB Addresses2
XPUB Addresses with Balance
AddressBalanceTxsPath
2N6utyMZfPNUb1Bk8oz7p2JqJrXkq83gegu1186.41975500 FAKE1m/49'/1'/33'/1/3

Transactions

`, + `Trezor Fake Coin Explorer

XPUB

upub5E1xjDmZ7Hhej6LPpS8duATdKXnRYui7bDYj6ehfFGzWDZtmCmQkZhc3Zb7kgRLtHWd16QFxyP86JKL3ShZEBFX88aciJ3xyocuyhZZ8g6q

1186.419755 FAKE

Confirmed
Total Received1186.41975501 FAKE
Total Sent0.00000001 FAKE
Final Balance1186.41975500 FAKE
No. Transactions2
Used XPUB Addresses2
XPUB Addresses with Balance
AddressBalanceTxsPath
2N6utyMZfPNUb1Bk8oz7p2JqJrXkq83gegu1186.41975500 FAKE1m/49'/1'/33'/1/3

Transactions

`, }, }, { @@ -393,7 +393,7 @@ func httpTestsBitcoinType(t *testing.T, ts *httptest.Server) { status: http.StatusOK, contentType: "text/html; charset=utf-8", body: []string{ - `Trezor Fake Coin Explorer

XPUB

tr([5c9e228d/86'/1'/0']tpubDC88gkaZi5HvJGxGDNLADkvtdpni3mLmx6vr2KnXmWMG8zfkBRggsxHVBkUpgcwPe2KKpkyvTJCdXHb1UHEWE64vczyyPQfHr1skBcsRedN/{0,1}/*)#4rqwxvej

0 FAKE

Confirmed
Total Received0 FAKE
Total Sent0 FAKE
Final Balance0 FAKE
No. Transactions0
Used XPUB Addresses0
XPUB Addresses with Balance
No addresses
`, + `Trezor Fake Coin Explorer

XPUB

tr([5c9e228d/86'/1'/0']tpubDC88gkaZi5HvJGxGDNLADkvtdpni3mLmx6vr2KnXmWMG8zfkBRggsxHVBkUpgcwPe2KKpkyvTJCdXHb1UHEWE64vczyyPQfHr1skBcsRedN/{0,1}/*)#4rqwxvej

0 FAKE

Confirmed
Total Received0 FAKE
Total Sent0 FAKE
Final Balance0 FAKE
No. Transactions0
Used XPUB Addresses0
XPUB Addresses with Balance
No addresses
`, }, }, { @@ -402,7 +402,7 @@ func httpTestsBitcoinType(t *testing.T, ts *httptest.Server) { status: http.StatusOK, contentType: "text/html; charset=utf-8", body: []string{ - `Trezor Fake Coin Explorer

Error

No matching records found for '1234'

`, + `Trezor Fake Coin Explorer

Error

No matching records found for '1234'

`, }, }, { @@ -411,7 +411,7 @@ func httpTestsBitcoinType(t *testing.T, ts *httptest.Server) { status: http.StatusOK, contentType: "text/html; charset=utf-8", body: []string{ - `Trezor Fake Coin Explorer

Send Raw Transaction

`, + `Trezor Fake Coin Explorer

Send Raw Transaction

`, }, }, { @@ -420,7 +420,7 @@ func httpTestsBitcoinType(t *testing.T, ts *httptest.Server) { status: http.StatusOK, contentType: "text/html; charset=utf-8", body: []string{ - `Trezor Fake Coin Explorer

Send Raw Transaction

Invalid data
`, + `Trezor Fake Coin Explorer

Send Raw Transaction

Invalid data
`, }, }, { diff --git a/server/websocket.go b/server/websocket.go index f9093eeb..c782adea 100644 --- a/server/websocket.go +++ b/server/websocket.go @@ -107,7 +107,7 @@ func NewWebsocketServer(db *db.RocksDB, chain bchain.BlockChain, mempool bchain. fiatRatesSubscriptions: make(map[string]map[*websocketChannel]string), fiatRatesTokenSubscriptions: make(map[*websocketChannel][]string), } - envRpcCall := os.Getenv(strings.ToUpper(is.CoinShortcut) + "_ALLOWED_RPC_CALL_TO") + envRpcCall := os.Getenv(strings.ToUpper(is.GetNetwork()) + "_ALLOWED_RPC_CALL_TO") if envRpcCall != "" { s.allowedRpcCallTo = make(map[string]struct{}) for _, c := range strings.Split(envRpcCall, ",") { diff --git a/static/css/main.css b/static/css/main.css index b02f915c..e708ac18 100644 --- a/static/css/main.css +++ b/static/css/main.css @@ -200,6 +200,10 @@ span.btn-paging:hover { color: #757575; } +.btn-paging.active:hover { + background-color: white; +} + .paging-group { border: 1px solid #e2e2e2; border-radius: 0.5rem; @@ -694,4 +698,4 @@ span.btn-paging:hover { .btn { --bs-btn-font-size: 1rem; } -} \ No newline at end of file +} diff --git a/static/css/main.min.3.css b/static/css/main.min.3.css deleted file mode 100644 index dbafe084..00000000 --- a/static/css/main.min.3.css +++ /dev/null @@ -1 +0,0 @@ -@import "TTHoves/TTHoves.css";* {margin: 0;padding: 0;outline: none;font-family: "TT Hoves", -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;}html, body {height: 100%;}body {min-height: 100%;margin: 0;background: linear-gradient(to bottom, #f6f6f6 360px, #e5e5e5 0), #e5e5e5;background-repeat: no-repeat;}a {color: #00854d;text-decoration: none;}a:hover {color: #00854d;text-decoration: underline;}select {border-radius: 0.5rem;padding-left: 0.5rem;border: 1px solid #ced4da;color: var(--bs-body-color);min-height: 45px;}#header {position: fixed;top: 0;left: 0;width: 100%;margin: 0;padding-bottom: 0;padding-top: 0;background-color: white;border-bottom: 1px solid #f6f6f6;z-index: 10;}#header a {color: var(--bs-navbar-brand-color);}#header a:hover {color: var(--bs-navbar-brand-hover-color);}#header .navbar {--bs-navbar-padding-y: 0.7rem;}#header .form-control-lg {font-size: 1rem;padding: 0.75rem 1rem;}#header .container {min-height: 50px;}#header .btn.dropdown-toggle {padding-right: 0;}#header .dropdown-menu {--bs-dropdown-min-width: 13rem;}#header .dropdown-menu[data-bs-popper] {left: initial;right: 0;}#header .dropdown-menu.show {display: flex;}.form-control:focus {outline: 0;box-shadow: none;border-color: #00854d;}.base-value {color: #757575 !important;padding-left: 0.5rem;font-weight: normal;}.badge {vertical-align: middle;text-transform: uppercase;letter-spacing: 0.15em;--bs-badge-padding-x: 0.8rem;--bs-badge-font-weight: normal;--bs-badge-border-radius: 0.6rem;}.bg-secondary {background-color: #757575 !important;}.accordion {--bs-accordion-border-radius: 10px;--bs-accordion-inner-border-radius: calc(10px - 1px);--bs-accordion-color: var(--bs-body-color);--bs-accordion-active-color: var(--bs-body-color);--bs-accordion-active-bg: white;--bs-accordion-btn-active-icon: url("data:image/svg+xml,");}.accordion-button:focus {outline: 0;box-shadow: none;}.accordion-body {letter-spacing: -0.01em;}.bb-group {border: 0.6rem solid #f6f6f6;background-color: #f6f6f6;border-radius: 0.5rem;position: relative;display: inline-flex;vertical-align: middle;}.bb-group>.btn {--bs-btn-padding-x: 0.5rem;--bs-btn-padding-y: 0.22rem;--bs-btn-border-radius: 0.3rem;--bs-btn-border-width: 0;color: #545454;}.bb-group>.btn-check:checked+.btn, .bb-group .btn.active {color: black;font-weight: bold;background-color: white;}.paging {display: flex;}.paging .bb-group>.btn {min-width: 2rem;margin-left: 0.1rem;margin-right: 0.1rem;}.paging .bb-group>.btn:hover {background-color: white;}.paging a {text-decoration: none;}.btn-paging {--bs-btn-color: #757575;--bs-btn-border-color: #e2e2e2;--bs-btn-hover-color: black;--bs-btn-hover-bg: #f6f6f6;--bs-btn-hover-border-color: #e2e2e2;--bs-btn-focus-shadow-rgb: 108, 117, 125;--bs-btn-active-color: #fff;--bs-btn-active-bg: #e2e2e2;--bs-btn-active-border-color: #e2e2e2;--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);--bs-gradient: none;--bs-btn-padding-y: 0.75rem;--bs-btn-padding-x: 1.1rem;--bs-btn-border-radius: 0.5rem;--bs-btn-font-weight: bold;background-color: #f6f6f6;}span.btn-paging {cursor: initial;}span.btn-paging:hover {color: #757575;}.paging-group {border: 1px solid #e2e2e2;border-radius: 0.5rem;}.paging-group>.bb-group {border: 0.53rem solid #f6f6f6;}#wrap {min-height: 100%;height: auto;padding: 112px 0 75px 0;margin: 0 auto -56px;}#footer {background-color: black;color: #757575;height: 56px;overflow: hidden;}.navbar-form {width: 60%;}.navbar-form button {margin-left: -50px;position: relative;}.search-icon {width: 16px;height: 16px;position: absolute;top: 16px;background-size: cover;background-image: url("data:image/svg+xml, %3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7.24976 12.5C10.1493 12.5 12.4998 10.1495 12.4998 7.25C12.4998 4.35051 10.1493 2 7.24976 2C4.35026 2 1.99976 4.35051 1.99976 7.25C1.99976 10.1495 4.35026 12.5 7.24976 12.5Z' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' /%3E%3Cpath d='M10.962 10.9625L13.9996 14.0001' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' /%3E%3C/svg%3E");}.navbar-form ::placeholder {color: #e2e2e2;}.ellipsis {overflow: hidden;text-overflow: ellipsis;white-space: nowrap;}.data-table {table-layout: fixed;overflow-wrap: anywhere;margin-left: 8px;margin-top: 2rem;margin-bottom: 2rem;width: calc(100% - 16px);}.data-table thead {padding-bottom: 20px;}.table.data-table> :not(caption)>*>* {padding: 0.8rem 0.8rem;background-color: var(--bs-table-bg);border-bottom-width: 1px;box-shadow: inset 0 0 0 9999px var(--bs-table-accent-bg);}.table.data-table>thead>*>* {padding-bottom: 1.5rem;}.table.data-table>*>*:last-child>* {border-bottom: none;}.data-table thead, .data-table thead tr, .data-table thead th {color: #757575;border: none;font-weight: normal;}.data-table tbody th {color: #757575;font-weight: normal;}.data-table tbody {background: white;border-radius: 8px;box-shadow: 0 0 0 8px white;}.data-table h3, .data-table h5, .data-table h6 {margin-bottom: 0;}.data-table h3, .data-table h5 {color: var(--bs-body-color);}.accordion .table.data-table>thead>*>* {padding-bottom: 0;}.info-table tbody {display: inline-table;width: 100%;}.info-table td {font-weight: bold;}.info-table tr>td:first-child {font-weight: normal;color: #757575;}.ns:before {content: " ";}.nc:before {content: ",";}.trezor-logo {width: 128px;height: 32px;position: absolute;top: 16px;background-size: cover;background-image: url("data:image/svg+xml,%3Csvg style='width: 128px%3B' version='1.1' xmlns='http://www.w3.org/2000/svg' x='0px' y='0px' viewBox='0 0 163.7 41.9' space='preserve'%3E%3Cpolygon points='101.1 12.8 118.2 12.8 118.2 17.3 108.9 29.9 118.2 29.9 118.2 35.2 101.1 35.2 101.1 30.7 110.4 18.1 101.1 18.1'%3E%3C/polygon%3E%3Cpath d='M158.8 26.9c2.1-0.8 4.3-2.9 4.3-6.6c0-4.5-3.1-7.4-7.7-7.4h-10.5v22.3h5.8v-7.5h2.2l4.1 7.5h6.7L158.8 26.9z M154.7 22.5h-4V18h4c1.5 0 2.5 0.9 2.5 2.2C157.2 21.6 156.2 22.5 154.7 22.5z'%3E%3C/path%3E%3Cpath d='M130.8 12.5c-6.8 0-11.6 4.9-11.6 11.5s4.9 11.5 11.6 11.5s11.7-4.9 11.7-11.5S137.6 12.5 130.8 12.5z M130.8 30.3c-3.4 0-5.7-2.6-5.7-6.3c0-3.8 2.3-6.3 5.7-6.3c3.4 0 5.8 2.6 5.8 6.3C136.6 27.7 134.2 30.3 130.8 30.3z'%3E%3C/path%3E%3Cpolygon points='82.1 12.8 98.3 12.8 98.3 18 87.9 18 87.9 21.3 98 21.3 98 26.4 87.9 26.4 87.9 30 98.3 30 98.3 35.2 82.1 35.2'%3E%3C/polygon%3E%3Cpath d='M24.6 9.7C24.6 4.4 20 0 14.4 0S4.2 4.4 4.2 9.7v3.1H0v22.3h0l14.4 6.7l14.4-6.7h0V12.9h-4.2V9.7z M9.4 9.7c0-2.5 2.2-4.5 5-4.5s5 2 5 4.5v3.1H9.4V9.7z M23 31.5l-8.6 4l-8.6-4V18.1H23V31.5z'%3E%3C/path%3E%3Cpath d='M79.4 20.3c0-4.5-3.1-7.4-7.7-7.4H61.2v22.3H67v-7.5h2.2l4.1 7.5H80l-4.9-8.3C77.2 26.1 79.4 24 79.4 20.3z M71 22.5h-4V18h4c1.5 0 2.5 0.9 2.5 2.2C73.5 21.6 72.5 22.5 71 22.5z'%3E%3C/path%3E%3Cpolygon points='40.5 12.8 58.6 12.8 58.6 18.1 52.4 18.1 52.4 35.2 46.6 35.2 46.6 18.1 40.5 18.1'%3E%3C/polygon%3E%3C/svg%3E");}.copyable::before, .copied::before {width: 18px;height: 16px;margin: 3px -18px;content: "";position: absolute;background-size: cover;}.copyable::before {display: none;cursor: copy;background-image: url("data:image/svg+xml,%3Csvg width='18' height='16' viewBox='0 0 18 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10.5 10.4996H13.5V2.49963H5.5V5.49963' stroke='%2300854D' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M10.4998 5.49976H2.49976V13.4998H10.4998V5.49976Z' stroke='%2300854D' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");}.copyable:hover::before {display: inline-block;}.copied::before {transition: all 0.4s ease;transform: scale(1.2);background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='16' viewBox='-30 -30 330 330'%3E%3Cpath d='M 30,180 90,240 240,30' style='stroke:%2300854D;stroke-width:32;fill:none'/%3E%3C/svg%3E");}.h-data {letter-spacing: 0.12em;font-weight: normal !important;}.tx-detail {background: #f6f6f6;color: #757575;border-radius: 10px;box-shadow: 0 0 0 10px white;width: calc(100% - 20px);margin-left: 10px;margin-top: 3rem;overflow-wrap: break-word;}.tx-detail:first-child {margin-top: 1rem;}.tx-detail:last-child {margin-bottom: 2rem;}.tx-detail span.ellipsis, .tx-detail a.ellipsis {display: block;float: left;max-width: 100%;}.tx-detail>.head, .tx-detail>.footer {padding: 1.5rem;--bs-gutter-x: 0;}.tx-detail>.head {border-radius: 10px 10px 0 0;}.tx-detail .txid {font-size: 106%;letter-spacing: -0.01em;}.tx-detail>.body {padding: 0 1.5rem;--bs-gutter-x: 0;letter-spacing: -0.01em;}.tx-detail>.subhead {padding: 1.5rem 1.5rem 0.4rem 1.5rem;--bs-gutter-x: 0;letter-spacing: 0.1em;text-transform: uppercase;color: var(--bs-body-color);}.tx-detail>.subhead-2 {padding: 0.3rem 1.5rem 0 1.5rem;--bs-gutter-x: 0;font-size: .875em;color: var(--bs-body-color);}.tx-in .col-12, .tx-out .col-12, .tx-addr .col-12 {background-color: white;padding: 1.2rem 1.3rem;border-bottom: 1px solid #f6f6f6;}.amt-out {padding: 1.2rem 0 1.2rem 1rem;text-align: right;overflow-wrap: break-word;}.tx-in .col-12:last-child, .tx-out .col-12:last-child {border-bottom: none;}.tx-own {background-color: #fff9e3 !important;}.tx-amt {float: right !important;}.spent {color: #dc3545 !important;}.unspent {color: #28a745 !important;}.outpoint {color: #757575 !important;}.spent, .unspent, .outpoint {display: inline-block;text-align: right;min-width: 18px;text-decoration: none !important;}.octicon {height: 24px;width: 24px;margin-left: -12px;margin-top: 19px;position: absolute;background-size: cover;background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9 4.5L16.5 12L9 19.5' stroke='%23AFAFAF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A");}.txvalue {color: var(--bs-body-color);font-weight: bold;}.txerror {color: #c51f13;}.txerror a, .txerror .txvalue {color: #c51f13;}.txerror .copyable::before, .txerror .copied::before {filter: invert(86%) sepia(43%) saturate(732%) hue-rotate(367deg) brightness(84%);}.tx-amt .amt:hover, .tx-amt.amt:hover, .amt-out>.amt:hover {color: var(--bs-body-color);}.prim-amt {display: initial;}.sec-amt {display: none;}.csec-amt {display: none;}.base-amt {display: none;}.cbase-amt {display: none;}.tooltip {--bs-tooltip-opacity: 1;--bs-tooltip-max-width: 380px;--bs-tooltip-bg: #fff;--bs-tooltip-color: var(--bs-body-color);--bs-tooltip-padding-x: 1rem;--bs-tooltip-padding-y: 0.8rem;filter: drop-shadow(0px 24px 64px rgba(22, 27, 45, 0.25));}.l-tooltip {text-align: start;display: inline-block;}.l-tooltip .prim-amt, .l-tooltip .sec-amt, .l-tooltip .csec-amt, .l-tooltip .base-amt, .l-tooltip .cbase-amt {display: initial;float: right;}.l-tooltip .amt-time {padding-right: 3rem;float: left;}.amt-dec {font-size: 95%;}.unconfirmed {color: white;background-color: #c51e13;padding: 0.7rem 1.2rem;border-radius: 1.4rem;}.json {word-wrap: break-word;font-size: smaller;background: #002b31;border-radius: 8px;}#raw {padding: 1.5rem 2rem;color: #ffffff;letter-spacing: 0.02em;}#raw .string {color: #2bca87;}#raw .number, #raw .boolean {color: #efc941;}#raw .null {color: red;}@media (max-width: 768px) {body {font-size: 0.8rem;background: linear-gradient(to bottom, #f6f6f6 500px, #e5e5e5 0), #e5e5e5;}.container {padding-left: 2px;padding-right: 2px;}.accordion-body {padding: var(--bs-accordion-body-padding-y) 0;}.octicon {scale: 60% !important;margin-top: -2px;}.unconfirmed {padding: 0.1rem 0.8rem;}.btn {--bs-btn-font-size: 0.8rem;}}@media (max-width: 991px) {#header .container {min-height: 40px;}#header .dropdown-menu[data-bs-popper] {left: 0;right: initial;}.trezor-logo {top: 10px;}.octicon {scale: 80%;}.table.data-table>:not(caption)>*>* {padding: 0.8rem 0.4rem;}.tx-in .col-12, .tx-out .col-12, .tx-addr .col-12 {padding: 0.7rem 1.1rem;}.amt-out {padding: 0.7rem 0 0.7rem 1rem }}@media (min-width: 769px) {body {font-size: 0.9rem;}.btn {--bs-btn-font-size: 0.9rem;}}@media (min-width: 1200px) {.h1, h1 {font-size: 2.4rem;}body {font-size: 1rem;}.btn {--bs-btn-font-size: 1rem;}} \ No newline at end of file diff --git a/static/css/main.min.4.css b/static/css/main.min.4.css new file mode 100644 index 00000000..54dd88a2 --- /dev/null +++ b/static/css/main.min.4.css @@ -0,0 +1 @@ +@import "TTHoves/TTHoves.css";* {margin: 0;padding: 0;outline: none;font-family: "TT Hoves", -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;}html, body {height: 100%;}body {min-height: 100%;margin: 0;background: linear-gradient(to bottom, #f6f6f6 360px, #e5e5e5 0), #e5e5e5;background-repeat: no-repeat;}a {color: #00854d;text-decoration: none;}a:hover {color: #00854d;text-decoration: underline;}select {border-radius: 0.5rem;padding-left: 0.5rem;border: 1px solid #ced4da;color: var(--bs-body-color);min-height: 45px;}#header {position: fixed;top: 0;left: 0;width: 100%;margin: 0;padding-bottom: 0;padding-top: 0;background-color: white;border-bottom: 1px solid #f6f6f6;z-index: 10;}#header a {color: var(--bs-navbar-brand-color);}#header a:hover {color: var(--bs-navbar-brand-hover-color);}#header .navbar {--bs-navbar-padding-y: 0.7rem;}#header .form-control-lg {font-size: 1rem;padding: 0.75rem 1rem;}#header .container {min-height: 50px;}#header .btn.dropdown-toggle {padding-right: 0;}#header .dropdown-menu {--bs-dropdown-min-width: 13rem;}#header .dropdown-menu[data-bs-popper] {left: initial;right: 0;}#header .dropdown-menu.show {display: flex;}.form-control:focus {outline: 0;box-shadow: none;border-color: #00854d;}.base-value {color: #757575 !important;padding-left: 0.5rem;font-weight: normal;}.badge {vertical-align: middle;text-transform: uppercase;letter-spacing: 0.15em;--bs-badge-padding-x: 0.8rem;--bs-badge-font-weight: normal;--bs-badge-border-radius: 0.6rem;}.bg-secondary {background-color: #757575 !important;}.accordion {--bs-accordion-border-radius: 10px;--bs-accordion-inner-border-radius: calc(10px - 1px);--bs-accordion-color: var(--bs-body-color);--bs-accordion-active-color: var(--bs-body-color);--bs-accordion-active-bg: white;--bs-accordion-btn-active-icon: url("data:image/svg+xml,");}.accordion-button:focus {outline: 0;box-shadow: none;}.accordion-body {letter-spacing: -0.01em;}.bb-group {border: 0.6rem solid #f6f6f6;background-color: #f6f6f6;border-radius: 0.5rem;position: relative;display: inline-flex;vertical-align: middle;}.bb-group>.btn {--bs-btn-padding-x: 0.5rem;--bs-btn-padding-y: 0.22rem;--bs-btn-border-radius: 0.3rem;--bs-btn-border-width: 0;color: #545454;}.bb-group>.btn-check:checked+.btn, .bb-group .btn.active {color: black;font-weight: bold;background-color: white;}.paging {display: flex;}.paging .bb-group>.btn {min-width: 2rem;margin-left: 0.1rem;margin-right: 0.1rem;}.paging .bb-group>.btn:hover {background-color: white;}.paging a {text-decoration: none;}.btn-paging {--bs-btn-color: #757575;--bs-btn-border-color: #e2e2e2;--bs-btn-hover-color: black;--bs-btn-hover-bg: #f6f6f6;--bs-btn-hover-border-color: #e2e2e2;--bs-btn-focus-shadow-rgb: 108, 117, 125;--bs-btn-active-color: #fff;--bs-btn-active-bg: #e2e2e2;--bs-btn-active-border-color: #e2e2e2;--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);--bs-gradient: none;--bs-btn-padding-y: 0.75rem;--bs-btn-padding-x: 1.1rem;--bs-btn-border-radius: 0.5rem;--bs-btn-font-weight: bold;background-color: #f6f6f6;}span.btn-paging {cursor: initial;}span.btn-paging:hover {color: #757575;}.btn-paging.active:hover {background-color: white;}.paging-group {border: 1px solid #e2e2e2;border-radius: 0.5rem;}.paging-group>.bb-group {border: 0.53rem solid #f6f6f6;}#wrap {min-height: 100%;height: auto;padding: 112px 0 75px 0;margin: 0 auto -56px;}#footer {background-color: black;color: #757575;height: 56px;overflow: hidden;}.navbar-form {width: 60%;}.navbar-form button {margin-left: -50px;position: relative;}.search-icon {width: 16px;height: 16px;position: absolute;top: 16px;background-size: cover;background-image: url("data:image/svg+xml, %3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7.24976 12.5C10.1493 12.5 12.4998 10.1495 12.4998 7.25C12.4998 4.35051 10.1493 2 7.24976 2C4.35026 2 1.99976 4.35051 1.99976 7.25C1.99976 10.1495 4.35026 12.5 7.24976 12.5Z' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' /%3E%3Cpath d='M10.962 10.9625L13.9996 14.0001' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' /%3E%3C/svg%3E");}.navbar-form ::placeholder {color: #e2e2e2;}.ellipsis {overflow: hidden;text-overflow: ellipsis;white-space: nowrap;}.data-table {table-layout: fixed;overflow-wrap: anywhere;margin-left: 8px;margin-top: 2rem;margin-bottom: 2rem;width: calc(100% - 16px);}.data-table thead {padding-bottom: 20px;}.table.data-table> :not(caption)>*>* {padding: 0.8rem 0.8rem;background-color: var(--bs-table-bg);border-bottom-width: 1px;box-shadow: inset 0 0 0 9999px var(--bs-table-accent-bg);}.table.data-table>thead>*>* {padding-bottom: 1.5rem;}.table.data-table>*>*:last-child>* {border-bottom: none;}.data-table thead, .data-table thead tr, .data-table thead th {color: #757575;border: none;font-weight: normal;}.data-table tbody th {color: #757575;font-weight: normal;}.data-table tbody {background: white;border-radius: 8px;box-shadow: 0 0 0 8px white;}.data-table h3, .data-table h5, .data-table h6 {margin-bottom: 0;}.data-table h3, .data-table h5 {color: var(--bs-body-color);}.accordion .table.data-table>thead>*>* {padding-bottom: 0;}.info-table tbody {display: inline-table;width: 100%;}.info-table td {font-weight: bold;}.info-table tr>td:first-child {font-weight: normal;color: #757575;}.ns:before {content: " ";}.nc:before {content: ",";}.trezor-logo {width: 128px;height: 32px;position: absolute;top: 16px;background-size: cover;background-image: url("data:image/svg+xml,%3Csvg style='width: 128px%3B' version='1.1' xmlns='http://www.w3.org/2000/svg' x='0px' y='0px' viewBox='0 0 163.7 41.9' space='preserve'%3E%3Cpolygon points='101.1 12.8 118.2 12.8 118.2 17.3 108.9 29.9 118.2 29.9 118.2 35.2 101.1 35.2 101.1 30.7 110.4 18.1 101.1 18.1'%3E%3C/polygon%3E%3Cpath d='M158.8 26.9c2.1-0.8 4.3-2.9 4.3-6.6c0-4.5-3.1-7.4-7.7-7.4h-10.5v22.3h5.8v-7.5h2.2l4.1 7.5h6.7L158.8 26.9z M154.7 22.5h-4V18h4c1.5 0 2.5 0.9 2.5 2.2C157.2 21.6 156.2 22.5 154.7 22.5z'%3E%3C/path%3E%3Cpath d='M130.8 12.5c-6.8 0-11.6 4.9-11.6 11.5s4.9 11.5 11.6 11.5s11.7-4.9 11.7-11.5S137.6 12.5 130.8 12.5z M130.8 30.3c-3.4 0-5.7-2.6-5.7-6.3c0-3.8 2.3-6.3 5.7-6.3c3.4 0 5.8 2.6 5.8 6.3C136.6 27.7 134.2 30.3 130.8 30.3z'%3E%3C/path%3E%3Cpolygon points='82.1 12.8 98.3 12.8 98.3 18 87.9 18 87.9 21.3 98 21.3 98 26.4 87.9 26.4 87.9 30 98.3 30 98.3 35.2 82.1 35.2'%3E%3C/polygon%3E%3Cpath d='M24.6 9.7C24.6 4.4 20 0 14.4 0S4.2 4.4 4.2 9.7v3.1H0v22.3h0l14.4 6.7l14.4-6.7h0V12.9h-4.2V9.7z M9.4 9.7c0-2.5 2.2-4.5 5-4.5s5 2 5 4.5v3.1H9.4V9.7z M23 31.5l-8.6 4l-8.6-4V18.1H23V31.5z'%3E%3C/path%3E%3Cpath d='M79.4 20.3c0-4.5-3.1-7.4-7.7-7.4H61.2v22.3H67v-7.5h2.2l4.1 7.5H80l-4.9-8.3C77.2 26.1 79.4 24 79.4 20.3z M71 22.5h-4V18h4c1.5 0 2.5 0.9 2.5 2.2C73.5 21.6 72.5 22.5 71 22.5z'%3E%3C/path%3E%3Cpolygon points='40.5 12.8 58.6 12.8 58.6 18.1 52.4 18.1 52.4 35.2 46.6 35.2 46.6 18.1 40.5 18.1'%3E%3C/polygon%3E%3C/svg%3E");}.copyable::before, .copied::before {width: 18px;height: 16px;margin: 3px -18px;content: "";position: absolute;background-size: cover;}.copyable::before {display: none;cursor: copy;background-image: url("data:image/svg+xml,%3Csvg width='18' height='16' viewBox='0 0 18 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10.5 10.4996H13.5V2.49963H5.5V5.49963' stroke='%2300854D' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M10.4998 5.49976H2.49976V13.4998H10.4998V5.49976Z' stroke='%2300854D' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");}.copyable:hover::before {display: inline-block;}.copied::before {transition: all 0.4s ease;transform: scale(1.2);background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='16' viewBox='-30 -30 330 330'%3E%3Cpath d='M 30,180 90,240 240,30' style='stroke:%2300854D;stroke-width:32;fill:none'/%3E%3C/svg%3E");}.h-data {letter-spacing: 0.12em;font-weight: normal !important;}.tx-detail {background: #f6f6f6;color: #757575;border-radius: 10px;box-shadow: 0 0 0 10px white;width: calc(100% - 20px);margin-left: 10px;margin-top: 3rem;overflow-wrap: break-word;}.tx-detail:first-child {margin-top: 1rem;}.tx-detail:last-child {margin-bottom: 2rem;}.tx-detail span.ellipsis, .tx-detail a.ellipsis {display: block;float: left;max-width: 100%;}.tx-detail>.head, .tx-detail>.footer {padding: 1.5rem;--bs-gutter-x: 0;}.tx-detail>.head {border-radius: 10px 10px 0 0;}.tx-detail .txid {font-size: 106%;letter-spacing: -0.01em;}.tx-detail>.body {padding: 0 1.5rem;--bs-gutter-x: 0;letter-spacing: -0.01em;}.tx-detail>.subhead {padding: 1.5rem 1.5rem 0.4rem 1.5rem;--bs-gutter-x: 0;letter-spacing: 0.1em;text-transform: uppercase;color: var(--bs-body-color);}.tx-detail>.subhead-2 {padding: 0.3rem 1.5rem 0 1.5rem;--bs-gutter-x: 0;font-size: .875em;color: var(--bs-body-color);}.tx-in .col-12, .tx-out .col-12, .tx-addr .col-12 {background-color: white;padding: 1.2rem 1.3rem;border-bottom: 1px solid #f6f6f6;}.amt-out {padding: 1.2rem 0 1.2rem 1rem;text-align: right;overflow-wrap: break-word;}.tx-in .col-12:last-child, .tx-out .col-12:last-child {border-bottom: none;}.tx-own {background-color: #fff9e3 !important;}.tx-amt {float: right !important;}.spent {color: #dc3545 !important;}.unspent {color: #28a745 !important;}.outpoint {color: #757575 !important;}.spent, .unspent, .outpoint {display: inline-block;text-align: right;min-width: 18px;text-decoration: none !important;}.octicon {height: 24px;width: 24px;margin-left: -12px;margin-top: 19px;position: absolute;background-size: cover;background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9 4.5L16.5 12L9 19.5' stroke='%23AFAFAF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A");}.txvalue {color: var(--bs-body-color);font-weight: bold;}.txerror {color: #c51f13;}.txerror a, .txerror .txvalue {color: #c51f13;}.txerror .copyable::before, .txerror .copied::before {filter: invert(86%) sepia(43%) saturate(732%) hue-rotate(367deg) brightness(84%);}.tx-amt .amt:hover, .tx-amt.amt:hover, .amt-out>.amt:hover {color: var(--bs-body-color);}.prim-amt {display: initial;}.sec-amt {display: none;}.csec-amt {display: none;}.base-amt {display: none;}.cbase-amt {display: none;}.tooltip {--bs-tooltip-opacity: 1;--bs-tooltip-max-width: 380px;--bs-tooltip-bg: #fff;--bs-tooltip-color: var(--bs-body-color);--bs-tooltip-padding-x: 1rem;--bs-tooltip-padding-y: 0.8rem;filter: drop-shadow(0px 24px 64px rgba(22, 27, 45, 0.25));}.l-tooltip {text-align: start;display: inline-block;}.l-tooltip .prim-amt, .l-tooltip .sec-amt, .l-tooltip .csec-amt, .l-tooltip .base-amt, .l-tooltip .cbase-amt {display: initial;float: right;}.l-tooltip .amt-time {padding-right: 3rem;float: left;}.amt-dec {font-size: 95%;}.unconfirmed {color: white;background-color: #c51e13;padding: 0.7rem 1.2rem;border-radius: 1.4rem;}.json {word-wrap: break-word;font-size: smaller;background: #002b31;border-radius: 8px;}#raw {padding: 1.5rem 2rem;color: #ffffff;letter-spacing: 0.02em;}#raw .string {color: #2bca87;}#raw .number, #raw .boolean {color: #efc941;}#raw .null {color: red;}@media (max-width: 768px) {body {font-size: 0.8rem;background: linear-gradient(to bottom, #f6f6f6 500px, #e5e5e5 0), #e5e5e5;}.container {padding-left: 2px;padding-right: 2px;}.accordion-body {padding: var(--bs-accordion-body-padding-y) 0;}.octicon {scale: 60% !important;margin-top: -2px;}.unconfirmed {padding: 0.1rem 0.8rem;}.btn {--bs-btn-font-size: 0.8rem;}}@media (max-width: 991px) {#header .container {min-height: 40px;}#header .dropdown-menu[data-bs-popper] {left: 0;right: initial;}.trezor-logo {top: 10px;}.octicon {scale: 80%;}.table.data-table>:not(caption)>*>* {padding: 0.8rem 0.4rem;}.tx-in .col-12, .tx-out .col-12, .tx-addr .col-12 {padding: 0.7rem 1.1rem;}.amt-out {padding: 0.7rem 0 0.7rem 1rem }}@media (min-width: 769px) {body {font-size: 0.9rem;}.btn {--bs-btn-font-size: 0.9rem;}}@media (min-width: 1200px) {.h1, h1 {font-size: 2.4rem;}body {font-size: 1rem;}.btn {--bs-btn-font-size: 1rem;}} \ No newline at end of file diff --git a/static/js/main.js b/static/js/main.js index d729efc9..b1d31408 100644 --- a/static/js/main.js +++ b/static/js/main.js @@ -85,6 +85,79 @@ function addressAliasTooltip() { return `${type}
${address}
`; } +function handleTxPage(rawData, txId) { + const rawOutput = document.getElementById('raw'); + const rawButton = document.getElementById('raw-button'); + const rawHexButton = document.getElementById('raw-hex-button'); + + rawOutput.innerHTML = syntaxHighlight(rawData); + + let isShowingHexData = false; + + const memoizedResponses = {}; + + async function getTransactionHex(txId) { + // BTC-like coins have a 'hex' field in the raw data + if (rawData['hex']) { + return rawData['hex']; + } + if (memoizedResponses[txId]) { + return memoizedResponses[txId]; + } + const fetchedData = await fetchTransactionHex(txId); + memoizedResponses[txId] = fetchedData; + return fetchedData; + } + + async function fetchTransactionHex(txId) { + const response = await fetch(`/api/rawtx/${txId}`); + if (!response.ok) { + throw new Error(`Error fetching data: ${response.status}`); + } + const txHex = await response.text(); + const hexWithoutQuotes = txHex.replace(/"/g, ''); + return hexWithoutQuotes; + } + + function updateButtonStyles() { + if (isShowingHexData) { + rawButton.classList.add('active'); + rawButton.style.fontWeight = 'normal'; + rawHexButton.classList.remove('active'); + rawHexButton.style.fontWeight = 'bold'; + } else { + rawButton.classList.remove('active'); + rawButton.style.fontWeight = 'bold'; + rawHexButton.classList.add('active'); + rawHexButton.style.fontWeight = 'normal'; + } + } + + updateButtonStyles(); + + rawHexButton.addEventListener('click', async () => { + if (!isShowingHexData) { + try { + const txHex = await getTransactionHex(txId); + rawOutput.textContent = txHex; + } catch (error) { + console.error('Error fetching raw transaction hex:', error); + rawOutput.textContent = `Error fetching raw transaction hex: ${error.message}`; + } + isShowingHexData = true; + updateButtonStyles(); + } + }); + + rawButton.addEventListener('click', () => { + if (isShowingHexData) { + rawOutput.innerHTML = syntaxHighlight(rawData); + isShowingHexData = false; + updateButtonStyles(); + } + }); +} + window.addEventListener("DOMContentLoaded", () => { const a = getCoinCookie(); if (a?.length === 3) { @@ -127,7 +200,8 @@ window.addEventListener("DOMContentLoaded", () => { if (e.clientX < e.target.getBoundingClientRect().x) { let t = e.target.getAttribute("cc"); if (!t) t = e.target.innerText; - navigator.clipboard.writeText(t); + const textToCopy = t.trim(); + navigator.clipboard.writeText(textToCopy); e.target.className = e.target.className.replace("copyable", "copied"); setTimeout( () => diff --git a/static/js/main.min.3.js b/static/js/main.min.3.js deleted file mode 100644 index 72a9ffe0..00000000 --- a/static/js/main.min.3.js +++ /dev/null @@ -1 +0,0 @@ -function syntaxHighlight(t){return(t=(t=JSON.stringify(t,void 0,2)).replace(/&/g,"&").replace(//g,">")).length>1e6?`${t}`:t.replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g,t=>{let e="number";return/^"/.test(t)?e=/:$/.test(t)?"key":"string":/true|false/.test(t)?e="boolean":/null/.test(t)&&(e="null"),`${t}`})}function getCoinCookie(){if(hasSecondary)return document.cookie.split("; ").find(t=>t.startsWith("secondary_coin="))?.split("=")}function changeCSSStyle(t,e,l){let a=document.all?"rules":"cssRules";for(i=0,len=document.styleSheets[1][a].length;i`;if(a){let n=a.getAttribute("tm");n||(n="now"),r+=`${n}${a.outerHTML}
`}if(s&&(r+=`now${s.outerHTML}
`),e){let o=e.getAttribute("tm");o||(o="now"),r+=`${o}${e.outerHTML}
`}return l&&(r+=`now${l.outerHTML}
`),`${r}`}function addressAliasTooltip(){let t=this.getAttribute("alias-type"),e=this.getAttribute("cc");return`${t}
${e}
`}window.addEventListener("DOMContentLoaded",()=>{let t=getCoinCookie();t?.length===3&&("true"===t[2]&&(changeCSSStyle(".prim-amt","display","none"),changeCSSStyle(".sec-amt","display","initial")),document.querySelectorAll(".amt").forEach(t=>new bootstrap.Tooltip(t,{title:amountTooltip,html:!0}))),document.querySelectorAll("[alias-type]").forEach(t=>new bootstrap.Tooltip(t,{title:addressAliasTooltip,html:!0})),document.querySelectorAll("[tt]").forEach(t=>new bootstrap.Tooltip(t,{title:t.getAttribute("tt")})),document.querySelectorAll("#header .bb-group>.btn-check").forEach(t=>t.addEventListener("click",t=>{let e=getCoinCookie(),l="secondary-coin"===t.target.id;e?.length===3&&"true"===e[2]!==l&&(document.cookie=`${e[0]}=${e[1]}=${l}; Path=/`,changeCSSStyle(".prim-amt","display",l?"none":"initial"),changeCSSStyle(".sec-amt","display",l?"initial":"none"))})),document.querySelectorAll(".copyable").forEach(t=>t.addEventListener("click",t=>{if(t.clientXt.target.className=t.target.className.replace("copied","copyable"),1e3),t.preventDefault()}}))}); \ No newline at end of file diff --git a/static/js/main.min.4.js b/static/js/main.min.4.js new file mode 100644 index 00000000..5e237185 --- /dev/null +++ b/static/js/main.min.4.js @@ -0,0 +1 @@ +function syntaxHighlight(t){return(t=(t=JSON.stringify(t,void 0,2)).replace(/&/g,"&").replace(//g,">")).length>1e6?`${t}`:t.replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g,(t=>{let e="number";return/^"/.test(t)?e=/:$/.test(t)?"key":"string":/true|false/.test(t)?e="boolean":/null/.test(t)&&(e="null"),`${t}`}))}function getCoinCookie(){if(hasSecondary)return document.cookie.split("; ").find((t=>t.startsWith("secondary_coin=")))?.split("=")}function changeCSSStyle(t,e,n){const a=document.all?"rules":"cssRules";for(i=0,len=document.styleSheets[1][a].length;i`;if(a){let t=a.getAttribute("tm");t||(t="now"),i+=`${t}${a.outerHTML}
`}if(o&&(i+=`now${o.outerHTML}
`),e){let t=e.getAttribute("tm");t||(t="now"),i+=`${t}${e.outerHTML}
`}return n&&(i+=`now${n.outerHTML}
`),`${i}`}function addressAliasTooltip(){return`${this.getAttribute("alias-type")}
${this.getAttribute("cc")}
`}function handleTxPage(t,e){const n=document.getElementById("raw"),a=document.getElementById("raw-button"),o=document.getElementById("raw-hex-button");n.innerHTML=syntaxHighlight(t);let i=!1;const r={};async function s(e){if(t.hex)return t.hex;if(r[e])return r[e];const n=await async function(t){const e=await fetch(`/api/rawtx/${t}`);if(!e.ok)throw new Error(`Error fetching data: ${e.status}`);const n=await e.text();return n.replace(/"/g,"")}(e);return r[e]=n,n}function l(){i?(a.classList.add("active"),a.style.fontWeight="normal",o.classList.remove("active"),o.style.fontWeight="bold"):(a.classList.remove("active"),a.style.fontWeight="bold",o.classList.add("active"),o.style.fontWeight="normal")}l(),o.addEventListener("click",(async()=>{if(!i){try{const t=await s(e);n.textContent=t}catch(t){console.error("Error fetching raw transaction hex:",t),n.textContent=`Error fetching raw transaction hex: ${t.message}`}i=!0,l()}})),a.addEventListener("click",(()=>{i&&(n.innerHTML=syntaxHighlight(t),i=!1,l())}))}window.addEventListener("DOMContentLoaded",(()=>{const t=getCoinCookie();3===t?.length&&("true"===t[2]&&(changeCSSStyle(".prim-amt","display","none"),changeCSSStyle(".sec-amt","display","initial")),document.querySelectorAll(".amt").forEach((t=>new bootstrap.Tooltip(t,{title:amountTooltip,html:!0})))),document.querySelectorAll("[alias-type]").forEach((t=>new bootstrap.Tooltip(t,{title:addressAliasTooltip,html:!0}))),document.querySelectorAll("[tt]").forEach((t=>new bootstrap.Tooltip(t,{title:t.getAttribute("tt")}))),document.querySelectorAll("#header .bb-group>.btn-check").forEach((t=>t.addEventListener("click",(t=>{const e=getCoinCookie(),n="secondary-coin"===t.target.id;3===e?.length&&"true"===e[2]!==n&&(document.cookie=`${e[0]}=${e[1]}=${n}; Path=/`,changeCSSStyle(".prim-amt","display",n?"none":"initial"),changeCSSStyle(".sec-amt","display",n?"initial":"none"))})))),document.querySelectorAll(".copyable").forEach((t=>t.addEventListener("click",(t=>{if(t.clientXt.target.className=t.target.className.replace("copied","copyable")),1e3),t.preventDefault()}}))))})); \ No newline at end of file diff --git a/static/templates/tx.html b/static/templates/tx.html index f148f984..5d518d70 100644 --- a/static/templates/tx.html +++ b/static/templates/tx.html @@ -182,13 +182,19 @@ {{end}} {{end}}
-
Raw Transaction
-
-

+    
+    
+    
+

     
-
{{end}} diff --git a/tests/dbtestdata/fakechain_ethereumtype.go b/tests/dbtestdata/fakechain_ethereumtype.go index a8469271..3722ef41 100644 --- a/tests/dbtestdata/fakechain_ethereumtype.go +++ b/tests/dbtestdata/fakechain_ethereumtype.go @@ -139,6 +139,11 @@ func (c *fakeBlockChainEthereumType) EthereumTypeRpcCall(data, to, from string) return data + "abcd", nil } +// EthereumTypeGetRawTransaction returns simulated transaction hex data +func (c *fakeBlockChainEthereumType) EthereumTypeGetRawTransaction(txid string) (string, error) { + return txid + "abcd", nil +} + // GetTokenURI returns URI derived from the input contractDesc func (c *fakeBlockChainEthereumType) GetTokenURI(contractDesc bchain.AddressDescriptor, tokenID *big.Int) (string, error) { return "https://ipfs.io/ipfs/" + contractDesc.String()[3:] + ".json", nil From c3cdf9bca4ca1e2b9e31b83e2aa849260f86901b Mon Sep 17 00:00:00 2001 From: Martin Boehm Date: Mon, 9 Dec 2024 20:57:37 +0100 Subject: [PATCH 44/56] Fix usage of Network configuration parameter --- bchain/coins/eth/ethrpc.go | 7 +------ bchain/coins/eth/stakingpool.go | 6 +++++- db/bulkconnect.go | 11 ++++++----- fiat/fiat_rates.go | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/bchain/coins/eth/ethrpc.go b/bchain/coins/eth/ethrpc.go index 1412b0e7..6ed4b144 100644 --- a/bchain/coins/eth/ethrpc.go +++ b/bchain/coins/eth/ethrpc.go @@ -160,12 +160,7 @@ func (b *EthereumRPC) Initialize() error { return errors.Errorf("Unknown network id %v", id) } - networkConfig := b.ChainConfig.Network - if networkConfig == "" { - networkConfig = b.ChainConfig.CoinShortcut - } - - err = b.initStakingPools(networkConfig) + err = b.initStakingPools() if err != nil { return err } diff --git a/bchain/coins/eth/stakingpool.go b/bchain/coins/eth/stakingpool.go index f773dae9..659307c8 100644 --- a/bchain/coins/eth/stakingpool.go +++ b/bchain/coins/eth/stakingpool.go @@ -11,7 +11,11 @@ import ( "github.com/trezor/blockbook/bchain" ) -func (b *EthereumRPC) initStakingPools(network string) error { +func (b *EthereumRPC) initStakingPools() error { + network := b.ChainConfig.Network + if network == "" { + network = b.ChainConfig.CoinShortcut + } // for now only single staking pool envVar := strings.ToUpper(network) + "_STAKING_POOL_CONTRACT" envValue := os.Getenv(envVar) diff --git a/db/bulkconnect.go b/db/bulkconnect.go index 2a044bc1..8c2095bf 100644 --- a/db/bulkconnect.go +++ b/db/bulkconnect.go @@ -438,6 +438,11 @@ func (b *BulkConnect) Close() error { return err } } + if err := b.d.SetInconsistentState(false); err != nil { + return err + } + glog.Info("rocksdb: bulk connect closed, db set to open state") + bt, err := b.d.loadBlockTimes() if err != nil { return err @@ -446,11 +451,7 @@ func (b *BulkConnect) Close() error { if b.d.metrics != nil { b.d.metrics.AvgBlockPeriod.Set(float64(avg)) } - - if err := b.d.SetInconsistentState(false); err != nil { - return err - } - glog.Info("rocksdb: bulk connect closed, db set to open state") + glog.Info("rocksdb: processed block times") b.d = nil return nil } diff --git a/fiat/fiat_rates.go b/fiat/fiat_rates.go index 13e7168f..d6ead4bb 100644 --- a/fiat/fiat_rates.go +++ b/fiat/fiat_rates.go @@ -108,7 +108,7 @@ func NewFiatRates(db *db.RocksDB, config *common.Config, metrics *common.Metrics // a small hack - in tests the callback is not used, therefore there is no delay slowing down the test throttle = false } - fr.downloader = NewCoinGeckoDownloader(db, db.GetInternalState().CoinShortcut, rdParams.URL, rdParams.Coin, rdParams.PlatformIdentifier, rdParams.PlatformVsCurrency, fr.allowedVsCurrencies, fr.timeFormat, metrics, throttle) + fr.downloader = NewCoinGeckoDownloader(db, db.GetInternalState().GetNetwork(), rdParams.URL, rdParams.Coin, rdParams.PlatformIdentifier, rdParams.PlatformVsCurrency, fr.allowedVsCurrencies, fr.timeFormat, metrics, throttle) if is != nil { is.HasFiatRates = true is.HasTokenFiatRates = fr.downloadTokens From f2cd67e81f6245c5291624f0e409200d42542b4a Mon Sep 17 00:00:00 2001 From: hishope Date: Sun, 1 Dec 2024 21:38:31 +0800 Subject: [PATCH 45/56] chore: fix some problematic function names Signed-off-by: hishope --- bchain/basechain.go | 2 +- bchain/coins/blockchain.go | 2 +- bchain/coins/eth/contract.go | 2 +- db/rocksdb_ethereumtype.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bchain/basechain.go b/bchain/basechain.go index e6da4281..5618c1d7 100644 --- a/bchain/basechain.go +++ b/bchain/basechain.go @@ -64,7 +64,7 @@ func (b *BaseChain) EthereumTypeGetErc20ContractBalance(addrDesc, contractDesc A return nil, errors.New("not supported") } -// GetContractInfo returns URI of non fungible or multi token defined by token id +// GetTokenURI returns URI of non fungible or multi token defined by token id func (p *BaseChain) GetTokenURI(contractDesc AddressDescriptor, tokenID *big.Int) (string, error) { return "", errors.New("not supported") } diff --git a/bchain/coins/blockchain.go b/bchain/coins/blockchain.go index 77e7206a..e694dafc 100644 --- a/bchain/coins/blockchain.go +++ b/bchain/coins/blockchain.go @@ -333,7 +333,7 @@ func (c *blockChainWithMetrics) EthereumTypeGetErc20ContractBalance(addrDesc, co return c.b.EthereumTypeGetErc20ContractBalance(addrDesc, contractDesc) } -// GetContractInfo returns URI of non fungible or multi token defined by token id +// GetTokenURI returns URI of non fungible or multi token defined by token id func (c *blockChainWithMetrics) GetTokenURI(contractDesc bchain.AddressDescriptor, tokenID *big.Int) (v string, err error) { defer func(s time.Time) { c.observeRPCLatency("GetTokenURI", s, err) }(time.Now()) return c.b.GetTokenURI(contractDesc, tokenID) diff --git a/bchain/coins/eth/contract.go b/bchain/coins/eth/contract.go index efc7439a..6dbca33e 100644 --- a/bchain/coins/eth/contract.go +++ b/bchain/coins/eth/contract.go @@ -356,7 +356,7 @@ func (b *EthereumRPC) EthereumTypeGetErc20ContractBalance(addrDesc, contractDesc return r, nil } -// GetContractInfo returns URI of non fungible or multi token defined by token id +// GetTokenURI returns URI of non fungible or multi token defined by token id func (b *EthereumRPC) GetTokenURI(contractDesc bchain.AddressDescriptor, tokenID *big.Int) (string, error) { address := hexutil.Encode(contractDesc) // CryptoKitties do not fully support ERC721 standard, do not have tokenURI method diff --git a/db/rocksdb_ethereumtype.go b/db/rocksdb_ethereumtype.go index 29bff516..11371a79 100644 --- a/db/rocksdb_ethereumtype.go +++ b/db/rocksdb_ethereumtype.go @@ -124,7 +124,7 @@ type AddrContracts struct { Contracts []AddrContract } -// packAddrContract packs AddrContracts into a byte buffer +// packAddrContracts packs AddrContracts into a byte buffer func packAddrContracts(acs *AddrContracts) []byte { buf := make([]byte, 0, 128) varBuf := make([]byte, maxPackedBigintBytes) From 144a369f922e56fce56db954424fbfcd4e701c6c Mon Sep 17 00:00:00 2001 From: Martin Boehm Date: Mon, 9 Dec 2024 21:40:00 +0100 Subject: [PATCH 46/56] Fix Ethereum SENSO contract decimals #1026 --- configs/contract-fix/ethereum.json | 1 + 1 file changed, 1 insertion(+) create mode 100644 configs/contract-fix/ethereum.json diff --git a/configs/contract-fix/ethereum.json b/configs/contract-fix/ethereum.json new file mode 100644 index 00000000..5b6dc03e --- /dev/null +++ b/configs/contract-fix/ethereum.json @@ -0,0 +1 @@ +[{"type":"ERC20","contract":"0xC19B6A4Ac7C7Cc24459F08984Bbd09664af17bD1","name":"Sensorium","symbol":"SENSO","decimals":0,"createdInBlock":11098997}] From 6f4a6aa8e3252457d28ff457f952f0a41255f9db Mon Sep 17 00:00:00 2001 From: Martin Boehm Date: Mon, 9 Dec 2024 23:10:47 +0100 Subject: [PATCH 47/56] Remove Coingecko URL from configs to enable support of API key --- configs/coins/arbitrum.json | 2 +- configs/coins/arbitrum_archive.json | 2 +- configs/coins/arbitrum_nova.json | 124 +++++++++++----------- configs/coins/arbitrum_nova_archive.json | 128 +++++++++++------------ configs/coins/optimism.json | 2 +- configs/coins/optimism_archive.json | 2 +- configs/coins/polygon.json | 2 +- configs/coins/polygon_archive.json | 2 +- 8 files changed, 132 insertions(+), 132 deletions(-) diff --git a/configs/coins/arbitrum.json b/configs/coins/arbitrum.json index b1f01711..d4a4ff49 100644 --- a/configs/coins/arbitrum.json +++ b/configs/coins/arbitrum.json @@ -55,7 +55,7 @@ "queryBackendOnMempoolResync": false, "fiat_rates": "coingecko", "fiat_rates_vs_currencies": "AED,ARS,AUD,BDT,BHD,BMD,BRL,CAD,CHF,CLP,CNY,CZK,DKK,EUR,GBP,HKD,HUF,IDR,ILS,INR,JPY,KRW,KWD,LKR,MMK,MXN,MYR,NGN,NOK,NZD,PHP,PKR,PLN,RUB,SAR,SEK,SGD,THB,TRY,TWD,UAH,USD,VEF,VND,ZAR,BTC,ETH", - "fiat_rates_params": "{\"url\": \"https://api.coingecko.com/api/v3\", \"coin\": \"ethereum\",\"platformIdentifier\": \"ethereum\",\"platformVsCurrency\": \"eth\",\"periodSeconds\": 900}" + "fiat_rates_params": "{\"coin\": \"ethereum\",\"platformIdentifier\": \"ethereum\",\"platformVsCurrency\": \"eth\",\"periodSeconds\": 900}" } } }, diff --git a/configs/coins/arbitrum_archive.json b/configs/coins/arbitrum_archive.json index f01d6c67..4d5bfb06 100644 --- a/configs/coins/arbitrum_archive.json +++ b/configs/coins/arbitrum_archive.json @@ -56,7 +56,7 @@ "queryBackendOnMempoolResync": false, "fiat_rates": "coingecko", "fiat_rates_vs_currencies": "AED,ARS,AUD,BDT,BHD,BMD,BRL,CAD,CHF,CLP,CNY,CZK,DKK,EUR,GBP,HKD,HUF,IDR,ILS,INR,JPY,KRW,KWD,LKR,MMK,MXN,MYR,NGN,NOK,NZD,PHP,PKR,PLN,RUB,SAR,SEK,SGD,THB,TRY,TWD,UAH,USD,VEF,VND,ZAR,BTC,ETH", - "fiat_rates_params": "{\"url\": \"https://api.coingecko.com/api/v3\", \"coin\": \"ethereum\",\"platformIdentifier\": \"ethereum\",\"platformVsCurrency\": \"eth\",\"periodSeconds\": 900}", + "fiat_rates_params": "{\"coin\": \"ethereum\",\"platformIdentifier\": \"ethereum\",\"platformVsCurrency\": \"eth\",\"periodSeconds\": 900}", "fourByteSignatures": "https://www.4byte.directory/api/v1/signatures/" } } diff --git a/configs/coins/arbitrum_nova.json b/configs/coins/arbitrum_nova.json index 0d0a252b..55d20d7d 100644 --- a/configs/coins/arbitrum_nova.json +++ b/configs/coins/arbitrum_nova.json @@ -1,65 +1,65 @@ { - "coin": { - "name": "Arbitrum Nova", - "shortcut": "ETH", - "label": "Arbitrum Nova", - "alias": "arbitrum_nova" - }, - "ports": { - "backend_rpc": 8207, - "backend_p2p": 38407, - "backend_http": 8307, - "blockbook_internal": 9207, - "blockbook_public": 9307 - }, - "ipc": { - "rpc_url_template": "ws://127.0.0.1:{{.Ports.BackendRPC}}", - "rpc_timeout": 25 - }, - "backend": { - "package_name": "backend-arbitrum-nova", - "package_revision": "satoshilabs-1", - "system_user": "arbitrum", - "version": "3.2.1", - "docker_image": "offchainlabs/nitro-node:v3.2.1-d81324d", - "verification_type": "docker", - "verification_source": "724ebdcca39cd0c28ffd025ecea8d1622a376f41344201b729afb60352cbc306", - "extract_command": "docker cp extract:/home/user/target backend/target; docker cp extract:/home/user/nitro-legacy backend/nitro-legacy; docker cp extract:/usr/local/bin/nitro backend/nitro", - "exclude_files": [], - "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/arbitrum_nova_exec.sh 2>> {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", - "exec_script": "arbitrum_nova.sh", - "logrotate_files_template": "{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log", - "postinst_script_template": "openssl rand -hex 32 > {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/jwtsecret", - "service_type": "simple", - "service_additional_params_template": "", - "protect_memory": true, - "mainnet": true, - "server_config_file": "", - "client_config_file": "" - }, - "blockbook": { - "package_name": "blockbook-arbitrum-nova", - "system_user": "blockbook-arbitrum", - "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, - "additional_params": { - "mempoolTxTimeoutHours": 48, - "queryBackendOnMempoolResync": false, - "fiat_rates": "coingecko", - "fiat_rates_vs_currencies": "AED,ARS,AUD,BDT,BHD,BMD,BRL,CAD,CHF,CLP,CNY,CZK,DKK,EUR,GBP,HKD,HUF,IDR,ILS,INR,JPY,KRW,KWD,LKR,MMK,MXN,MYR,NGN,NOK,NZD,PHP,PKR,PLN,RUB,SAR,SEK,SGD,THB,TRY,TWD,UAH,USD,VEF,VND,ZAR,BTC,ETH", - "fiat_rates_params": "{\"url\": \"https://api.coingecko.com/api/v3\", \"coin\": \"ethereum\",\"platformIdentifier\": \"ethereum\",\"platformVsCurrency\": \"eth\",\"periodSeconds\": 900}" - } + "coin": { + "name": "Arbitrum Nova", + "shortcut": "ETH", + "label": "Arbitrum Nova", + "alias": "arbitrum_nova" + }, + "ports": { + "backend_rpc": 8207, + "backend_p2p": 38407, + "backend_http": 8307, + "blockbook_internal": 9207, + "blockbook_public": 9307 + }, + "ipc": { + "rpc_url_template": "ws://127.0.0.1:{{.Ports.BackendRPC}}", + "rpc_timeout": 25 + }, + "backend": { + "package_name": "backend-arbitrum-nova", + "package_revision": "satoshilabs-1", + "system_user": "arbitrum", + "version": "3.2.1", + "docker_image": "offchainlabs/nitro-node:v3.2.1-d81324d", + "verification_type": "docker", + "verification_source": "724ebdcca39cd0c28ffd025ecea8d1622a376f41344201b729afb60352cbc306", + "extract_command": "docker cp extract:/home/user/target backend/target; docker cp extract:/home/user/nitro-legacy backend/nitro-legacy; docker cp extract:/usr/local/bin/nitro backend/nitro", + "exclude_files": [], + "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/arbitrum_nova_exec.sh 2>> {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", + "exec_script": "arbitrum_nova.sh", + "logrotate_files_template": "{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log", + "postinst_script_template": "openssl rand -hex 32 > {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/jwtsecret", + "service_type": "simple", + "service_additional_params_template": "", + "protect_memory": true, + "mainnet": true, + "server_config_file": "", + "client_config_file": "" + }, + "blockbook": { + "package_name": "blockbook-arbitrum-nova", + "system_user": "blockbook-arbitrum", + "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, + "additional_params": { + "mempoolTxTimeoutHours": 48, + "queryBackendOnMempoolResync": false, + "fiat_rates": "coingecko", + "fiat_rates_vs_currencies": "AED,ARS,AUD,BDT,BHD,BMD,BRL,CAD,CHF,CLP,CNY,CZK,DKK,EUR,GBP,HKD,HUF,IDR,ILS,INR,JPY,KRW,KWD,LKR,MMK,MXN,MYR,NGN,NOK,NZD,PHP,PKR,PLN,RUB,SAR,SEK,SGD,THB,TRY,TWD,UAH,USD,VEF,VND,ZAR,BTC,ETH", + "fiat_rates_params": "{\"coin\": \"ethereum\",\"platformIdentifier\": \"ethereum\",\"platformVsCurrency\": \"eth\",\"periodSeconds\": 900}" + } + } + }, + "meta": { + "package_maintainer": "IT", + "package_maintainer_email": "it@satoshilabs.com" } - }, - "meta": { - "package_maintainer": "IT", - "package_maintainer_email": "it@satoshilabs.com" - } } diff --git a/configs/coins/arbitrum_nova_archive.json b/configs/coins/arbitrum_nova_archive.json index 05105976..d0833e45 100644 --- a/configs/coins/arbitrum_nova_archive.json +++ b/configs/coins/arbitrum_nova_archive.json @@ -1,67 +1,67 @@ { - "coin": { - "name": "Arbitrum Nova Archive", - "shortcut": "ETH", - "label": "Arbitrum Nova", - "alias": "arbitrum_nova_archive" - }, - "ports": { - "backend_rpc": 8308, - "backend_p2p": 38408, - "blockbook_internal": 9208, - "blockbook_public": 9308 - }, - "ipc": { - "rpc_url_template": "ws://127.0.0.1:{{.Ports.BackendRPC}}", - "rpc_timeout": 25 - }, - "backend": { - "package_name": "backend-arbitrum-nova-archive", - "package_revision": "satoshilabs-1", - "system_user": "arbitrum", - "version": "3.2.1", - "docker_image": "offchainlabs/nitro-node:v3.2.1-d81324d", - "verification_type": "docker", - "verification_source": "724ebdcca39cd0c28ffd025ecea8d1622a376f41344201b729afb60352cbc306", - "extract_command": "docker cp extract:/home/user/target backend/target; docker cp extract:/home/user/nitro-legacy backend/nitro-legacy; docker cp extract:/usr/local/bin/nitro backend/nitro", - "exclude_files": [], - "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/arbitrum_nova_archive_exec.sh 2>> {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", - "exec_script": "arbitrum_nova_archive.sh", - "logrotate_files_template": "{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log", - "postinst_script_template": "openssl rand -hex 32 > {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/jwtsecret", - "service_type": "simple", - "service_additional_params_template": "", - "protect_memory": true, - "mainnet": true, - "server_config_file": "", - "client_config_file": "" - }, - "blockbook": { - "package_name": "blockbook-arbitrum-nova-archive", - "system_user": "blockbook-arbitrum", - "internal_binding_template": ":{{.Ports.BlockbookInternal}}", - "public_binding_template": ":{{.Ports.BlockbookPublic}}", - "explorer_url": "", - "additional_params": "-workers=16", - "block_chain": { - "parse": true, - "mempool_workers": 8, - "mempool_sub_workers": 2, - "block_addresses_to_keep": 600, - "additional_params": { - "address_aliases": true, - "mempoolTxTimeoutHours": 48, - "processInternalTransactions": true, - "queryBackendOnMempoolResync": false, - "fiat_rates": "coingecko", - "fiat_rates_vs_currencies": "AED,ARS,AUD,BDT,BHD,BMD,BRL,CAD,CHF,CLP,CNY,CZK,DKK,EUR,GBP,HKD,HUF,IDR,ILS,INR,JPY,KRW,KWD,LKR,MMK,MXN,MYR,NGN,NOK,NZD,PHP,PKR,PLN,RUB,SAR,SEK,SGD,THB,TRY,TWD,UAH,USD,VEF,VND,ZAR,BTC,ETH", - "fiat_rates_params": "{\"url\": \"https://api.coingecko.com/api/v3\", \"coin\": \"ethereum\",\"platformIdentifier\": \"ethereum\",\"platformVsCurrency\": \"eth\",\"periodSeconds\": 900}", - "fourByteSignatures": "https://www.4byte.directory/api/v1/signatures/" - } + "coin": { + "name": "Arbitrum Nova Archive", + "shortcut": "ETH", + "label": "Arbitrum Nova", + "alias": "arbitrum_nova_archive" + }, + "ports": { + "backend_rpc": 8308, + "backend_p2p": 38408, + "blockbook_internal": 9208, + "blockbook_public": 9308 + }, + "ipc": { + "rpc_url_template": "ws://127.0.0.1:{{.Ports.BackendRPC}}", + "rpc_timeout": 25 + }, + "backend": { + "package_name": "backend-arbitrum-nova-archive", + "package_revision": "satoshilabs-1", + "system_user": "arbitrum", + "version": "3.2.1", + "docker_image": "offchainlabs/nitro-node:v3.2.1-d81324d", + "verification_type": "docker", + "verification_source": "724ebdcca39cd0c28ffd025ecea8d1622a376f41344201b729afb60352cbc306", + "extract_command": "docker cp extract:/home/user/target backend/target; docker cp extract:/home/user/nitro-legacy backend/nitro-legacy; docker cp extract:/usr/local/bin/nitro backend/nitro", + "exclude_files": [], + "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/arbitrum_nova_archive_exec.sh 2>> {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", + "exec_script": "arbitrum_nova_archive.sh", + "logrotate_files_template": "{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log", + "postinst_script_template": "openssl rand -hex 32 > {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/jwtsecret", + "service_type": "simple", + "service_additional_params_template": "", + "protect_memory": true, + "mainnet": true, + "server_config_file": "", + "client_config_file": "" + }, + "blockbook": { + "package_name": "blockbook-arbitrum-nova-archive", + "system_user": "blockbook-arbitrum", + "internal_binding_template": ":{{.Ports.BlockbookInternal}}", + "public_binding_template": ":{{.Ports.BlockbookPublic}}", + "explorer_url": "", + "additional_params": "-workers=16", + "block_chain": { + "parse": true, + "mempool_workers": 8, + "mempool_sub_workers": 2, + "block_addresses_to_keep": 600, + "additional_params": { + "address_aliases": true, + "mempoolTxTimeoutHours": 48, + "processInternalTransactions": true, + "queryBackendOnMempoolResync": false, + "fiat_rates": "coingecko", + "fiat_rates_vs_currencies": "AED,ARS,AUD,BDT,BHD,BMD,BRL,CAD,CHF,CLP,CNY,CZK,DKK,EUR,GBP,HKD,HUF,IDR,ILS,INR,JPY,KRW,KWD,LKR,MMK,MXN,MYR,NGN,NOK,NZD,PHP,PKR,PLN,RUB,SAR,SEK,SGD,THB,TRY,TWD,UAH,USD,VEF,VND,ZAR,BTC,ETH", + "fiat_rates_params": "{\"coin\": \"ethereum\",\"platformIdentifier\": \"ethereum\",\"platformVsCurrency\": \"eth\",\"periodSeconds\": 900}", + "fourByteSignatures": "https://www.4byte.directory/api/v1/signatures/" + } + } + }, + "meta": { + "package_maintainer": "IT", + "package_maintainer_email": "it@satoshilabs.com" } - }, - "meta": { - "package_maintainer": "IT", - "package_maintainer_email": "it@satoshilabs.com" - } } diff --git a/configs/coins/optimism.json b/configs/coins/optimism.json index 07ab65ec..af77dbdb 100644 --- a/configs/coins/optimism.json +++ b/configs/coins/optimism.json @@ -56,7 +56,7 @@ "queryBackendOnMempoolResync": false, "fiat_rates": "coingecko", "fiat_rates_vs_currencies": "AED,ARS,AUD,BDT,BHD,BMD,BRL,CAD,CHF,CLP,CNY,CZK,DKK,EUR,GBP,HKD,HUF,IDR,ILS,INR,JPY,KRW,KWD,LKR,MMK,MXN,MYR,NGN,NOK,NZD,PHP,PKR,PLN,RUB,SAR,SEK,SGD,THB,TRY,TWD,UAH,USD,VEF,VND,ZAR,BTC,ETH", - "fiat_rates_params": "{\"url\": \"https://api.coingecko.com/api/v3\", \"coin\": \"ethereum\",\"platformIdentifier\": \"ethereum\",\"platformVsCurrency\": \"eth\",\"periodSeconds\": 900}" + "fiat_rates_params": "{\"coin\": \"ethereum\",\"platformIdentifier\": \"ethereum\",\"platformVsCurrency\": \"eth\",\"periodSeconds\": 900}" } } }, diff --git a/configs/coins/optimism_archive.json b/configs/coins/optimism_archive.json index 46967e5e..3c54d7bc 100644 --- a/configs/coins/optimism_archive.json +++ b/configs/coins/optimism_archive.json @@ -58,7 +58,7 @@ "queryBackendOnMempoolResync": false, "fiat_rates": "coingecko", "fiat_rates_vs_currencies": "AED,ARS,AUD,BDT,BHD,BMD,BRL,CAD,CHF,CLP,CNY,CZK,DKK,EUR,GBP,HKD,HUF,IDR,ILS,INR,JPY,KRW,KWD,LKR,MMK,MXN,MYR,NGN,NOK,NZD,PHP,PKR,PLN,RUB,SAR,SEK,SGD,THB,TRY,TWD,UAH,USD,VEF,VND,ZAR,BTC,ETH", - "fiat_rates_params": "{\"url\": \"https://api.coingecko.com/api/v3\", \"coin\": \"ethereum\",\"platformIdentifier\": \"ethereum\",\"platformVsCurrency\": \"eth\",\"periodSeconds\": 900}", + "fiat_rates_params": "{\"coin\": \"ethereum\",\"platformIdentifier\": \"ethereum\",\"platformVsCurrency\": \"eth\",\"periodSeconds\": 900}", "fourByteSignatures": "https://www.4byte.directory/api/v1/signatures/" } } diff --git a/configs/coins/polygon.json b/configs/coins/polygon.json index 3a71d101..19367240 100644 --- a/configs/coins/polygon.json +++ b/configs/coins/polygon.json @@ -55,7 +55,7 @@ "queryBackendOnMempoolResync": false, "fiat_rates": "coingecko", "fiat_rates_vs_currencies": "AED,ARS,AUD,BDT,BHD,BMD,BRL,CAD,CHF,CLP,CNY,CZK,DKK,EUR,GBP,HKD,HUF,IDR,ILS,INR,JPY,KRW,KWD,LKR,MMK,MXN,MYR,NGN,NOK,NZD,PHP,PKR,PLN,RUB,SAR,SEK,SGD,THB,TRY,TWD,UAH,USD,VEF,VND,ZAR,BTC,ETH", - "fiat_rates_params": "{\"url\": \"https://api.coingecko.com/api/v3\", \"coin\": \"matic-network\",\"platformIdentifier\": \"polygon-pos\",\"platformVsCurrency\": \"usd\",\"periodSeconds\": 900}" + "fiat_rates_params": "{\"coin\": \"matic-network\",\"platformIdentifier\": \"polygon-pos\",\"platformVsCurrency\": \"usd\",\"periodSeconds\": 900}" } } }, diff --git a/configs/coins/polygon_archive.json b/configs/coins/polygon_archive.json index 817d22bf..d7a1744d 100644 --- a/configs/coins/polygon_archive.json +++ b/configs/coins/polygon_archive.json @@ -57,7 +57,7 @@ "queryBackendOnMempoolResync": false, "fiat_rates": "coingecko", "fiat_rates_vs_currencies": "AED,ARS,AUD,BDT,BHD,BMD,BRL,CAD,CHF,CLP,CNY,CZK,DKK,EUR,GBP,HKD,HUF,IDR,ILS,INR,JPY,KRW,KWD,LKR,MMK,MXN,MYR,NGN,NOK,NZD,PHP,PKR,PLN,RUB,SAR,SEK,SGD,THB,TRY,TWD,UAH,USD,VEF,VND,ZAR,BTC,ETH", - "fiat_rates_params": "{\"url\": \"https://api.coingecko.com/api/v3\", \"coin\": \"matic-network\",\"platformIdentifier\": \"polygon-pos\",\"platformVsCurrency\": \"usd\",\"periodSeconds\": 900}", + "fiat_rates_params": "{\"coin\": \"matic-network\",\"platformIdentifier\": \"polygon-pos\",\"platformVsCurrency\": \"usd\",\"periodSeconds\": 900}", "fourByteSignatures": "https://www.4byte.directory/api/v1/signatures/" } } From 22fe25b9cf427b74e2410d2fc6e1669b2251cd7a Mon Sep 17 00:00:00 2001 From: Martin Boehm Date: Tue, 10 Dec 2024 00:32:15 +0100 Subject: [PATCH 48/56] Fix Arbitrum and Optimism fiat rates ids --- configs/coins/arbitrum.json | 2 +- configs/coins/arbitrum_archive.json | 2 +- configs/coins/optimism.json | 2 +- configs/coins/optimism_archive.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/configs/coins/arbitrum.json b/configs/coins/arbitrum.json index d4a4ff49..5c3f701d 100644 --- a/configs/coins/arbitrum.json +++ b/configs/coins/arbitrum.json @@ -55,7 +55,7 @@ "queryBackendOnMempoolResync": false, "fiat_rates": "coingecko", "fiat_rates_vs_currencies": "AED,ARS,AUD,BDT,BHD,BMD,BRL,CAD,CHF,CLP,CNY,CZK,DKK,EUR,GBP,HKD,HUF,IDR,ILS,INR,JPY,KRW,KWD,LKR,MMK,MXN,MYR,NGN,NOK,NZD,PHP,PKR,PLN,RUB,SAR,SEK,SGD,THB,TRY,TWD,UAH,USD,VEF,VND,ZAR,BTC,ETH", - "fiat_rates_params": "{\"coin\": \"ethereum\",\"platformIdentifier\": \"ethereum\",\"platformVsCurrency\": \"eth\",\"periodSeconds\": 900}" + "fiat_rates_params": "{\"coin\": \"arbitrum\",\"platformIdentifier\": \"arbitrum-one\",\"platformVsCurrency\": \"usd\",\"periodSeconds\": 900}" } } }, diff --git a/configs/coins/arbitrum_archive.json b/configs/coins/arbitrum_archive.json index 4d5bfb06..6d704bdf 100644 --- a/configs/coins/arbitrum_archive.json +++ b/configs/coins/arbitrum_archive.json @@ -56,7 +56,7 @@ "queryBackendOnMempoolResync": false, "fiat_rates": "coingecko", "fiat_rates_vs_currencies": "AED,ARS,AUD,BDT,BHD,BMD,BRL,CAD,CHF,CLP,CNY,CZK,DKK,EUR,GBP,HKD,HUF,IDR,ILS,INR,JPY,KRW,KWD,LKR,MMK,MXN,MYR,NGN,NOK,NZD,PHP,PKR,PLN,RUB,SAR,SEK,SGD,THB,TRY,TWD,UAH,USD,VEF,VND,ZAR,BTC,ETH", - "fiat_rates_params": "{\"coin\": \"ethereum\",\"platformIdentifier\": \"ethereum\",\"platformVsCurrency\": \"eth\",\"periodSeconds\": 900}", + "fiat_rates_params": "{\"coin\": \"arbitrum\",\"platformIdentifier\": \"arbitrum-one\",\"platformVsCurrency\": \"usd\",\"periodSeconds\": 900}", "fourByteSignatures": "https://www.4byte.directory/api/v1/signatures/" } } diff --git a/configs/coins/optimism.json b/configs/coins/optimism.json index af77dbdb..132cc77c 100644 --- a/configs/coins/optimism.json +++ b/configs/coins/optimism.json @@ -56,7 +56,7 @@ "queryBackendOnMempoolResync": false, "fiat_rates": "coingecko", "fiat_rates_vs_currencies": "AED,ARS,AUD,BDT,BHD,BMD,BRL,CAD,CHF,CLP,CNY,CZK,DKK,EUR,GBP,HKD,HUF,IDR,ILS,INR,JPY,KRW,KWD,LKR,MMK,MXN,MYR,NGN,NOK,NZD,PHP,PKR,PLN,RUB,SAR,SEK,SGD,THB,TRY,TWD,UAH,USD,VEF,VND,ZAR,BTC,ETH", - "fiat_rates_params": "{\"coin\": \"ethereum\",\"platformIdentifier\": \"ethereum\",\"platformVsCurrency\": \"eth\",\"periodSeconds\": 900}" + "fiat_rates_params": "{\"coin\": \"optimism\",\"platformIdentifier\": \"optimistic-ethereum\",\"platformVsCurrency\": \"usd\",\"periodSeconds\": 900}" } } }, diff --git a/configs/coins/optimism_archive.json b/configs/coins/optimism_archive.json index 3c54d7bc..25c330c3 100644 --- a/configs/coins/optimism_archive.json +++ b/configs/coins/optimism_archive.json @@ -58,7 +58,7 @@ "queryBackendOnMempoolResync": false, "fiat_rates": "coingecko", "fiat_rates_vs_currencies": "AED,ARS,AUD,BDT,BHD,BMD,BRL,CAD,CHF,CLP,CNY,CZK,DKK,EUR,GBP,HKD,HUF,IDR,ILS,INR,JPY,KRW,KWD,LKR,MMK,MXN,MYR,NGN,NOK,NZD,PHP,PKR,PLN,RUB,SAR,SEK,SGD,THB,TRY,TWD,UAH,USD,VEF,VND,ZAR,BTC,ETH", - "fiat_rates_params": "{\"coin\": \"ethereum\",\"platformIdentifier\": \"ethereum\",\"platformVsCurrency\": \"eth\",\"periodSeconds\": 900}", + "fiat_rates_params": "{\"coin\": \"optimism\",\"platformIdentifier\": \"optimistic-ethereum\",\"platformVsCurrency\": \"usd\",\"periodSeconds\": 900}", "fourByteSignatures": "https://www.4byte.directory/api/v1/signatures/" } } From bdc477050b6f0aec480433ced3fc02995fef0f90 Mon Sep 17 00:00:00 2001 From: Martin Boehm Date: Tue, 10 Dec 2024 01:02:05 +0100 Subject: [PATCH 49/56] Fix Arbitrum and Optimism fiat rates ids --- configs/coins/arbitrum.json | 2 +- configs/coins/arbitrum_archive.json | 2 +- configs/coins/optimism.json | 2 +- configs/coins/optimism_archive.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/configs/coins/arbitrum.json b/configs/coins/arbitrum.json index 5c3f701d..26cf9351 100644 --- a/configs/coins/arbitrum.json +++ b/configs/coins/arbitrum.json @@ -55,7 +55,7 @@ "queryBackendOnMempoolResync": false, "fiat_rates": "coingecko", "fiat_rates_vs_currencies": "AED,ARS,AUD,BDT,BHD,BMD,BRL,CAD,CHF,CLP,CNY,CZK,DKK,EUR,GBP,HKD,HUF,IDR,ILS,INR,JPY,KRW,KWD,LKR,MMK,MXN,MYR,NGN,NOK,NZD,PHP,PKR,PLN,RUB,SAR,SEK,SGD,THB,TRY,TWD,UAH,USD,VEF,VND,ZAR,BTC,ETH", - "fiat_rates_params": "{\"coin\": \"arbitrum\",\"platformIdentifier\": \"arbitrum-one\",\"platformVsCurrency\": \"usd\",\"periodSeconds\": 900}" + "fiat_rates_params": "{\"coin\": \"ethereum\",\"platformIdentifier\": \"arbitrum-one\",\"platformVsCurrency\": \"eth\",\"periodSeconds\": 900}" } } }, diff --git a/configs/coins/arbitrum_archive.json b/configs/coins/arbitrum_archive.json index 6d704bdf..c85bb4cb 100644 --- a/configs/coins/arbitrum_archive.json +++ b/configs/coins/arbitrum_archive.json @@ -56,7 +56,7 @@ "queryBackendOnMempoolResync": false, "fiat_rates": "coingecko", "fiat_rates_vs_currencies": "AED,ARS,AUD,BDT,BHD,BMD,BRL,CAD,CHF,CLP,CNY,CZK,DKK,EUR,GBP,HKD,HUF,IDR,ILS,INR,JPY,KRW,KWD,LKR,MMK,MXN,MYR,NGN,NOK,NZD,PHP,PKR,PLN,RUB,SAR,SEK,SGD,THB,TRY,TWD,UAH,USD,VEF,VND,ZAR,BTC,ETH", - "fiat_rates_params": "{\"coin\": \"arbitrum\",\"platformIdentifier\": \"arbitrum-one\",\"platformVsCurrency\": \"usd\",\"periodSeconds\": 900}", + "fiat_rates_params": "{\"coin\": \"ethereum\",\"platformIdentifier\": \"arbitrum-one\",\"platformVsCurrency\": \"eth\",\"periodSeconds\": 900}", "fourByteSignatures": "https://www.4byte.directory/api/v1/signatures/" } } diff --git a/configs/coins/optimism.json b/configs/coins/optimism.json index 132cc77c..bc7cc886 100644 --- a/configs/coins/optimism.json +++ b/configs/coins/optimism.json @@ -56,7 +56,7 @@ "queryBackendOnMempoolResync": false, "fiat_rates": "coingecko", "fiat_rates_vs_currencies": "AED,ARS,AUD,BDT,BHD,BMD,BRL,CAD,CHF,CLP,CNY,CZK,DKK,EUR,GBP,HKD,HUF,IDR,ILS,INR,JPY,KRW,KWD,LKR,MMK,MXN,MYR,NGN,NOK,NZD,PHP,PKR,PLN,RUB,SAR,SEK,SGD,THB,TRY,TWD,UAH,USD,VEF,VND,ZAR,BTC,ETH", - "fiat_rates_params": "{\"coin\": \"optimism\",\"platformIdentifier\": \"optimistic-ethereum\",\"platformVsCurrency\": \"usd\",\"periodSeconds\": 900}" + "fiat_rates_params": "{\"coin\": \"ethereum\",\"platformIdentifier\": \"optimistic-ethereum\",\"platformVsCurrency\": \"eth\",\"periodSeconds\": 900}" } } }, diff --git a/configs/coins/optimism_archive.json b/configs/coins/optimism_archive.json index 25c330c3..1a642f11 100644 --- a/configs/coins/optimism_archive.json +++ b/configs/coins/optimism_archive.json @@ -58,7 +58,7 @@ "queryBackendOnMempoolResync": false, "fiat_rates": "coingecko", "fiat_rates_vs_currencies": "AED,ARS,AUD,BDT,BHD,BMD,BRL,CAD,CHF,CLP,CNY,CZK,DKK,EUR,GBP,HKD,HUF,IDR,ILS,INR,JPY,KRW,KWD,LKR,MMK,MXN,MYR,NGN,NOK,NZD,PHP,PKR,PLN,RUB,SAR,SEK,SGD,THB,TRY,TWD,UAH,USD,VEF,VND,ZAR,BTC,ETH", - "fiat_rates_params": "{\"coin\": \"optimism\",\"platformIdentifier\": \"optimistic-ethereum\",\"platformVsCurrency\": \"usd\",\"periodSeconds\": 900}", + "fiat_rates_params": "{\"coin\": \"ethereum\",\"platformIdentifier\": \"optimistic-ethereum\",\"platformVsCurrency\": \"eth\",\"periodSeconds\": 900}", "fourByteSignatures": "https://www.4byte.directory/api/v1/signatures/" } } From d771291ecab45bb86712ca7da1a238f6bdb9b11c Mon Sep 17 00:00:00 2001 From: JoHnY Date: Fri, 13 Dec 2024 08:37:10 +0000 Subject: [PATCH 50/56] =?UTF-8?q?dash=20(+testnet)=2020.1.0=20=E2=86=92=20?= =?UTF-8?q?22.0.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- configs/coins/dash.json | 6 +++--- configs/coins/dash_testnet.json | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/configs/coins/dash.json b/configs/coins/dash.json index b77e6732..255325ef 100644 --- a/configs/coins/dash.json +++ b/configs/coins/dash.json @@ -22,10 +22,10 @@ "package_name": "backend-dash", "package_revision": "satoshilabs-1", "system_user": "dash", - "version": "20.1.1", - "binary_url": "https://github.com/dashpay/dash/releases/download/v20.1.1/dashcore-20.1.1-x86_64-linux-gnu.tar.gz", + "version": "22.0.0", + "binary_url": "https://github.com/dashpay/dash/releases/download/v22.0.0/dashcore-22.0.0-x86_64-linux-gnu.tar.gz", "verification_type": "gpg-sha256", - "verification_source": "https://github.com/dashpay/dash/releases/download/v20.1.1/SHA256SUMS.asc", + "verification_source": "https://github.com/dashpay/dash/releases/download/v22.0.0/SHA256SUMS.asc", "extract_command": "tar -C backend --strip 1 -xf", "exclude_files": ["bin/dash-qt"], "exec_command_template": "{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/bin/dashd -deprecatedrpc=estimatefee -datadir={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend -conf={{.Env.BackendInstallPath}}/{{.Coin.Alias}}/{{.Coin.Alias}}.conf -pid=/run/{{.Coin.Alias}}/{{.Coin.Alias}}.pid", diff --git a/configs/coins/dash_testnet.json b/configs/coins/dash_testnet.json index 86925e0a..081381a6 100644 --- a/configs/coins/dash_testnet.json +++ b/configs/coins/dash_testnet.json @@ -22,10 +22,10 @@ "package_name": "backend-dash-testnet", "package_revision": "satoshilabs-1", "system_user": "dash", - "version": "20.1.1", - "binary_url": "https://github.com/dashpay/dash/releases/download/v20.1.1/dashcore-20.1.1-x86_64-linux-gnu.tar.gz", + "version": "22.0.0", + "binary_url": "https://github.com/dashpay/dash/releases/download/v22.0.0/dashcore-22.0.0-x86_64-linux-gnu.tar.gz", "verification_type": "gpg-sha256", - "verification_source": "https://github.com/dashpay/dash/releases/download/v20.1.1/SHA256SUMS.asc", + "verification_source": "https://github.com/dashpay/dash/releases/download/v22.0.0/SHA256SUMS.asc", "extract_command": "tar -C backend --strip 1 -xf", "exclude_files": [ "bin/dash-qt" From 4c5c0bd32f86b42718fbdcde8c9c60ea93078048 Mon Sep 17 00:00:00 2001 From: Martin Boehm Date: Tue, 24 Sep 2024 18:19:05 +0200 Subject: [PATCH 51/56] Add option to disable sync of mempool transactions --- bchain/coins/eth/ethrpc.go | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/bchain/coins/eth/ethrpc.go b/bchain/coins/eth/ethrpc.go index 6ed4b144..67b9a289 100644 --- a/bchain/coins/eth/ethrpc.go +++ b/bchain/coins/eth/ethrpc.go @@ -50,6 +50,7 @@ type Configuration struct { ProcessInternalTransactions bool `json:"processInternalTransactions"` ProcessZeroInternalTransactions bool `json:"processZeroInternalTransactions"` ConsensusNodeVersionURL string `json:"consensusNodeVersion"` + DisableMempoolSync bool `json:"disableMempoolSync,omitempty"` } // EthereumRPC is an interface to JSON-RPC eth service. @@ -174,7 +175,7 @@ func (b *EthereumRPC) Initialize() error { func (b *EthereumRPC) CreateMempool(chain bchain.BlockChain) (bchain.Mempool, error) { if b.Mempool == nil { b.Mempool = bchain.NewMempoolEthereumType(chain, b.ChainConfig.MempoolTxTimeoutHours, b.ChainConfig.QueryBackendOnMempoolResync) - glog.Info("mempool created, MempoolTxTimeoutHours=", b.ChainConfig.MempoolTxTimeoutHours, ", QueryBackendOnMempoolResync=", b.ChainConfig.QueryBackendOnMempoolResync) + glog.Info("mempool created, MempoolTxTimeoutHours=", b.ChainConfig.MempoolTxTimeoutHours, ", QueryBackendOnMempoolResync=", b.ChainConfig.QueryBackendOnMempoolResync, ", DisableMempoolSync=", b.ChainConfig.DisableMempoolSync) } return b.Mempool, nil } @@ -263,21 +264,23 @@ func (b *EthereumRPC) subscribeEvents() error { } }() - // new mempool transaction subscription - if err := b.subscribe(func() (bchain.EVMClientSubscription, error) { - // invalidate the previous subscription - it is either the first one or there was an error - b.newTxSubscription = nil - ctx, cancel := context.WithTimeout(context.Background(), b.Timeout) - defer cancel() - sub, err := b.RPC.EthSubscribe(ctx, b.NewTx.Channel(), "newPendingTransactions") - if err != nil { - return nil, errors.Annotatef(err, "EthSubscribe newPendingTransactions") + if !b.ChainConfig.DisableMempoolSync { + // new mempool transaction subscription + if err := b.subscribe(func() (bchain.EVMClientSubscription, error) { + // invalidate the previous subscription - it is either the first one or there was an error + b.newTxSubscription = nil + ctx, cancel := context.WithTimeout(context.Background(), b.Timeout) + defer cancel() + sub, err := b.RPC.EthSubscribe(ctx, b.NewTx.Channel(), "newPendingTransactions") + if err != nil { + return nil, errors.Annotatef(err, "EthSubscribe newPendingTransactions") + } + b.newTxSubscription = sub + glog.Info("Subscribed to newPendingTransactions") + return sub, nil + }); err != nil { + return err } - b.newTxSubscription = sub - glog.Info("Subscribed to newPendingTransactions") - return sub, nil - }); err != nil { - return err } return nil From 8b05dbc9b935d106bf05a879dc8b505566fcfe8e Mon Sep 17 00:00:00 2001 From: JoHnY Date: Wed, 11 Dec 2024 14:27:42 +0000 Subject: [PATCH 52/56] =?UTF-8?q?polygon-bor=201.4.1=20=E2=86=92=201.5.3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- configs/coins/polygon.json | 10 +++++----- configs/coins/polygon_archive.json | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/configs/coins/polygon.json b/configs/coins/polygon.json index 19367240..71e0c143 100644 --- a/configs/coins/polygon.json +++ b/configs/coins/polygon.json @@ -21,16 +21,16 @@ "package_name": "backend-polygon-bor", "package_revision": "satoshilabs-1", "system_user": "polygon", - "version": "1.4.1", - "binary_url": "https://github.com/maticnetwork/bor/archive/refs/tags/v1.4.1.tar.gz", + "version": "1.5.3", + "binary_url": "https://github.com/maticnetwork/bor/archive/refs/tags/v1.5.3.tar.gz", "verification_type": "sha256", - "verification_source": "59fd114c572f81ccdd7ceb5ee6ece0ca03341b5bba294bceb34f9b572d7ef1e9", - "extract_command": "mkdir backend/source && tar -C backend/source --strip 1 -xf v1.4.1.tar.gz && cd backend/source && make bor && mv build/bin/bor ../ && rm -rf ../source && echo", + "verification_source": "6dabc3306aa628f86232e96e5ec1a970bbebe38ace09447a0d2e5421dd77e4bd", + "extract_command": "mkdir backend/source && tar -C backend/source --strip 1 -xf v1.5.3.tar.gz && cd backend/source && make bor && mv build/bin/bor ../ && rm -rf ../source && echo", "exclude_files": [], "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/polygon_bor_exec.sh 2>> {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", "exec_script": "polygon_bor.sh", "logrotate_files_template": "{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log", - "postinst_script_template": "wget https://raw.githubusercontent.com/maticnetwork/bor/v1.4.1/builder/files/genesis-mainnet-v1.json -O {{.Env.BackendInstallPath}}/{{.Coin.Alias}}/genesis.json", + "postinst_script_template": "wget https://raw.githubusercontent.com/maticnetwork/bor/v1.5.3/builder/files/genesis-mainnet-v1.json -O {{.Env.BackendInstallPath}}/{{.Coin.Alias}}/genesis.json", "service_type": "simple", "service_additional_params_template": "", "protect_memory": true, diff --git a/configs/coins/polygon_archive.json b/configs/coins/polygon_archive.json index d7a1744d..6898e89c 100644 --- a/configs/coins/polygon_archive.json +++ b/configs/coins/polygon_archive.json @@ -21,16 +21,16 @@ "package_name": "backend-polygon-archive-bor", "package_revision": "satoshilabs-1", "system_user": "polygon", - "version": "1.4.1", - "binary_url": "https://github.com/maticnetwork/bor/archive/refs/tags/v1.4.1.tar.gz", + "version": "1.5.3", + "binary_url": "https://github.com/maticnetwork/bor/archive/refs/tags/v1.5.3.tar.gz", "verification_type": "sha256", - "verification_source": "59fd114c572f81ccdd7ceb5ee6ece0ca03341b5bba294bceb34f9b572d7ef1e9", - "extract_command": "mkdir backend/source && tar -C backend/source --strip 1 -xf v1.4.1.tar.gz && cd backend/source && make bor && mv build/bin/bor ../ && rm -rf ../source && echo", + "verification_source": "6dabc3306aa628f86232e96e5ec1a970bbebe38ace09447a0d2e5421dd77e4bd", + "extract_command": "mkdir backend/source && tar -C backend/source --strip 1 -xf v1.5.3.tar.gz && cd backend/source && make bor && mv build/bin/bor ../ && rm -rf ../source && echo", "exclude_files": [], "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/polygon_archive_bor_exec.sh 2>> {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", "exec_script": "polygon_archive_bor.sh", "logrotate_files_template": "{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log", - "postinst_script_template": "wget https://raw.githubusercontent.com/maticnetwork/bor/v1.4.1/builder/files/genesis-mainnet-v1.json -O {{.Env.BackendInstallPath}}/{{.Coin.Alias}}/genesis.json", + "postinst_script_template": "wget https://raw.githubusercontent.com/maticnetwork/bor/v1.5.3/builder/files/genesis-mainnet-v1.json -O {{.Env.BackendInstallPath}}/{{.Coin.Alias}}/genesis.json", "service_type": "simple", "service_additional_params_template": "", "protect_memory": true, From fab4dd78caea6145ffe4db6314fdd6d704166d33 Mon Sep 17 00:00:00 2001 From: JoHnY Date: Mon, 30 Dec 2024 14:01:53 +0000 Subject: [PATCH 53/56] =?UTF-8?q?bch=20(+testnets)=2027.1.0=20=E2=86=92=20?= =?UTF-8?q?28.0.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- configs/coins/bcash.json | 6 +++--- configs/coins/bcash_testnet.json | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/configs/coins/bcash.json b/configs/coins/bcash.json index daac347b..1a6a4e5d 100644 --- a/configs/coins/bcash.json +++ b/configs/coins/bcash.json @@ -22,10 +22,10 @@ "package_name": "backend-bcash", "package_revision": "satoshilabs-1", "system_user": "bcash", - "version": "27.1.0", - "binary_url": "https://github.com/bitcoin-cash-node/bitcoin-cash-node/releases/download/v27.1.0/bitcoin-cash-node-27.1.0-x86_64-linux-gnu.tar.gz", + "version": "28.0.1", + "binary_url": "https://github.com/bitcoin-cash-node/bitcoin-cash-node/releases/download/v28.0.1/bitcoin-cash-node-28.0.1-x86_64-linux-gnu.tar.gz", "verification_type": "sha256", - "verification_source": "0dcc387cbaa3a039c97ddc8fb99c1fa7bff5dc6e4bd3a01d3c3095f595ad2dce", + "verification_source": "d69ee632147f886ca540cecdff5b1b85512612b4c005e86b09083a63c35b64fa", "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", diff --git a/configs/coins/bcash_testnet.json b/configs/coins/bcash_testnet.json index 89c08f09..fb98530c 100644 --- a/configs/coins/bcash_testnet.json +++ b/configs/coins/bcash_testnet.json @@ -22,10 +22,10 @@ "package_name": "backend-bcash-testnet", "package_revision": "satoshilabs-1", "system_user": "bcash", - "version": "27.1.0", - "binary_url": "https://github.com/bitcoin-cash-node/bitcoin-cash-node/releases/download/v27.1.0/bitcoin-cash-node-27.1.0-x86_64-linux-gnu.tar.gz", + "version": "28.0.1", + "binary_url": "https://github.com/bitcoin-cash-node/bitcoin-cash-node/releases/download/v28.0.1/bitcoin-cash-node-28.0.1-x86_64-linux-gnu.tar.gz", "verification_type": "sha256", - "verification_source": "0dcc387cbaa3a039c97ddc8fb99c1fa7bff5dc6e4bd3a01d3c3095f595ad2dce", + "verification_source": "d69ee632147f886ca540cecdff5b1b85512612b4c005e86b09083a63c35b64fa", "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", From 40be3e7219d3bb74a5996f70d91e9d8fb17b5782 Mon Sep 17 00:00:00 2001 From: JoHnY Date: Tue, 17 Dec 2024 14:44:47 +0000 Subject: [PATCH 54/56] =?UTF-8?q?prysm=205.1.2=20=E2=86=92=205.2.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- configs/coins/ethereum_archive_consensus.json | 10 +++++----- configs/coins/ethereum_consensus.json | 10 +++++----- .../ethereum_testnet_holesky_archive_consensus.json | 10 +++++----- configs/coins/ethereum_testnet_holesky_consensus.json | 10 +++++----- .../ethereum_testnet_sepolia_archive_consensus.json | 10 +++++----- configs/coins/ethereum_testnet_sepolia_consensus.json | 10 +++++----- 6 files changed, 30 insertions(+), 30 deletions(-) diff --git a/configs/coins/ethereum_archive_consensus.json b/configs/coins/ethereum_archive_consensus.json index 4caa570a..51f757ad 100644 --- a/configs/coins/ethereum_archive_consensus.json +++ b/configs/coins/ethereum_archive_consensus.json @@ -19,10 +19,10 @@ "package_name": "backend-ethereum-archive-consensus", "package_revision": "satoshilabs-1", "system_user": "ethereum", - "version": "5.1.2", - "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.1.2/beacon-chain-v5.1.2-linux-amd64", + "version": "5.2.0", + "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.2.0/beacon-chain-v5.2.0-linux-amd64", "verification_type": "sha256", - "verification_source": "4b0d20406aebec8e19016cddf987bf92578296dac0e41c40d99223c8166b96b9", + "verification_source": "bd8c8756943a75f4b6d120b5a9b215a56d071a4fc986ff91af2a4b01e1ac6aea", "extract_command": "mv ${ARCHIVE} backend/beacon-chain && chmod +x backend/beacon-chain && echo", "exclude_files": [], "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/beacon-chain --mainnet --accept-terms-of-use --execution-endpoint=http://localhost:{{.Ports.BackendAuthRpc}} --grpc-gateway-port=7516 --rpc-port=7517 --monitoring-port=7518 --p2p-tcp-port=3516 --p2p-udp-port=2516 --datadir={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend --jwt-secret={{.Env.BackendDataPath}}/ethereum_archive/backend/erigon/jwt.hex 2>>{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", @@ -36,8 +36,8 @@ "client_config_file": "", "platforms": { "arm64": { - "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.1.2/beacon-chain-v5.1.2-linux-arm64", - "verification_source": "850d834fca3b00b3f4c508ecb96fd867aff476335ebdcd190981446a93d03e3d" + "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.2.0/beacon-chain-v5.2.0-linux-arm64", + "verification_source": "fb5b46749abe8ebfd8cd074215b350a8db305bceda624e70d7ee9e432e480dac" } } }, diff --git a/configs/coins/ethereum_consensus.json b/configs/coins/ethereum_consensus.json index 9ec1e5a2..c6213955 100644 --- a/configs/coins/ethereum_consensus.json +++ b/configs/coins/ethereum_consensus.json @@ -19,10 +19,10 @@ "package_name": "backend-ethereum-consensus", "package_revision": "satoshilabs-1", "system_user": "ethereum", - "version": "5.1.2", - "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.1.2/beacon-chain-v5.1.2-linux-amd64", + "version": "5.2.0", + "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.2.0/beacon-chain-v5.2.0-linux-amd64", "verification_type": "sha256", - "verification_source": "4b0d20406aebec8e19016cddf987bf92578296dac0e41c40d99223c8166b96b9", + "verification_source": "bd8c8756943a75f4b6d120b5a9b215a56d071a4fc986ff91af2a4b01e1ac6aea", "extract_command": "mv ${ARCHIVE} backend/beacon-chain && chmod +x backend/beacon-chain && echo", "exclude_files": [], "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/beacon-chain --mainnet --accept-terms-of-use --execution-endpoint=http://localhost:{{.Ports.BackendAuthRpc}} --grpc-gateway-port=7536 --rpc-port=7537 --monitoring-port=7538 --p2p-tcp-port=3536 --p2p-udp-port=2536 --datadir={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend --jwt-secret={{.Env.BackendDataPath}}/ethereum/backend/erigon/jwt.hex 2>>{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", @@ -36,8 +36,8 @@ "client_config_file": "", "platforms": { "arm64": { - "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.1.2/beacon-chain-v5.1.2-linux-arm64", - "verification_source": "850d834fca3b00b3f4c508ecb96fd867aff476335ebdcd190981446a93d03e3d" + "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.2.0/beacon-chain-v5.2.0-linux-arm64", + "verification_source": "fb5b46749abe8ebfd8cd074215b350a8db305bceda624e70d7ee9e432e480dac" } } }, diff --git a/configs/coins/ethereum_testnet_holesky_archive_consensus.json b/configs/coins/ethereum_testnet_holesky_archive_consensus.json index 88859fd7..848775b2 100644 --- a/configs/coins/ethereum_testnet_holesky_archive_consensus.json +++ b/configs/coins/ethereum_testnet_holesky_archive_consensus.json @@ -23,10 +23,10 @@ "package_name": "backend-ethereum-testnet-holesky-archive-consensus", "package_revision": "satoshilabs-1", "system_user": "ethereum", - "version": "5.1.2", - "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.1.2/beacon-chain-v5.1.2-linux-amd64", + "version": "5.2.0", + "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.2.0/beacon-chain-v5.2.0-linux-amd64", "verification_type": "sha256", - "verification_source": "4b0d20406aebec8e19016cddf987bf92578296dac0e41c40d99223c8166b96b9", + "verification_source": "bd8c8756943a75f4b6d120b5a9b215a56d071a4fc986ff91af2a4b01e1ac6aea", "extract_command": "mv ${ARCHIVE} backend/beacon-chain && chmod +x backend/beacon-chain && echo", "exclude_files": [], "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/beacon-chain --holesky --accept-terms-of-use --execution-endpoint=http://localhost:{{.Ports.BackendAuthRpc}} --grpc-gateway-port=17536 --rpc-port=17537 --monitoring-port=17538 --p2p-tcp-port=13636 --p2p-udp-port=12636 --datadir={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend --jwt-secret={{.Env.BackendDataPath}}/ethereum_testnet_holesky_archive/backend/erigon/jwt.hex --genesis-state={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/genesis.ssz 2>>{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", @@ -40,8 +40,8 @@ "client_config_file": "", "platforms": { "arm64": { - "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.1.2/beacon-chain-v5.1.2-linux-arm64", - "verification_source": "850d834fca3b00b3f4c508ecb96fd867aff476335ebdcd190981446a93d03e3d" + "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.2.0/beacon-chain-v5.2.0-linux-arm64", + "verification_source": "fb5b46749abe8ebfd8cd074215b350a8db305bceda624e70d7ee9e432e480dac" } } }, diff --git a/configs/coins/ethereum_testnet_holesky_consensus.json b/configs/coins/ethereum_testnet_holesky_consensus.json index 19774f19..69583957 100644 --- a/configs/coins/ethereum_testnet_holesky_consensus.json +++ b/configs/coins/ethereum_testnet_holesky_consensus.json @@ -23,10 +23,10 @@ "package_name": "backend-ethereum-testnet-holesky-consensus", "package_revision": "satoshilabs-1", "system_user": "ethereum", - "version": "5.1.2", - "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.1.2/beacon-chain-v5.1.2-linux-amd64", + "version": "5.2.0", + "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.2.0/beacon-chain-v5.2.0-linux-amd64", "verification_type": "sha256", - "verification_source": "4b0d20406aebec8e19016cddf987bf92578296dac0e41c40d99223c8166b96b9", + "verification_source": "bd8c8756943a75f4b6d120b5a9b215a56d071a4fc986ff91af2a4b01e1ac6aea", "extract_command": "mv ${ARCHIVE} backend/beacon-chain && chmod +x backend/beacon-chain && echo", "exclude_files": [], "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/beacon-chain --holesky --accept-terms-of-use --execution-endpoint=http://localhost:{{.Ports.BackendAuthRpc}} --grpc-gateway-port=17516 --rpc-port=17517 --monitoring-port=17518 --p2p-tcp-port=13516 --p2p-udp-port=12516 --datadir={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend --jwt-secret={{.Env.BackendDataPath}}/ethereum_testnet_holesky/backend/erigon/jwt.hex --genesis-state={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/genesis.ssz 2>>{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", @@ -40,8 +40,8 @@ "client_config_file": "", "platforms": { "arm64": { - "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.1.2/beacon-chain-v5.1.2-linux-arm64", - "verification_source": "850d834fca3b00b3f4c508ecb96fd867aff476335ebdcd190981446a93d03e3d" + "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.2.0/beacon-chain-v5.2.0-linux-arm64", + "verification_source": "fb5b46749abe8ebfd8cd074215b350a8db305bceda624e70d7ee9e432e480dac" } } }, diff --git a/configs/coins/ethereum_testnet_sepolia_archive_consensus.json b/configs/coins/ethereum_testnet_sepolia_archive_consensus.json index 0bdbe87b..8563a8e9 100644 --- a/configs/coins/ethereum_testnet_sepolia_archive_consensus.json +++ b/configs/coins/ethereum_testnet_sepolia_archive_consensus.json @@ -23,10 +23,10 @@ "package_name": "backend-ethereum-testnet-sepolia-archive-consensus", "package_revision": "satoshilabs-1", "system_user": "ethereum", - "version": "5.1.2", - "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.1.2/beacon-chain-v5.1.2-linux-amd64", + "version": "5.2.0", + "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.2.0/beacon-chain-v5.2.0-linux-amd64", "verification_type": "sha256", - "verification_source": "4b0d20406aebec8e19016cddf987bf92578296dac0e41c40d99223c8166b96b9", + "verification_source": "bd8c8756943a75f4b6d120b5a9b215a56d071a4fc986ff91af2a4b01e1ac6aea", "extract_command": "mv ${ARCHIVE} backend/beacon-chain && chmod +x backend/beacon-chain && echo", "exclude_files": [], "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/beacon-chain --sepolia --accept-terms-of-use --execution-endpoint=http://localhost:{{.Ports.BackendAuthRpc}} --grpc-gateway-port=17586 --rpc-port=17587 --monitoring-port=17548 --p2p-tcp-port=13676 --p2p-udp-port=12676 --datadir={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend --jwt-secret={{.Env.BackendDataPath}}/ethereum_testnet_sepolia_archive/backend/erigon/jwt.hex --genesis-state={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/genesis.ssz 2>>{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", @@ -40,8 +40,8 @@ "client_config_file": "", "platforms": { "arm64": { - "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.1.2/beacon-chain-v5.1.2-linux-arm64", - "verification_source": "850d834fca3b00b3f4c508ecb96fd867aff476335ebdcd190981446a93d03e3d" + "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.2.0/beacon-chain-v5.2.0-linux-arm64", + "verification_source": "fb5b46749abe8ebfd8cd074215b350a8db305bceda624e70d7ee9e432e480dac" } } }, diff --git a/configs/coins/ethereum_testnet_sepolia_consensus.json b/configs/coins/ethereum_testnet_sepolia_consensus.json index 9ca379ef..1a700fe7 100644 --- a/configs/coins/ethereum_testnet_sepolia_consensus.json +++ b/configs/coins/ethereum_testnet_sepolia_consensus.json @@ -23,10 +23,10 @@ "package_name": "backend-ethereum-testnet-sepolia-consensus", "package_revision": "satoshilabs-1", "system_user": "ethereum", - "version": "5.1.2", - "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.1.2/beacon-chain-v5.1.2-linux-amd64", + "version": "5.2.0", + "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.2.0/beacon-chain-v5.2.0-linux-amd64", "verification_type": "sha256", - "verification_source": "4b0d20406aebec8e19016cddf987bf92578296dac0e41c40d99223c8166b96b9", + "verification_source": "bd8c8756943a75f4b6d120b5a9b215a56d071a4fc986ff91af2a4b01e1ac6aea", "extract_command": "mv ${ARCHIVE} backend/beacon-chain && chmod +x backend/beacon-chain && echo", "exclude_files": [], "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/beacon-chain --sepolia --accept-terms-of-use --execution-endpoint=http://localhost:{{.Ports.BackendAuthRpc}} --grpc-gateway-port=17576 --rpc-port=17577 --monitoring-port=17578 --p2p-tcp-port=13576 --p2p-udp-port=12576 --datadir={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend --jwt-secret={{.Env.BackendDataPath}}/ethereum_testnet_sepolia/backend/erigon/jwt.hex --genesis-state={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/genesis.ssz 2>>{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", @@ -40,8 +40,8 @@ "client_config_file": "", "platforms": { "arm64": { - "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.1.2/beacon-chain-v5.1.2-linux-arm64", - "verification_source": "850d834fca3b00b3f4c508ecb96fd867aff476335ebdcd190981446a93d03e3d" + "binary_url": "https://github.com/prysmaticlabs/prysm/releases/download/v5.2.0/beacon-chain-v5.2.0-linux-arm64", + "verification_source": "fb5b46749abe8ebfd8cd074215b350a8db305bceda624e70d7ee9e432e480dac" } } }, From 1334a16d3ae092e60c7bc2bf6e8d6840f89c4139 Mon Sep 17 00:00:00 2001 From: JoHnY Date: Mon, 6 Jan 2025 13:47:54 +0000 Subject: [PATCH 55/56] =?UTF-8?q?zcash=20(+testnet)=206.0.0=20=E2=86=92=20?= =?UTF-8?q?6.1.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- configs/coins/zcash.json | 6 +++--- configs/coins/zcash_testnet.json | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/configs/coins/zcash.json b/configs/coins/zcash.json index f1be6baf..be640783 100644 --- a/configs/coins/zcash.json +++ b/configs/coins/zcash.json @@ -22,10 +22,10 @@ "package_name": "backend-zcash", "package_revision": "satoshilabs-1", "system_user": "zcash", - "version": "6.0.0", - "binary_url": "https://download.z.cash/downloads/zcash-6.0.0-linux64-debian-bullseye.tar.gz", + "version": "6.1.0", + "binary_url": "https://download.z.cash/downloads/zcash-6.1.0-linux64-debian-bullseye.tar.gz", "verification_type": "sha256", - "verification_source": "3cb82f490e9c8e88007a0216b5261b33ef0fda962b9258441b2def59cb272a4d", + "verification_source": "1d17ceacb265599bb4ee690baaf2b335cfe9825df5198359c771ee1834fd4358", "extract_command": "tar -C backend --strip 1 -xf", "exclude_files": [], "exec_command_template": "{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/bin/zcashd -datadir={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend -conf={{.Env.BackendInstallPath}}/{{.Coin.Alias}}/{{.Coin.Alias}}.conf -pid=/run/{{.Coin.Alias}}/{{.Coin.Alias}}.pid", diff --git a/configs/coins/zcash_testnet.json b/configs/coins/zcash_testnet.json index 0a185bba..f2a1c388 100644 --- a/configs/coins/zcash_testnet.json +++ b/configs/coins/zcash_testnet.json @@ -21,10 +21,10 @@ "backend": { "package_name": "backend-zcash-testnet", "package_revision": "satoshilabs-1", - "version": "6.0.0", - "binary_url": "https://download.z.cash/downloads/zcash-6.0.0-linux64-debian-bullseye.tar.gz", + "version": "6.1.0", + "binary_url": "https://download.z.cash/downloads/zcash-6.1.0-linux64-debian-bullseye.tar.gz", "verification_type": "sha256", - "verification_source": "3cb82f490e9c8e88007a0216b5261b33ef0fda962b9258441b2def59cb272a4d", + "verification_source": "1d17ceacb265599bb4ee690baaf2b335cfe9825df5198359c771ee1834fd4358", "extract_command": "tar -C backend --strip 1 -xf", "exclude_files": [], "exec_command_template": "{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/bin/zcashd -datadir={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend -conf={{.Env.BackendInstallPath}}/{{.Coin.Alias}}/{{.Coin.Alias}}.conf -pid=/run/{{.Coin.Alias}}/{{.Coin.Alias}}.pid", From b40948a7815ca721c154b26bcb3294e973f1805d Mon Sep 17 00:00:00 2001 From: Tadeas Kmenta Date: Wed, 8 Jan 2025 04:15:37 +0800 Subject: [PATCH 56/56] update flux daemon to v7.2.0 (#1178) Co-authored-by: Tadeas Kmenta --- configs/coins/flux.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/configs/coins/flux.json b/configs/coins/flux.json index 24116c44..ec850124 100644 --- a/configs/coins/flux.json +++ b/configs/coins/flux.json @@ -22,10 +22,10 @@ "package_name": "backend-flux", "package_revision": "satoshilabs-1", "system_user": "flux", - "version": "7.1.0", - "binary_url": "https://github.com/RunOnFlux/fluxd/releases/download/v7.1.0/Flux-amd64-v7.1.0.tar.gz", + "version": "7.2.0", + "binary_url": "https://github.com/RunOnFlux/fluxd/releases/download/v7.2.0/Flux-amd64-v7.2.0.tar.gz", "verification_type": "sha256", - "verification_source": "832fe0d7700cf74430f4b464f07706a78ec39b2ec309d3d8230b0dffe9993296", + "verification_source": "aac3a9581fb8e8f3215ddd3de9721fdb6e9d90ef65d3fa73a495d7451dd480ef", "extract_command": "tar -C backend -xf", "exclude_files": [], "exec_command_template": "{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/fluxd -datadir={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend -conf={{.Env.BackendInstallPath}}/{{.Coin.Alias}}/{{.Coin.Alias}}.conf -pid=/run/{{.Coin.Alias}}/{{.Coin.Alias}}.pid",