Add monero-blockchain-import reference

This commit is contained in:
Piotr Włodarek 2018-11-02 18:06:03 +01:00
parent 8b8c36a231
commit 0fdc79245f
3 changed files with 99 additions and 8 deletions

View file

@ -4,7 +4,7 @@ title: monero-blockchain-export - Reference | Monero Documentation
# `monero-blockchain-export` - Reference
!!! warning
Nowadays, there is little usage for raw blockchain export / import. In the past the p2p blockchain download was much slower. Back than blockchain.raw file was used to speed up the process at the expense of trusting the source.
Nowadays, there is little usage for raw blockchain export / import. In the past the p2p blockchain download was much slower. Back than blockchain.raw file was used to speed up the process of bootstrapping a node.
## Overview
@ -13,7 +13,7 @@ The tool dumps local blockchain to raw format, known as the `blockchain.raw` fil
This could be useful if you want to process blockchain efficiently with your custom tools,
as the raw format is probably easier to work with than Monero's custom lmdb database.
The tool works on your local copy of the blockchain. It does **not** require `monerod` running.
The tool works on your local copy of the blockchain. It does not require `monerod` running.
## Syntax
@ -42,7 +42,7 @@ Go to directory where you unpacked Monero.
| Option | Description
|---------------------|--------------------------------------------------------------------------------------------------------------------------------------
| (missing) | By default monero-blockchain-export assumes [mainnet](/infrastructure/networks#mainnet).
| (missing) | By default `monero-blockchain-export` assumes [mainnet](/infrastructure/networks#mainnet).
| `--stagenet` | Export [stagenet](/infrastructure/networks#stagenet) blockchain.
| `--testnet` | Export [testnet](/infrastructure/networks#testnet) blockchain.
@ -56,10 +56,10 @@ Specifying the log file path is not supported.
### Input
| Option | Description
|---------------------|--------------------------------------------------------------------------------------------------------------------------------------
| `--data-dir` | Full path to data directory. This is where the blockchain, log files, and p2p network memory are stored. For defaults and details see [data directory](/interacting/overview/#data-directory).
| `--database` | The only valid value seems to be `lmdb` (the default).
| Option | Description
|----------------------------|--------------------------------------------------------------------------------------------------------------------------------------
| `--data-dir` | Full path to data directory. This is where the blockchain, log files, and p2p network memory are stored. For defaults and details see [data directory](/interacting/overview/#data-directory).
| `--database`, `--db-type` | The default and only valid value is `lmdb`.
### Output
@ -67,7 +67,7 @@ Specifying the log file path is not supported.
|---------------------|--------------------------------------------------------------------------------------------------------------------------------------
| `--output-file` | Specify output file path. The default is `$DATA_DIR/export/blockchain.raw`. Example: <br />`./monero-blockchain-export --output-file=/tmp/blockchain.raw`
| `--blocksdat` | Output in blocks.dat format.
| `--block-stop` | Block number to stop the export at. Value `0` means full export (the default).
| `--block-stop` | Only export up to this block number. By default do the full export (value `0`).
## Reference

View file

@ -0,0 +1,90 @@
---
title: monero-blockchain-import - Reference | Monero Documentation
---
# `monero-blockchain-import` - Reference
!!! warning
Nowadays, there is little usage for raw blockchain export/import. In the past the p2p blockchain download was much slower. Back than blockchain.raw file was used to speed up download process of bootstrapping a node.
## Overview
The tool imports bootstrap file `blockchain.raw` to your full node.
This could be useful if you want to decouple download from verification for any reason (like testing performance in isolation).
In this case, you may download the `blockchain.raw` file from [https://downloads.getmonero.org/blockchain.raw](https://downloads.getmonero.org/blockchain.raw).
Ideally though, you should use your own trusted `blockchain.raw` file that you [exported](/interacting/monero-blockchain-export-reference) earlier.
Please note that importing `blockchain.raw` will **not** speed up the process over syncing up from p2p network.
This is because usual bottlenecks are disk IO and verification, not the download.
The tool works on your local files. It does not require `monerod` running.
## Syntax
`./monero-blockchain-import [options]`
Example:
`./monero-blockchain-import --help`
## Running
Go to directory where you unpacked Monero.
`./monero-blockchain-import --stagenet --output-file=/tmp/blockchain.raw`
## Options
### Help
| Option | Description
|---------------------|--------------------------------------------------------------------------------------------------------------------------------------
| `--help` | Enlist available options.
### Pick network
| Option | Description
|---------------------|--------------------------------------------------------------------------------------------------------------------------------------
| (missing) | By default `monero-blockchain-import` assumes the [mainnet](/infrastructure/networks#mainnet) blockchain.
| `--stagenet` | Import [stagenet](/infrastructure/networks#stagenet) blockchain.
| `--testnet` | Import [testnet](/infrastructure/networks#testnet) blockchain.
### Logging
Specifying the log file path is not supported.
| Option | Description
|---------------------|--------------------------------------------------------------------------------------------------------------------------------------
| `--log-level` | `0-4` with `0` being minimal logging and `4` being full tracing. Defaults to `0`. These are general presets and do not directly map to severity levels. For example, even with minimal `0`, you may see some most important `INFO` entries. Example: <br />`./monero-blockchain-import --log-level=1`
### Input
| Option | Description
|---------------------|--------------------------------------------------------------------------------------------------------------------------------------
| `--input-file` | Full path to raw blockchain file. The default is `$DATA_DIR/export/blockchain.raw`.
| `--block-stop` | Only import up to this block height. By default import all blocks (value `0`).
| `--pop-blocks` | Discard specified number of blocks from the tip of the bootstrapped blockchain. By default don't discard anything (value `0`).
### Output
| Option | Description
|---------------------|--------------------------------------------------------------------------------------------------------------------------------------
| `--data-dir` | Full path to data directory. This is where the blockchain, log files, and p2p network memory are stored. For defaults and details see [data directory](/interacting/overview/#data-directory).
| `--count-blocks` | Count blocks in the bootstrap file and exit.
| `--drop-hard-fork` | Whether to drop hard fork data. Off by default (`0`).
| `--database` | The only valid value seems to be `lmdb` (the default).
### Performance
| Option | Description
|-----------------------------------|--------------------------------------------------------------------------------------------------------------------------------------
| `--dangerous-unverified-import` | The safe default is to run verification (value `0`). You can enable `--dangerous-unverified-import` if you are importing from your own and trusted blockchain.raw (which we assume was already verified). The "dangerous" mode will greatly speed up the process.
| `--batch` | Whether to save to disk on an ongoing basis (the default, value `1`) or maybe do everything in RAM and save everything in the end (value `0`). No batching is only effective in combination with no verification (`--dangerous-unverified-import`). See also `--batch-size`.
| `--batch-size` | How often to save to disk expressed in number of blocks. By default save every `5000` blocks (when verifying) or every `20000` blocks (when not verifying). Big batches are faster but require more RAM.
| `--resume` | Resume from current height if output database already exists (the default, value `1`). Changing to `--resume=0` doesn't change much &mdash; existing blocks are skipped pretty quickly and the process is resumed anyway.
## Reference
* [https://github.com/monero-project/monero/tree/master/src/blockchain_utilities](https://github.com/monero-project/monero/tree/master/src/blockchain_utilities)

View file

@ -14,6 +14,7 @@ nav:
- monerod: 'interacting/monerod-reference.md'
- monero-wallet-gui: 'interacting/monero-wallet-gui-reference.md'
- monero-blockchain-export: 'interacting/monero-blockchain-export-reference.md'
- monero-blockchain-import: 'interacting/monero-blockchain-import-reference.md'
- Technical specs: 'technical-specs.md'
- Cryptography:
- Introduction: 'cryptography/introduction.md'