From 997e8a462452a644b0ce135115864ddc8041bf86 Mon Sep 17 00:00:00 2001 From: hunicus <93150691+hunicus@users.noreply.github.com> Date: Sun, 13 Nov 2022 22:30:05 -0500 Subject: [PATCH 1/5] Create "advanced" + "self-hosted" faq categories And re-arrange questions: move all old "advanced" questions to "self-hosted", and move some "basic" questions to "advanced". --- .../src/app/docs/api-docs/api-docs-data.ts | 43 +++++++++++-------- .../app/docs/api-docs/api-docs.component.html | 16 +++---- .../app/docs/api-docs/api-docs.component.scss | 1 + 3 files changed, 34 insertions(+), 26 deletions(-) diff --git a/frontend/src/app/docs/api-docs/api-docs-data.ts b/frontend/src/app/docs/api-docs/api-docs-data.ts index 0b2f4b2ff..970d6ab73 100644 --- a/frontend/src/app/docs/api-docs/api-docs-data.ts +++ b/frontend/src/app/docs/api-docs/api-docs-data.ts @@ -8562,20 +8562,6 @@ export const faqData = [ fragment: "what-is-svb", title: "What is sat/vB?", }, - { - type: "endpoint", - category: "basics", - showConditions: bitcoinNetworks, - fragment: "what-is-full-mempool", - title: "What does it mean for the mempool to be \"full\"?", - }, - { - type: "endpoint", - category: "basics", - showConditions: bitcoinNetworks, - fragment: "why-empty-blocks", - title: "Why are there empty blocks?", - }, { type: "category", category: "help", @@ -8657,33 +8643,54 @@ export const faqData = [ type: "endpoint", category: "advanced", showConditions: bitcoinNetworks, + fragment: "what-is-full-mempool", + title: "What does it mean for the mempool to be \"full\"?", + }, + { + type: "endpoint", + category: "advanced", + showConditions: bitcoinNetworks, + fragment: "why-empty-blocks", + title: "Why are there empty blocks?", + }, + { + type: "category", + category: "self-hosting", + fragment: "self-hosting", + title: "Self-Hosting", + showConditions: bitcoinNetworks + }, + { + type: "endpoint", + category: "self-hosting", + showConditions: bitcoinNetworks, fragment: "who-runs-this-website", title: "Who runs this website?", }, { type: "endpoint", - category: "advanced", + category: "self-hosting", showConditions: bitcoinNetworks, fragment: "host-my-own-instance-raspberry-pi", title: "How can I host my own instance on a Raspberry Pi?", }, { type: "endpoint", - category: "advanced", + category: "self-hosting", showConditions: bitcoinNetworks, fragment: "host-my-own-instance-linux-server", title: "How can I host my own instance on a Linux server?", }, { type: "endpoint", - category: "advanced", + category: "self-hosting", showConditions: bitcoinNetworks, fragment: "install-mempool-with-docker", title: "Can I install Mempool using Docker?", }, { type: "endpoint", - category: "advanced", + category: "self-hosting", showConditions: bitcoinNetworks, fragment: "address-lookup-issues", title: "Why do I get an error for certain address lookups on my Mempool instance?", diff --git a/frontend/src/app/docs/api-docs/api-docs.component.html b/frontend/src/app/docs/api-docs/api-docs.component.html index e2524a27d..eb3c94d5e 100644 --- a/frontend/src/app/docs/api-docs/api-docs.component.html +++ b/frontend/src/app/docs/api-docs/api-docs.component.html @@ -163,14 +163,6 @@

There are feerate estimates on the top of the main dashboard you can use as a guide. See this FAQ for more on picking the right feerate.

- -

When a Bitcoin transaction is made, it is stored in a Bitcoin node's mempool before it is confirmed into a block. When the rate of incoming transactions exceeds the rate transactions are confirmed, the mempool grows in size.

The default maximum size of a Bitcoin node's mempool is 300MB, so when there are 300MB of transactions in the mempool, we say it's "full".

-
- - -

When a new block is found, mining pools send miners a block template with no transactions so they can start searching for the next block as soon as possible. They send a block template full of transactions right afterward, but a full block template is a bigger data transfer and takes slightly longer to reach miners.

In this intervening time, which is usually no more than 1-2 seconds, miners sometimes get lucky and find a new block using the empty block template.

-
-

If it's been a while and your transaction hasn't confirmed, your transaction is probably using a lower feerate relative to other transactions currently in the mempool. Depending on how you made your transaction, there may be ways to accelerate the process.

There's no need to panic—a Bitcoin transaction will always either confirm completely (or not at all) at some point. As long as you have your transaction's ID, you can always see where your funds are.

This site only provides data about the Bitcoin network—it cannot help you get your transaction confirmed quicker.

@@ -203,6 +195,14 @@ See the graphs page for aggregate trends over time: mempool size over time and incoming transaction velocity over time. + +

When a Bitcoin transaction is made, it is stored in a Bitcoin node's mempool before it is confirmed into a block. When the rate of incoming transactions exceeds the rate transactions are confirmed, the mempool grows in size.

The default maximum size of a Bitcoin node's mempool is 300MB, so when there are 300MB of transactions in the mempool, we say it's "full".

+
+ + +

When a new block is found, mining pools send miners a block template with no transactions so they can start searching for the next block as soon as possible. They send a block template full of transactions right afterward, but a full block template is a bigger data transfer and takes slightly longer to reach miners.

In this intervening time, which is usually no more than 1-2 seconds, miners sometimes get lucky and find a new block using the empty block template.

+
+ The official mempool.space website is operated by The Mempool Open Source Project. See more information on our About page. There are also many unofficial instances of this website operated by individual members of the Bitcoin community. diff --git a/frontend/src/app/docs/api-docs/api-docs.component.scss b/frontend/src/app/docs/api-docs/api-docs.component.scss index acfc209e5..53ac3bf32 100644 --- a/frontend/src/app/docs/api-docs/api-docs.component.scss +++ b/frontend/src/app/docs/api-docs/api-docs.component.scss @@ -172,6 +172,7 @@ h3 { border-radius: 0.25rem; font-family: monospace; float: right; + white-space: nowrap; } .endpoint-container .section-header table { From ef27aca6e4e48b8ec409c04cb74c800313b54f96 Mon Sep 17 00:00:00 2001 From: hunicus <93150691+hunicus@users.noreply.github.com> Date: Sun, 13 Nov 2022 22:34:15 -0500 Subject: [PATCH 2/5] Update faq: what is full mempool --- frontend/src/app/docs/api-docs/api-docs.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/app/docs/api-docs/api-docs.component.html b/frontend/src/app/docs/api-docs/api-docs.component.html index eb3c94d5e..9fc9aa8a0 100644 --- a/frontend/src/app/docs/api-docs/api-docs.component.html +++ b/frontend/src/app/docs/api-docs/api-docs.component.html @@ -196,7 +196,7 @@ -

When a Bitcoin transaction is made, it is stored in a Bitcoin node's mempool before it is confirmed into a block. When the rate of incoming transactions exceeds the rate transactions are confirmed, the mempool grows in size.

The default maximum size of a Bitcoin node's mempool is 300MB, so when there are 300MB of transactions in the mempool, we say it's "full".

+

When a Bitcoin transaction is made, it is stored in a Bitcoin node's mempool before it is confirmed into a block. When the rate of incoming transactions exceeds the rate transactions are confirmed, the mempool grows in size.

By default, Bitcoin Core allocates 300MB of memory for its mempool, so when a node's mempool grows big enough to use all 300MB of allocated memory, we say it's "full".

Once a node's mempool is using all of its allocated memory, it will start rejecting new transactions below a certain feerate threshold—so when this is the case, be extra sure to set a feerate that (at a minimum) exceeds that threshold. The current threshold feerate (and memory usage) are displayed right on Mempool's front page.

From ddcd3878487d28484657a6106eadc24d3ca9b0ab Mon Sep 17 00:00:00 2001 From: hunicus <93150691+hunicus@users.noreply.github.com> Date: Sun, 13 Nov 2022 22:36:46 -0500 Subject: [PATCH 3/5] Add faq: why timestamps don't always increase --- frontend/src/app/docs/api-docs/api-docs-data.ts | 7 +++++++ frontend/src/app/docs/api-docs/api-docs.component.html | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/frontend/src/app/docs/api-docs/api-docs-data.ts b/frontend/src/app/docs/api-docs/api-docs-data.ts index 970d6ab73..9b2fcac4b 100644 --- a/frontend/src/app/docs/api-docs/api-docs-data.ts +++ b/frontend/src/app/docs/api-docs/api-docs-data.ts @@ -8653,6 +8653,13 @@ export const faqData = [ fragment: "why-empty-blocks", title: "Why are there empty blocks?", }, + { + type: "endpoint", + category: "advanced", + showConditions: bitcoinNetworks, + fragment: "why-block-timestamps-dont-always-increase", + title: "Why don't block timestamps always increase?", + }, { type: "category", category: "self-hosting", diff --git a/frontend/src/app/docs/api-docs/api-docs.component.html b/frontend/src/app/docs/api-docs/api-docs.component.html index 9fc9aa8a0..35fe40362 100644 --- a/frontend/src/app/docs/api-docs/api-docs.component.html +++ b/frontend/src/app/docs/api-docs/api-docs.component.html @@ -203,6 +203,10 @@

When a new block is found, mining pools send miners a block template with no transactions so they can start searching for the next block as soon as possible. They send a block template full of transactions right afterward, but a full block template is a bigger data transfer and takes slightly longer to reach miners.

In this intervening time, which is usually no more than 1-2 seconds, miners sometimes get lucky and find a new block using the empty block template.

+ +

Block validation rules do not strictly require that a block's timestamp be more recent than the timestamp of the block preceding it. Without a central authority, it's impossible to know what the exact correct time is. Instead, the Bitcoin protocol requires that a block's timestamp meet certain requirements. One of those requirements is that a block's timestamp cannot be older than the median timestamp of the 12 blocks that came before it. See more details here.

As a result, timestamps are only accurate to within an hour or so, which sometimes results in blocks with timestamps that appear out of order.

+
+ The official mempool.space website is operated by The Mempool Open Source Project. See more information on our About page. There are also many unofficial instances of this website operated by individual members of the Bitcoin community. From 8bd3e14652431bb83ae95aec82b5a0aded38f165 Mon Sep 17 00:00:00 2001 From: hunicus <93150691+hunicus@users.noreply.github.com> Date: Sun, 13 Nov 2022 22:38:36 -0500 Subject: [PATCH 4/5] Add faq: why block fee ranges don't match tx fees --- frontend/src/app/docs/api-docs/api-docs-data.ts | 7 +++++++ frontend/src/app/docs/api-docs/api-docs.component.html | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/frontend/src/app/docs/api-docs/api-docs-data.ts b/frontend/src/app/docs/api-docs/api-docs-data.ts index 9b2fcac4b..8cbf03dfb 100644 --- a/frontend/src/app/docs/api-docs/api-docs-data.ts +++ b/frontend/src/app/docs/api-docs/api-docs-data.ts @@ -8660,6 +8660,13 @@ export const faqData = [ fragment: "why-block-timestamps-dont-always-increase", title: "Why don't block timestamps always increase?", }, + { + type: "endpoint", + category: "advanced", + showConditions: bitcoinNetworks, + fragment: "why-dont-fee-ranges-match", + title: "Why doesn't the fee range shown for a block match the feerates of transactions within the block?", + }, { type: "category", category: "self-hosting", diff --git a/frontend/src/app/docs/api-docs/api-docs.component.html b/frontend/src/app/docs/api-docs/api-docs.component.html index 35fe40362..5d11432a0 100644 --- a/frontend/src/app/docs/api-docs/api-docs.component.html +++ b/frontend/src/app/docs/api-docs/api-docs.component.html @@ -207,6 +207,12 @@

Block validation rules do not strictly require that a block's timestamp be more recent than the timestamp of the block preceding it. Without a central authority, it's impossible to know what the exact correct time is. Instead, the Bitcoin protocol requires that a block's timestamp meet certain requirements. One of those requirements is that a block's timestamp cannot be older than the median timestamp of the 12 blocks that came before it. See more details here.

As a result, timestamps are only accurate to within an hour or so, which sometimes results in blocks with timestamps that appear out of order.

+ +

Mempool aims to show you the effective feerate range for blocks—how much would you actually need to pay to get a transaction included in a block.

+

A transaction's effective feerate is not always the same as the feerate explicitly set for it. For example, if you see a 1 s/vb transaction in a block with a displayed feerate range of 5 s/vb to 72 s/vb, chances are that 1 s/vb transaction had a high-feerate child transaction that boosted its effective feerate to 5 s/vb or higher (this is how CPFP fee-bumping works). In such a case, it would be misleading to use 1 s/vb as the lower bound of the block's feerate range because it actually required more than 1 s/vb to confirm that transaction in that block.

+

For unconfirmed CPFP transactions, Mempool will show the effective feerate (along with descendent & ancestor transaction information) on the transaction page. For confirmed transactions, CPFP relationships are not stored, so this additional information is not shown.

+
+ The official mempool.space website is operated by The Mempool Open Source Project. See more information on our About page. There are also many unofficial instances of this website operated by individual members of the Bitcoin community. From 7c7273b696e24526eb5e9bc5b90474212fbab206 Mon Sep 17 00:00:00 2001 From: nymkappa Date: Sun, 20 Nov 2022 19:23:51 +0900 Subject: [PATCH 5/5] Remove FTX from the price feeds --- backend/src/tasks/price-feeds/ftx-api.ts | 43 ------------------------ backend/src/tasks/price-updater.ts | 3 -- 2 files changed, 46 deletions(-) delete mode 100644 backend/src/tasks/price-feeds/ftx-api.ts diff --git a/backend/src/tasks/price-feeds/ftx-api.ts b/backend/src/tasks/price-feeds/ftx-api.ts deleted file mode 100644 index 193d3e881..000000000 --- a/backend/src/tasks/price-feeds/ftx-api.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { query } from '../../utils/axios-query'; -import priceUpdater, { PriceFeed, PriceHistory } from '../price-updater'; - -class FtxApi implements PriceFeed { - public name: string = 'FTX'; - public currencies: string[] = ['USD', 'BRZ', 'EUR', 'JPY', 'AUD']; - - public url: string = 'https://ftx.com/api/markets/BTC/'; - public urlHist: string = 'https://ftx.com/api/markets/BTC/{CURRENCY}/candles?resolution={GRANULARITY}'; - - constructor() { - } - - public async $fetchPrice(currency): Promise { - const response = await query(this.url + currency); - return response ? parseInt(response['result']['last'], 10) : -1; - } - - public async $fetchRecentPrice(currencies: string[], type: 'hour' | 'day'): Promise { - const priceHistory: PriceHistory = {}; - - for (const currency of currencies) { - if (this.currencies.includes(currency) === false) { - continue; - } - - const response = await query(this.urlHist.replace('{GRANULARITY}', type === 'hour' ? '3600' : '86400').replace('{CURRENCY}', currency)); - const pricesRaw = response ? response['result'] : []; - - for (const price of pricesRaw as any[]) { - const time = Math.round(price['time'] / 1000); - if (priceHistory[time] === undefined) { - priceHistory[time] = priceUpdater.getEmptyPricesObj(); - } - priceHistory[time][currency] = price['close']; - } - } - - return priceHistory; - } -} - -export default FtxApi; diff --git a/backend/src/tasks/price-updater.ts b/backend/src/tasks/price-updater.ts index 891e2bce3..e069e4db4 100644 --- a/backend/src/tasks/price-updater.ts +++ b/backend/src/tasks/price-updater.ts @@ -1,13 +1,11 @@ import * as fs from 'fs'; import path from "path"; -import { Common } from '../api/common'; import config from '../config'; import logger from '../logger'; import PricesRepository from '../repositories/PricesRepository'; import BitfinexApi from './price-feeds/bitfinex-api'; import BitflyerApi from './price-feeds/bitflyer-api'; import CoinbaseApi from './price-feeds/coinbase-api'; -import FtxApi from './price-feeds/ftx-api'; import GeminiApi from './price-feeds/gemini-api'; import KrakenApi from './price-feeds/kraken-api'; @@ -48,7 +46,6 @@ class PriceUpdater { this.latestPrices = this.getEmptyPricesObj(); this.feeds.push(new BitflyerApi()); // Does not have historical endpoint - this.feeds.push(new FtxApi()); this.feeds.push(new KrakenApi()); this.feeds.push(new CoinbaseApi()); this.feeds.push(new BitfinexApi());