Skip to content

Instantly share code, notes, and snippets.

@muxueqz
Last active March 21, 2020 06:02
Show Gist options
  • Save muxueqz/6d5afcd4c05e2558b79ec3f35f06caba to your computer and use it in GitHub Desktop.
Save muxueqz/6d5afcd4c05e2558b79ec3f35f06caba to your computer and use it in GitHub Desktop.
wget 'https://gist.github.com/muxueqz/6d5afcd4c05e2558b79ec3f35f06caba/raw/7f1890bd82695fb425b50b1a7da5c85cbfa06fff/hackathon-spec.toml' -O aggron-hackathon.toml
ckb init --import-spec ./aggron-hackathon.toml --chain testnet --force
wget 'https://gist.github.com/muxueqz/6d5afcd4c05e2558b79ec3f35f06caba/raw/7c394f4da2f3c9abb5cb76773d3f858ded3c34e8/ckb.toml' -O ckb.toml
ckb run
# Config generated by `ckb init --chain testnet`
data_dir = "data"
[chain]
# Choose the kind of chains to run, possible values:
# - { file = "specs/dev.toml" }
# - { bundled = "specs/testnet.toml" }
# - { bundled = "specs/mainnet.toml" }
spec = { file = "specs/testnet.toml" }
[logger]
filter = "info"
color = true
log_to_file = true
log_to_stdout = true
[sentry]
# set to blank to disable sentry error collection
dsn = "https://[email protected]/1422795"
# if you are willing to help us to improve,
# please leave a way to contact you when we have troubles to reproduce the errors.
# org_contact = ""
[network]
listen_addresses = ["/ip4/0.0.0.0/tcp/8115"]
### Specify the public and routable network addresses
# public_addresses = []
# Node connects to nodes listed here to discovery other peers when there's no local stored peers.
# When chain.spec is changed, this usually should also be changed to the bootnodes in the new chain.
bootnodes = [
"/ip4/18.163.87.248/tcp/4000/p2p/QmVCEXZA123X1yS7TwZ9vtYi7XTGUWF5QimFeBjqMvLTHF",
]
### Whitelist-only mode
# whitelist_only = false
### Whitelist peers connecting from the given IP addresses
# whitelist_peers = []
max_peers = 125
max_outbound_peers = 8
# 2 minutes
ping_interval_secs = 120
# 20 minutes
ping_timeout_secs = 1200
connect_outbound_interval_secs = 15
# If set to true, try to register upnp
upnp = false
# If set to true, network service will add discovered local address to peer store, it's helpful for private net development
discovery_local_address = false
# If set to true, random cleanup when there are too many inbound nodes
# Ensure that itself can continue to serve as a bootnode node
bootnode_mode = false
[rpc]
# By default RPC only binds to localhost, thus it only allows accessing from the same machine.
#
# Allowing arbitrary machines to access the JSON-RPC port is dangerous and strongly discouraged.
# Please strictly limit the access to only trusted machines.
listen_address = "0.0.0.0:8114"
# Default is 10MiB = 10 * 1024 * 1024
max_request_body_size = 10485760
# List of API modules: ["Net", "Pool", "Miner", "Chain", "Stats", "Subscription", "Indexer", "Experiment"]
modules = ["Net", "Pool", "Miner", "Chain", "Stats", "Subscription", "Experiment"]
# By default RPC only binds to HTTP service, you can bind it to TCP and WebSocket.
# tcp_listen_address = "127.0.0.1:18114"
# ws_listen_address = "127.0.0.1:28114"
[tx_pool]
max_mem_size = 20_000_000 # 20mb
max_cycles = 200_000_000_000
max_verify_cache_size = 100_000
max_conflict_cache_size = 1_000
max_committed_txs_hash_cache_size = 100_000
min_fee_rate = 1_000 # shannons/KB
max_tx_verify_cycles = 70_000_000
max_ancestors_count = 25
[store]
header_cache_size = 4096
cell_data_cache_size = 128
block_proposals_cache_size = 30
block_tx_hashes_cache_size = 30
block_uncles_cache_size = 30
cellbase_cache_size = 30
# [indexer]
# # The minimum time (in milliseconds) between indexing execution, default is 500
# batch_interval = 500
# # The maximum number of blocks in a single indexing execution batch, default is 200
# batch_size = 200
# [notifier]
# # Execute command when the new tip block changes, first arg is block hash.
# new_block_notify_script = "your_new_block_notify_script.sh"
# # Execute command when node received an network alert, first arg is alert message string.
# network_alert_notify_script = "your_network_alert_notify_script.sh"
# Set the lock script to protect mined CKB.
#
# CKB uses CS architecture for miner. Miner process (ckb miner) gets block
# template from the Node process (ckb run) via RPC. Thus the lock script is
# configured in ckb.toml instead of ckb-miner.toml, and the config takes effect
# after restarting Node process.
#
# The `code_hash` identifies different cryptography algorithm. Read the manual
# of the lock script provider about how to generate this config.
#
# CKB provides an secp256k1 implementation, it requires a hash on the
# compressed public key. The hash algorithm is blake2b, with personal
# "ckb-default-hash". The first 160 bits (20 bytes) are used as the only arg.
#
# You can use any tool you trust to generate a Bitcoin private key and public
# key pair, which can be used in CKB as well. CKB CLI provides the function for
# you to convert the public key into block assembler configuration parameters.
#
# Here is an example using ckb-cli to generate an account, this command will
# print the block assembler args(lock_arg) to screen:
#
# ckb-cli account new
#
# If you already have a raw secp256k1 private key, you can get the lock_arg by:
#
# ckb-cli util key-info --privkey-path <privkey-path>
#
# The command `ckb init` also accepts options to generate the block assembler
# directly. See `ckb init --help` for details.
#
# ckb init <lock_arg>
#
# secp256k1_blake160_sighash_all example:
# [block_assembler]
# code_hash = "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8"
# args = "ckb cli blake160 <compressed-pubkey>"
# hash_type = "type"
# message = "A 0x-prefixed hex string"
[block_assembler]
code_hash = "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8"
args = "0xda648442dbb7347e467d1d09da13e5cd3a0ef0e1"
hash_type = "type"
message = "0xdeadbeef"
name = "ckb_testnet"
[genesis]
version = 0
parent_hash = "0x0000000000000000000000000000000000000000000000000000000000000000"
timestamp = 1573963200000
compact_target = 0x1e015555
uncles_hash = "0x0000000000000000000000000000000000000000000000000000000000000000"
nonce = "0x0"
# run `cargo run cli hashes -b` to get the genesis hash
#hash = "0x184ac4658ed0c04a126551257990db132366cac22ab6270bbbc1f8c3220f302d"
hash = "0x022abba2160c37c149ea1af02cdb3dc34a48d747616e270d70df73a6a2a1eb75"
[genesis.genesis_cell]
message = "aggron-hackathon"
[genesis.genesis_cell.lock]
code_hash = "0x0000000000000000000000000000000000000000000000000000000000000000"
args = "0x"
hash_type = "data"
# An array list paths to system cell files, which is absolute or relative to
# the directory containing this config file.
[[genesis.system_cells]]
file = { bundled = "specs/cells/secp256k1_blake160_sighash_all" }
create_type_id = true
capacity = 100_000_0000_0000
[[genesis.system_cells]]
file = { bundled = "specs/cells/dao" }
create_type_id = true
capacity = 16_000_0000_0000
[[genesis.system_cells]]
file = { bundled = "specs/cells/secp256k1_data" }
create_type_id = false
capacity = 1_048_617_0000_0000
[[genesis.system_cells]]
file = { bundled = "specs/cells/secp256k1_blake160_multisig_all" }
create_type_id = true
capacity = 100_000_0000_0000
[genesis.system_cells_lock]
code_hash = "0x0000000000000000000000000000000000000000000000000000000000000000"
args = "0x"
hash_type = "data"
# Dep group cells
[[genesis.dep_groups]]
name = "secp256k1_blake160_sighash_all"
files = [
{ bundled = "specs/cells/secp256k1_data" },
{ bundled = "specs/cells/secp256k1_blake160_sighash_all" },
]
[[genesis.dep_groups]]
name = "secp256k1_blake160_multisig_all"
files = [
{ bundled = "specs/cells/secp256k1_data" },
{ bundled = "specs/cells/secp256k1_blake160_multisig_all" },
]
# For first 11 block
[genesis.bootstrap_lock]
code_hash = "0x0000000000000000000000000000000000000000000000000000000000000000"
args = "0x"
hash_type = "type"
# Burn
[[genesis.issued_cells]]
capacity = 8_400_000_000_00000000
lock.code_hash = "0x0000000000000000000000000000000000000000000000000000000000000000"
lock.args = "0x62e907b15cbf27d5425399ebf6f0fb50ebb88f18"
lock.hash_type = "data"
# Locks for developers to run tests
[[genesis.issued_cells]]
capacity = 8_399_578_345_00000000
lock.code_hash = "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8"
lock.args = "0x64257f00b6b63e987609fa9be2d0c86d351020fb"
lock.hash_type = "type"
[[genesis.issued_cells]]
capacity = 8_399_578_345_00000000
lock.code_hash = "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8"
lock.args = "0xda648442dbb7347e467d1d09da13e5cd3a0ef0e1"
lock.hash_type = "type"
[[genesis.issued_cells]]
capacity = 18_399_578_347_00000000
lock.code_hash = "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8"
lock.args = "0xda648442dbb7347e467d1d09da13e5cd3a0ef0e1"
lock.hash_type = "type"
[[genesis.issued_cells]]
capacity = 18_399_578_347_00000000
lock.code_hash = "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8"
lock.args = "0xda648442dbb7347e467d1d09da13e5cd3a0ef0e1"
lock.hash_type = "type"
[[genesis.issued_cells]]
capacity = 18_399_578_347_00000000
lock.code_hash = "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8"
lock.args = "0xda648442dbb7347e467d1d09da13e5cd3a0ef0e1"
lock.hash_type = "type"
[[genesis.issued_cells]]
capacity = 18_399_578_347_00000000
lock.code_hash = "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8"
lock.args = "0xda648442dbb7347e467d1d09da13e5cd3a0ef0e1"
lock.hash_type = "type"
[[genesis.issued_cells]]
capacity = 18_399_578_347_00000000
lock.code_hash = "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8"
lock.args = "0xda648442dbb7347e467d1d09da13e5cd3a0ef0e1"
lock.hash_type = "type"
[[genesis.issued_cells]]
capacity = 18_399_578_347_00000000
lock.code_hash = "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8"
lock.args = "0xda648442dbb7347e467d1d09da13e5cd3a0ef0e1"
lock.hash_type = "type"
[[genesis.issued_cells]]
capacity = 18_399_578_347_00000000
lock.code_hash = "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8"
lock.args = "0xda648442dbb7347e467d1d09da13e5cd3a0ef0e1"
lock.hash_type = "type"
[pow]
func = "Eaglesong"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment