decred.org/dcrwallet/v3@v3.1.0/cmd/repaircfilters/README.md (about)

     1  repaircfilters
     2  ==============
     3  
     4  repaircfilters is a tool that can be used to repair a wallet's pre-DCP0005
     5  filters by importing known-good cfilters into the wallet's database.
     6  
     7  In order to run it needs to be provided with a binary file filled with the
     8  pre-DCP0005 cfilter data in a specific format: for each block height before the
     9  activation height of DCP0005 in the given network the binary file must have a
    10  record with the lenght of the filter plus the filter itself.
    11  
    12  That is:
    13  
    14  ```
    15  ^ len ^      format       ^              field                   ^
    16  |   2 | Big-endian uint16 | Length of the following cfilter data |
    17  |   n | bytes             | Cfilter data for a block             |
    18  ```
    19  
    20  One to generate a file in that format is this:
    21  https://github.com/matheusd/cfilterv2hashes
    22  
    23  ## Building
    24  
    25  Requires go 1.13.
    26  
    27  ## Usage
    28  
    29  Invoke the tool passing the CLI arguments so that it can connect to the wallet
    30  and import the provided cfilter data.
    31  
    32  ```
    33  $ go run . -c localhost:19110 -u USER -p PASSWORD --cafile ~/.dcrwallet/rpc.cert
    34  --cfiltersfile testnet-data.bin
    35  ```
    36