Skip to content

Commit

Permalink
Merge pull request #16 from DeckerSU/static-dev
Browse files Browse the repository at this point in the history
Komodo-Qt (KomodoOcean) [Draconic Serpent]
  • Loading branch information
DeckerSU authored May 25, 2020
2 parents f0495c3 + f26d523 commit b6f33fa
Show file tree
Hide file tree
Showing 151 changed files with 1,902 additions and 396 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ brew install protobuf
brew install coreutils
brew install wget
# Clone the Komodo repo
git clone https://github.com/DeckerSU/KomodoOcean --branch statoc --single-branch
git clone https://github.com/DeckerSU/KomodoOcean --branch static --single-branch
# Change master branch to other branch you wish to compile
cd komodo
./zcutil/fetch-params.sh
Expand Down
54 changes: 54 additions & 0 deletions contrib/linearize/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Linearize
Construct a linear, no-fork, best version of the Komodo (or smartchain) blockchain.

## Step 1: Download hash list

$ ./linearize-hashes.py linearize.cfg > hashlist.txt

Required configuration file settings for linearize-hashes:
* RPC: `datadir` (Required if `rpcuser` and `rpcpassword` are not specified)
* RPC: `rpcuser`, `rpcpassword` (Required if `datadir` is not specified)

Optional config file setting for linearize-hashes:
* RPC: `host` (Default: `127.0.0.1`)
* RPC: `port` (Default: `7771`)
* Blockchain: `min_height`, `max_height`
* `rev_hash_bytes`: If true, the written block hash list will be
byte-reversed. (In other words, the hash returned by getblockhash will have its
bytes reversed.) False by default. Intended for generation of
standalone hash lists but safe to use with linearize-data.py, which will output
the same data no matter which byte format is chosen.

The `linearize-hashes` script requires a connection, local or remote, to a
JSON-RPC server. Running `komodod` or `komodo-qt -server` will be sufficient.

## Step 2: Copy local block data

$ ./linearize-data.py linearize.cfg

Required configuration file settings:
* `output_file`: The file that will contain the final blockchain.
or
* `output`: Output directory for linearized `blocks/blkNNNNN.dat` output.

Optional config file setting for linearize-data:
* `debug_output`: Some printouts may not always be desired. If true, such output
will be printed.
* `file_timestamp`: Set each file's last-accessed and last-modified times,
respectively, to the current time and to the timestamp of the most recent block
written to the script's blockchain.
* `genesis`: The hash of the genesis block in the blockchain.
* `input`: komodod blocks/ directory containing blkNNNNN.dat
* `hashlist`: text file containing list of block hashes created by
linearize-hashes.py.
* `max_out_sz`: Maximum size for files created by the `output_file` option.
(Default: `1000*1000*1000 bytes`)
* `netmagic`: Network magic number.
* `out_of_order_cache_sz`: If out-of-order blocks are being read, the block can
be written to a cache so that the blockchain doesn't have to be sought again.
This option specifies the cache size. (Default: `100*1000*1000 bytes`)
* `rev_hash_bytes`: If true, the block hash list written by linearize-hashes.py
will be byte-reversed when read by linearize-data.py. See the linearize-hashes
entry for more information.
* `split_timestamp`: Split blockchain files when a new month is first seen, in
addition to reaching a maximum file size (`max_out_sz`).
55 changes: 55 additions & 0 deletions contrib/linearize/example-linearize.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# bitcoind RPC settings (linearize-hashes)
rpcuser=bitcoin
rpcpassword=local321
datadir=~/.komodo
host=127.0.0.1

#mainnet default
port=7771

#testnet default
#port=18332

#regtest default
#port=18443

# bootstrap.dat hashlist settings (linearize-hashes)
max_height=1844224

# bootstrap.dat input/output settings (linearize-data)

# mainnet
netmagic=f9eee48d
genesis=027e3758c3a65b12aa1046462b486d0a63bfa1beae327897f56c5cfb7daaae71
input=/home/decker/.komodo/blocks

# testnet
#netmagic=0b110907
#genesis=000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943
#input=/home/example/.bitcoin/testnet3/blocks

# regtest
#netmagic=fabfb5da
#genesis=0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206
#input=/home/example/.bitcoin/regtest/blocks

# "output" option causes blockchain files to be written to the given location,
# with "output_file" ignored. If not used, "output_file" is used instead.
# output=/home/example/blockchain_directory
output_file=/home/decker/bootstrap.dat
hashlist=hashlist.txt

# Maximum size in bytes of out-of-order blocks cache in memory
out_of_order_cache_sz = 100000000

# Do we want the reverse the hash bytes coming from getblockhash?
rev_hash_bytes = False

# On a new month, do we want to set the access and modify times of the new
# blockchain file?
file_timestamp = 0
# Do we want to split the blockchain files given a new month or specific height?
split_timestamp = 0

# Do we want debug printouts?
debug_output = False
Loading

0 comments on commit b6f33fa

Please sign in to comment.