Skip to main content
Version: Latest

Godwoken-Kicker

Godwoken-Kicker is a one-line command that launches a local Godwoken network on Devnet. Developers can deploy Ethereum contracts and migrate Ethereum DApps to this local network quickly.

Godwoken-Kicker Commands

Available Commands

./kicker --help
Usage: ./kicker [OPTIONS] <SUBCOMMAND>

OPTIONS:
--help Print usage information
-- <args>... Execute docker-compose command

SUBCOMMANDS:
init Init running environment
start Start services and deploy local network
stop Stop services
info Print some useful info about the network and running services, such as Web3 RPC URL
clean Clean containers volumed data
ps [service] List services
logs [service] Tail target service's logs
enter <service> Enter target service's container
manual-build Manually build services artifacts
deposit <eth-address> <amount> Deposit CKB to layer2
get-balance <eth-address> Get layer2 balance
transfer <eth-address> <amount> <fee> <sudt-id> Transfer sudt token

EXAMPLES:
* Deploy the local network and print service info

$ ./kicker start
$ ./kicker info

* Deposit 1000CKB from layer1 to layer2

$ ./kicker deposit 0x618cc3C660cEBFDbA8570CA739b1744AE3E2553a 1000
$ ./kicker get-balance 0x618cc3C660cEBFDbA8570CA739b1744AE3E2553a

* Redeploy the local network

$ ./kicker -- kill
$ ./kicker stop
$ sudo ./kicker clean
$ ./kicker start

* Execute docker-compose commands

$ ./kicker -- exec ckb ls -l
$ ./kicker -- top godwoken
$ ./kicker -- kill godwoken
$ ./kicker -- --help
  • To view all commands:

    $ ./kicker --help
  • To deploy the local network:

    $ ./kicker start
  • To print the service info:

    $ ./kicker info
  • To deposit CKBs from layer1 to layer2:

    $ ./kicker deposit <eth-address> <amount>
  • To verify the balance of the account:

    $ ./kicker get-balance <eth-address>
  • To redeploy the local network:

    $ ./kicker stop
    $ sudo ./kicker clean
    $ ./kicker start
  • To execute docker-compose commands:

    $ ./kicker -- exec ckb ls -l
    $ ./kicker -- top godwoken
    $ ./kicker -- kill godwoken
    $ ./kicker -- --help

Accounts

Godwoken-Kicker requires the following accounts for a deployment:

  • CKB Miner
  • CKB Faucet
  • Deployer of Rollup Genesis Cells
  • Deployer of Rollup Scripts
  • Godwoken Block Producer

CKB genesis blocks pre-issued large amounts of CKBs to these accounts. Private keys of the accounts can be found in the . /accounts/ directory.

The following commands and associated output demonstrate the information of the accounts. For more details, refer to CKB chain spec.

$ cd godwoken-kicker
$ ls -1 accounts
ckb-miner-and-faucet.key
godwoken-block-producer.key
README.md
rollup-genesis-cell-deployer.key
rollup-scripts-deployer.key

$ ckb-cli util key-info --privkey-path accounts/godwoken-block-producer.key
Put this config in < ckb.toml >:

[block_assembler]
code_hash = "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8"
hash_type = "type"
args = "0x1d4b2a15f55ba1aa035f64ad6080e0943cc5ec0b"
message = "0x"

address:
mainnet: ckb1qyqp6je2zh64hgd2qd0kfttqsrsfg0x9as9szl4xjv
testnet: ckt1qyqp6je2zh64hgd2qd0kfttqsrsfg0x9as9sl6te7s
lock_arg: 0x1d4b2a15f55ba1aa035f64ad6080e0943cc5ec0b
lock_hash: 0x24842c3d28d9df39325ad05284efc3492972eec61606b51ded82369b3de72f04
old-testnet-address: ckt1q9gry5zgr49j5904tws65q6lvjkkpq8qjs7vtmqt3eg4j8
pubkey: 02261c3634191150993cb256adeb0ddf29a2b317b99885323564e28886933c9099
note

One key for everything is possible, but it will lead to confusion and make debugging more difficult.

CKB Miner

The CKB miner account is identified by the CKB miner key that can be used to unlock the block cellbase. The public key of the account is configured in block_assembler, which is located in the ckb.toml file of the CKB base directory.

Click to check details
$ cd godwoken-kicker/docker/layer1/ckb/
$ cat ckb.toml
# Config generated by `ckb init --chain dev`

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/dev.toml" }

[logger]
filter = "info"
color = true
log_to_file = true
log_to_stdout = true

[sentry]
# set to blank to disable sentry error collection
dsn = ""
# 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 = ""

# # **Experimental** Monitor memory changes.
# [memory_tracker]
# # Seconds between checking the process, 0 is disable, default is 0.
# interval = 600

[db]
# The capacity of RocksDB cache, which caches uncompressed data blocks, indexes and filters, default is 128MB.
# Rocksdb will automatically create and use an 8MB internal cache if you set this value to 0.
# To turning off cache, you need to set this value to 0 and set `no_block_cache = true` in the options_file,
# however, we strongly discourage this setting, it may lead to severe performance degradation.
cache_size = 134217728

# Provide an options file to tune RocksDB for your workload and your system configuration.
# More details can be found in [the official tuning guide](https://github.com/facebook/rocksdb/wiki/RocksDB-Tuning-Guide).
options_file = "default.db-options"

[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 = []

### Whitelist-only mode
# whitelist_only = false
### Whitelist peers connecting from the given IP addresses
# whitelist_peers = []
### Enable `SO_REUSEPORT` feature to reuse port on Linux, not supported on other OS yet
# reuse_port_on_linux = true

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 = true
# 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", "Experiment", "Debug"]
modules = ["Net", "Pool", "Miner", "Chain", "Stats", "Subscription", "Experiment", "Debug"]

reject_ill_transactions = true

# By default deprecated rpc methods are disabled.
enable_deprecated_rpc = false

[tx_pool]
max_mem_size = 20_000_000 # 20mb
max_cycles = 200_000_000_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

# [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 = "0xa1db2eef3f29f3ef6f86c8d2a0772c705c449f4a"
hash_type = "type"
message = "0x"

CKB Faucet

The CKB faucet account uses the same key as the CKB miner account. When you execute ./kicker deposit, the CKB faucet account transfers a certain amount of CKBs to a given address and deposits them into Godwoken.

Deployer of Rollup Genesis Cells

The deployer of rollup genesis cells is also known as the Godwoken block producer. This account deploys rollup genesis cells on layer 1. The gw-tools deploy-genesis command uses Omnilock to record the public key for setting up the rollup genesis cells on layer 1.

The private key of the account can be found here.

Deployer of Rollup Scripts

This account is used by gw-tools deploy-scripts to deploy rollup-related scripts to layer 1. The account will be deactivated later on.

The private key of the account can be found here.

Godwoken Block Producer

The private key of the account can be found here.

The following configuration provides more information about this account:

[block_producer.wallet_config]
privkey_path = '/godwoken-block-producer.key'

[block_producer.wallet_config.lock]
code_hash = '0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8'
hash_type = 'type'
args = '0x952809177232d0dba355ba5b6f4eaca39cc57746'