@offckb/cli 0.1.0-rc1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,175 @@
1
+ # Config generated by `ckb init --chain dev`
2
+
3
+ data_dir = "data"
4
+
5
+ [chain]
6
+ # Choose the kind of chains to run, possible values:
7
+ # - { file = "specs/dev.toml" }
8
+ # - { bundled = "specs/testnet.toml" }
9
+ # - { bundled = "specs/mainnet.toml" }
10
+ spec = { file = "specs/dev.toml" }
11
+
12
+ [logger]
13
+ filter = "info"
14
+ color = true
15
+ log_to_file = true
16
+ log_to_stdout = true
17
+
18
+ [sentry]
19
+ # set to blank to disable sentry error collection
20
+ dsn = ""
21
+ # if you are willing to help us to improve,
22
+ # please leave a way to contact you when we have troubles to reproduce the errors.
23
+ # org_contact = ""
24
+
25
+ # # **Experimental** Monitor memory changes.
26
+ # [memory_tracker]
27
+ # # Seconds between checking the process, 0 is disable, default is 0.
28
+ # interval = 600
29
+
30
+ [db]
31
+ # The capacity of RocksDB cache, which caches uncompressed data blocks, indexes and filters, default is 256MB.
32
+ # Rocksdb will automatically create and use an 32MB internal cache for each column family by default if you set this value to 0.
33
+ # To turning off cache, you need to set this value to 0 and set `no_block_cache = true` in the options_file,
34
+ # however, we strongly discourage this setting, it may lead to severe performance degradation.
35
+ cache_size = 268435456
36
+
37
+ # Provide an options file to tune RocksDB for your workload and your system configuration.
38
+ # More details can be found in [the official tuning guide](https://github.com/facebook/rocksdb/wiki/RocksDB-Tuning-Guide).
39
+ options_file = "default.db-options"
40
+
41
+ [network]
42
+ listen_addresses = ["/ip4/0.0.0.0/tcp/8115"]
43
+ ### Specify the public and routable network addresses
44
+ # public_addresses = []
45
+
46
+ # Node connects to nodes listed here to discovery other peers when there's no local stored peers.
47
+ # When chain.spec is changed, this usually should also be changed to the bootnodes in the new chain.
48
+ bootnodes = []
49
+
50
+ ### Whitelist-only mode
51
+ # whitelist_only = false
52
+ ### Whitelist peers connecting from the given IP addresses
53
+ # whitelist_peers = []
54
+ ### Enable `SO_REUSEPORT` feature to reuse port on Linux, not supported on other OS yet
55
+ # reuse_port_on_linux = true
56
+
57
+ max_peers = 125
58
+ max_outbound_peers = 8
59
+ # 2 minutes
60
+ ping_interval_secs = 120
61
+ # 20 minutes
62
+ ping_timeout_secs = 1200
63
+ connect_outbound_interval_secs = 15
64
+ # If set to true, try to register upnp
65
+ upnp = false
66
+ # If set to true, network service will add discovered local address to peer store, it's helpful for private net development
67
+ discovery_local_address = true
68
+ # If set to true, random cleanup when there are too many inbound nodes
69
+ # Ensure that itself can continue to serve as a bootnode node
70
+ bootnode_mode = false
71
+
72
+ # Supported protocols list, only "Sync" and "Identify" are mandatory, others are optional
73
+ support_protocols = ["Ping", "Discovery", "Identify", "Feeler", "DisconnectMessage", "Sync", "Relay", "Time", "Alert", "LightClient", "Filter"]
74
+
75
+ # [network.sync.header_map]
76
+ # memory_limit = "256MB"
77
+
78
+ [rpc]
79
+ # By default RPC only binds to localhost, thus it only allows accessing from the same machine.
80
+ #
81
+ # Allowing arbitrary machines to access the JSON-RPC port is dangerous and strongly discouraged.
82
+ # Please strictly limit the access to only trusted machines.
83
+ listen_address = "0.0.0.0:8114"
84
+
85
+ # Default is 10MiB = 10 * 1024 * 1024
86
+ max_request_body_size = 10485760
87
+
88
+ # List of API modules: ["Net", "Pool", "Miner", "Chain", "Stats", "Subscription", "Experiment", "Debug", "Indexer"]
89
+ modules = ["Net", "Pool", "Miner", "Chain", "Stats", "Subscription", "Experiment", "Debug", "Indexer"]
90
+
91
+ # By default RPC only binds to HTTP service, you can bind it to TCP and WebSocket.
92
+ # tcp_listen_address = "127.0.0.1:18114"
93
+ # ws_listen_address = "127.0.0.1:28114"
94
+ reject_ill_transactions = true
95
+
96
+ # By default deprecated rpc methods are disabled.
97
+ enable_deprecated_rpc = false
98
+
99
+ [tx_pool]
100
+ max_tx_pool_size = 180_000_000 # 180mb
101
+ min_fee_rate = 1_000 # Here fee_rate are calculated directly using size in units of shannons/KB
102
+ # min_rbf_rate > min_fee_rate means RBF is enabled
103
+ min_rbf_rate = 1_500 # Here fee_rate are calculated directly using size in units of shannons/KB
104
+ max_tx_verify_cycles = 70_000_000
105
+ max_ancestors_count = 25
106
+
107
+ [store]
108
+ header_cache_size = 4096
109
+ cell_data_cache_size = 128
110
+ block_proposals_cache_size = 30
111
+ block_tx_hashes_cache_size = 30
112
+ block_uncles_cache_size = 30
113
+
114
+ # [notifier]
115
+ # # Execute command when the new tip block changes, first arg is block hash.
116
+ # new_block_notify_script = "your_new_block_notify_script.sh"
117
+ # # Execute command when node received an network alert, first arg is alert message string.
118
+ # network_alert_notify_script = "your_network_alert_notify_script.sh"
119
+
120
+ # Set the lock script to protect mined CKB.
121
+ #
122
+ # CKB uses CS architecture for miner. Miner process (ckb miner) gets block
123
+ # template from the Node process (ckb run) via RPC. Thus the lock script is
124
+ # configured in ckb.toml instead of ckb-miner.toml, and the config takes effect
125
+ # after restarting Node process.
126
+ #
127
+ # The `code_hash` identifies different cryptography algorithm. Read the manual
128
+ # of the lock script provider about how to generate this config.
129
+ #
130
+ # CKB provides an secp256k1 implementation, it requires a hash on the
131
+ # compressed public key. The hash algorithm is blake2b, with personal
132
+ # "ckb-default-hash". The first 160 bits (20 bytes) are used as the only arg.
133
+ #
134
+ # You can use any tool you trust to generate a Bitcoin private key and public
135
+ # key pair, which can be used in CKB as well. CKB CLI provides the function for
136
+ # you to convert the public key into block assembler configuration parameters.
137
+ #
138
+ # Here is an example using ckb-cli to generate an account, this command will
139
+ # print the block assembler args(lock_arg) to screen:
140
+ #
141
+ # ckb-cli account new
142
+ #
143
+ # If you already have a raw secp256k1 private key, you can get the lock_arg by:
144
+ #
145
+ # ckb-cli util key-info --privkey-path <privkey-path>
146
+ #
147
+ # The command `ckb init` also accepts options to generate the block assembler
148
+ # directly. See `ckb init --help` for details.
149
+ #
150
+ # ckb init <lock_arg>
151
+ #
152
+ # secp256k1_blake160_sighash_all example:
153
+ # [block_assembler]
154
+ # code_hash = "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8"
155
+ # args = "ckb-cli util blake2b --prefix-160 <compressed-pubkey>"
156
+ # hash_type = "type"
157
+ # message = "A 0x-prefixed hex string"
158
+ # #
159
+ # # CKB will prepend the binary version to message, to identify the block miner client. (default true, false to disable it)
160
+ # use_binary_version_as_message_prefix = true
161
+ # #
162
+ # # Block assembler will notify new block template through http post to specified endpoints when update
163
+ # notify = ["http://127.0.0.1:8888"]
164
+ # # Or you may want use more flexible scripts, block template as arg.
165
+ # notify_scripts = ["{cmd} {blocktemplate}"]
166
+ #
167
+ # [indexer_v2]
168
+ # # Indexing the pending txs in the ckb tx-pool
169
+ # index_tx_pool = false
170
+
171
+ [block_assembler]
172
+ code_hash = "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8"
173
+ args = "0xa1db2eef3f29f3ef6f86c8d2a0772c705c449f4a"
174
+ hash_type = "type"
175
+ message = "0x"
@@ -0,0 +1,18 @@
1
+ # This is a RocksDB option file.
2
+ #
3
+ # For detailed file format spec, please refer to the official documents
4
+ # in https://rocksdb.org/docs/
5
+ #
6
+
7
+ [DBOptions]
8
+ bytes_per_sync=1048576
9
+ max_background_jobs=6
10
+ max_total_wal_size=134217728
11
+ keep_log_file_num=32
12
+
13
+ [CFOptions "default"]
14
+ level_compaction_dynamic_level_bytes=true
15
+ write_buffer_size=8388608
16
+ min_write_buffer_number_to_merge=1
17
+ max_write_buffer_number=2
18
+ max_write_buffer_size_to_maintain=-1
@@ -0,0 +1,247 @@
1
+ name = "ckb_dev"
2
+
3
+ [genesis]
4
+ version = 0
5
+ parent_hash = "0x0000000000000000000000000000000000000000000000000000000000000000"
6
+ timestamp = 0
7
+ compact_target = 0x20010000
8
+ uncles_hash = "0x0000000000000000000000000000000000000000000000000000000000000000"
9
+ nonce = "0x0"
10
+
11
+ [genesis.genesis_cell]
12
+ message = "1708649862081"
13
+
14
+ [genesis.genesis_cell.lock]
15
+ code_hash = "0x0000000000000000000000000000000000000000000000000000000000000000"
16
+ args = "0x"
17
+ hash_type = "data"
18
+
19
+ # An array list paths to system cell files, which is absolute or relative to
20
+ # the directory containing this config file.
21
+ [[genesis.system_cells]]
22
+ file = { bundled = "specs/cells/secp256k1_blake160_sighash_all" }
23
+ create_type_id = true
24
+ capacity = 100_000_0000_0000
25
+ [[genesis.system_cells]]
26
+ file = { bundled = "specs/cells/dao" }
27
+ create_type_id = true
28
+ capacity = 16_000_0000_0000
29
+ [[genesis.system_cells]]
30
+ file = { bundled = "specs/cells/secp256k1_data" }
31
+ create_type_id = false
32
+ capacity = 1_048_617_0000_0000
33
+ [[genesis.system_cells]]
34
+ file = { bundled = "specs/cells/secp256k1_blake160_multisig_all" }
35
+ create_type_id = true
36
+ capacity = 100_000_0000_0000
37
+ [[genesis.system_cells]]
38
+ file = { file = "sudt" }
39
+ create_type_id = true
40
+ [[genesis.system_cells]]
41
+ file = { file = "xudt_rce" }
42
+ create_type_id = true
43
+ [[genesis.system_cells]]
44
+ file = { file = "omni_lock" }
45
+ create_type_id = true
46
+ [[genesis.system_cells]]
47
+ file = { file = "anyone_can_pay" }
48
+ create_type_id = true
49
+ [[genesis.system_cells]]
50
+ file = { file = "always_success" }
51
+ create_type_id = true
52
+
53
+
54
+ [genesis.system_cells_lock]
55
+ code_hash = "0x0000000000000000000000000000000000000000000000000000000000000000"
56
+ args = "0x"
57
+ hash_type = "data"
58
+
59
+ # Dep group cells
60
+ [[genesis.dep_groups]]
61
+ name = "secp256k1_blake160_sighash_all"
62
+ files = [
63
+ { bundled = "specs/cells/secp256k1_data" },
64
+ { bundled = "specs/cells/secp256k1_blake160_sighash_all" },
65
+ ]
66
+ [[genesis.dep_groups]]
67
+ name = "secp256k1_blake160_multisig_all"
68
+ files = [
69
+ { bundled = "specs/cells/secp256k1_data" },
70
+ { bundled = "specs/cells/secp256k1_blake160_multisig_all" },
71
+ ]
72
+
73
+ # For first 11 block
74
+ [genesis.bootstrap_lock]
75
+ code_hash = "0x0000000000000000000000000000000000000000000000000000000000000000"
76
+ args = "0x"
77
+ hash_type = "type"
78
+
79
+ # Burn
80
+ [[genesis.issued_cells]]
81
+ capacity = 8_400_000_000_00000000
82
+ lock.code_hash = "0x0000000000000000000000000000000000000000000000000000000000000000"
83
+ lock.args = "0x62e907b15cbf27d5425399ebf6f0fb50ebb88f18"
84
+ lock.hash_type = "data"
85
+
86
+ #### account-list ####
87
+ # issue for account private key: 0x6109170b275a09ad54877b82f7d9930f88cab5717d484fb4741ae9d1dd078cd6
88
+ [[genesis.issued_cells]]
89
+ capacity = 42_000_000_00000000
90
+ lock.code_hash = "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8"
91
+ lock.args = "0x8e42b1999f265a0078503c4acec4d5e134534297"
92
+ lock.hash_type = "type"
93
+
94
+ # issue for account private key: 0x9f315d5a9618a39fdc487c7a67a8581d40b045bd7a42d83648ca80ef3b2cb4a1
95
+ [[genesis.issued_cells]]
96
+ capacity = 42_000_000_00000000
97
+ lock.code_hash = "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8"
98
+ lock.args = "0x758d311c8483e0602dfad7b69d9053e3f917457d"
99
+ lock.hash_type = "type"
100
+
101
+ # issue for account private key: 0x59ddda57ba06d6e9c5fa9040bdb98b4b098c2fce6520d39f51bc5e825364697a
102
+ [[genesis.issued_cells]]
103
+ capacity = 42_000_000_00000000
104
+ lock.code_hash = "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8"
105
+ lock.args = "0x9d1edebedf8f026c0d597c4c5cd3f45dec1f7557"
106
+ lock.hash_type = "type"
107
+
108
+ # issue for account private key: 0xf4a1fc19468b51ba9d1f0f5441fa3f4d91e625b2af105e1e37cc54bf9b19c0a1
109
+ [[genesis.issued_cells]]
110
+ capacity = 42_000_000_00000000
111
+ lock.code_hash = "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8"
112
+ lock.args = "0xe65f823bc5a48a38515690604e503dba4eb15d61"
113
+ lock.hash_type = "type"
114
+
115
+ # issue for account private key: 0x0334ddff3b1e19af5c5fddda8dbcfb235416eaaba11cfca8acf63ad46e9f55b2
116
+ [[genesis.issued_cells]]
117
+ capacity = 42_000_000_00000000
118
+ lock.code_hash = "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8"
119
+ lock.args = "0x9665e6bc1966ec2bfcca4f11782d2b906f38438f"
120
+ lock.hash_type = "type"
121
+
122
+ # issue for account private key: 0x6f358d92f408511707803d292efa148236a2e114d73a472be2a07e0ba49200c7
123
+ [[genesis.issued_cells]]
124
+ capacity = 42_000_000_00000000
125
+ lock.code_hash = "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8"
126
+ lock.args = "0x0df9552f53d51a378aba267bc858dada447e8400"
127
+ lock.hash_type = "type"
128
+
129
+ # issue for account private key: 0xbde2f19c98dc5ab4cc98f73c573757a9f1782dc44398022a23f77ca752ad8fbe
130
+ [[genesis.issued_cells]]
131
+ capacity = 42_000_000_00000000
132
+ lock.code_hash = "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8"
133
+ lock.args = "0x683188bb29502ba6e702b7c650cc80707c3f8b4b"
134
+ lock.hash_type = "type"
135
+
136
+ # issue for account private key: 0x7c1280118923ea96529909638dac9bd258251a222783f91dedbf82de15526fd2
137
+ [[genesis.issued_cells]]
138
+ capacity = 42_000_000_00000000
139
+ lock.code_hash = "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8"
140
+ lock.args = "0x532bfb946e4b108d14758ca38e6e3b4af6801996"
141
+ lock.hash_type = "type"
142
+
143
+ # issue for account private key: 0x1fe1356d47224f34788eb099c4f67ab28a477a5a85d6ff4e54c240c11a0c693c
144
+ [[genesis.issued_cells]]
145
+ capacity = 42_000_000_00000000
146
+ lock.code_hash = "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8"
147
+ lock.args = "0x3982ac2f4893dfcac091ef795bb778cc2a25edd9"
148
+ lock.hash_type = "type"
149
+
150
+ # issue for account private key: 0xc3255dd2bbc3accc69c82bdb2c927ab4a681146331d5e01990890fb3cd732b47
151
+ [[genesis.issued_cells]]
152
+ capacity = 42_000_000_00000000
153
+ lock.code_hash = "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8"
154
+ lock.args = "0x5aab386e8a9f4f869776674c7181ea76fef75b55"
155
+ lock.hash_type = "type"
156
+
157
+ # issue for account private key: 0x8c3f8a6a6847a31af93000a31629f0c674e0cbb1b7cb71bdfbf4fb9dd828a518
158
+ [[genesis.issued_cells]]
159
+ capacity = 42_000_000_00000000
160
+ lock.code_hash = "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8"
161
+ lock.args = "0xf6ca1c08a40ab3d00e2299930cf0f8c298a1a90d"
162
+ lock.hash_type = "type"
163
+
164
+ # issue for account private key: 0x11e34fc1bad213b1ce3071501a18c39e5dbf1ea2e66ac05059c36a5d1e7a56cf
165
+ [[genesis.issued_cells]]
166
+ capacity = 42_000_000_00000000
167
+ lock.code_hash = "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8"
168
+ lock.args = "0x5cb8098824329c3a2e731641ae4e90ba0a3ec396"
169
+ lock.hash_type = "type"
170
+
171
+ # issue for account private key: 0x0a0ecce6f15c444e6d0013d6eb79c87babff2c76447f3a2f6b28023490170c1f
172
+ [[genesis.issued_cells]]
173
+ capacity = 42_000_000_00000000
174
+ lock.code_hash = "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8"
175
+ lock.args = "0x516932280d5ff3108119fe2361d0868f1998dcc4"
176
+ lock.hash_type = "type"
177
+
178
+ # issue for account private key: 0x006250e940dbce94ad9329ac16c109acf7de98c7e4738013bdd3105d4f004d8a
179
+ [[genesis.issued_cells]]
180
+ capacity = 42_000_000_00000000
181
+ lock.code_hash = "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8"
182
+ lock.args = "0x7a83042ddabeb27294fe62588df7acc627d4181f"
183
+ lock.hash_type = "type"
184
+
185
+ # issue for account private key: 0xfc8142dc0a6c1dc9102696e7ca730b8c05e233549ea924fafa477f5086d94ac3
186
+ [[genesis.issued_cells]]
187
+ capacity = 42_000_000_00000000
188
+ lock.code_hash = "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8"
189
+ lock.args = "0x1416fe8e3e1d659a235f5f35b30f7cfbdf9fd77c"
190
+ lock.hash_type = "type"
191
+
192
+ # issue for account private key: 0x711aa98da3e9643170de94d6b16d3a30edf4bb231aa793aaac0fc7373c0f6322
193
+ [[genesis.issued_cells]]
194
+ capacity = 42_000_000_00000000
195
+ lock.code_hash = "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8"
196
+ lock.args = "0xf246d3f9d94aab2688babb4802879056d9bf5810"
197
+ lock.hash_type = "type"
198
+
199
+ # issue for account private key: 0x76f51bf03e38b7f4a3c2cd8b088103e746f0e425fb0c5e0f8b22061f41c790cc
200
+ [[genesis.issued_cells]]
201
+ capacity = 42_000_000_00000000
202
+ lock.code_hash = "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8"
203
+ lock.args = "0x4ec295923dde1b522835007f9260e8ba398dc7cb"
204
+ lock.hash_type = "type"
205
+
206
+ # issue for account private key: 0x1ef1c9cbf031d7bc181c039cebb4f2914dbad689ab268e192fe22ea314d9b4a4
207
+ [[genesis.issued_cells]]
208
+ capacity = 42_000_000_00000000
209
+ lock.code_hash = "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8"
210
+ lock.args = "0xd7ab64e757d1177a955a5c997a6ba7feab49161b"
211
+ lock.hash_type = "type"
212
+
213
+ # issue for account private key: 0xa5808e79c243d8e026a034273ad7a5ccdcb2f982392fd0230442b1734c98a4c2
214
+ [[genesis.issued_cells]]
215
+ capacity = 42_000_000_00000000
216
+ lock.code_hash = "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8"
217
+ lock.args = "0x9ba28269270223ba366a29dc96401910540894a4"
218
+ lock.hash_type = "type"
219
+
220
+ # issue for account private key: 0xace08599f3174f4376ae51fdc30950d4f2d731440382bb0aa1b6b0bd3a9728cd
221
+ [[genesis.issued_cells]]
222
+ capacity = 42_000_000_00000000
223
+ lock.code_hash = "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8"
224
+ lock.args = "0x4118c8c16749bf126b22468d030bf9de7da3717b"
225
+ lock.hash_type = "type"
226
+ #### account-list ####
227
+
228
+
229
+ [params]
230
+ initial_primary_epoch_reward = 1_917_808_21917808
231
+ secondary_epoch_reward = 613_698_63013698
232
+ max_block_cycles = 10_000_000_000
233
+ cellbase_maturity = 0
234
+ primary_epoch_reward_halving_interval = 8760
235
+ epoch_duration_target = 14400
236
+ genesis_epoch_length = 1000
237
+ # For development and testing purposes only.
238
+ # Keep difficulty be permanent if the pow is Dummy. (default: false)
239
+ permanent_difficulty_in_dummy = true
240
+ starting_block_limiting_dao_withdrawing_lock = 0
241
+
242
+ [params.hardfork]
243
+ ckb2023 = 0
244
+
245
+
246
+ [pow]
247
+ func = "Dummy"
Binary file
Binary file
Binary file
@@ -0,0 +1,37 @@
1
+ # Requires docker-compose >= 1.29.0
2
+ version: '3.8'
3
+
4
+ services:
5
+ # TODO: update CKB version
6
+ ckb:
7
+ image: nervos/ckb:v0.113.1
8
+ user: root
9
+ ports:
10
+ - 8114:8114 # rpc
11
+ - 8115:8115 # p2p network
12
+ volumes:
13
+ - ./devnet:/var/lib/ckb
14
+ command: [ "run", "-C", "/var/lib/ckb" ]
15
+
16
+ # TODO: update CKB version
17
+ ckb-miner:
18
+ init: true
19
+ image: nervos/ckb:v0.113.1
20
+ user: root
21
+ volumes:
22
+ - ./devnet:/var/lib/ckb
23
+ command: [ "miner", "-C", "/var/lib/ckb" ]
24
+
25
+ # "nervos/ckb" image have no http clients to do health check for CKB.
26
+ # This short-term service act as a workaround to do health check.
27
+ check-ckb-started-successfully:
28
+ image: curlimages/curl
29
+ volumes:
30
+ - ./devnet:/var/lib/ckb
31
+ command: [ 'http://ckb:8114', '-H', 'content-type: application/json', '-d', '{ "id": 2, "jsonrpc": "2.0", "method": "get_tip_block_number", "params": [] }' ]
32
+ deploy:
33
+ restart_policy:
34
+ condition: on-failure
35
+ max_attempts: 1000
36
+ depends_on:
37
+ - ckb
package/package.json ADDED
@@ -0,0 +1,69 @@
1
+ {
2
+ "name": "@offckb/cli",
3
+ "version": "0.1.0-rc1",
4
+ "description": "ckb development environment for professionals",
5
+ "author": "Retric Su <retric@cryptape.com>",
6
+ "license": "MIT",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/retricsu/offckb.git"
10
+ },
11
+ "main": "dist/cli.js",
12
+ "bin": {
13
+ "offckb": "dist/cli.js"
14
+ },
15
+ "files": [
16
+ "dist",
17
+ "account",
18
+ "docker",
19
+ "templates"
20
+ ],
21
+ "private": false,
22
+ "publishConfig": {
23
+ "access": "public"
24
+ },
25
+ "scripts": {
26
+ "build": "tsc",
27
+ "start": "ts-node-dev --transpile-only src/cli.ts",
28
+ "clean": "rm -rf ./target",
29
+ "docker": "cd docker && docker-compose up",
30
+ "lint": "eslint \"{src,template}/**/*.ts\" \"{src,template}/**/*.tsx\" --ignore-pattern 'node_modules/'",
31
+ "lint:fix": "eslint \"{src,template}/**/*.ts\" \"{src,template}/**/*.tsx\" --ignore-pattern 'node_modules/' --fix",
32
+ "fmt": "prettier --write '{src,template,account}/**/*.{js,jsx,ts,tsx,md,json}'"
33
+ },
34
+ "husky": {
35
+ "hooks": {
36
+ "pre-commit": "lint-staged"
37
+ }
38
+ },
39
+ "lint-staged": {
40
+ "{src,template,account}/**/*.{js,jsx,ts,tsx,md,json}": "prettier --ignore-unknown --write"
41
+ },
42
+ "eslintConfig": {
43
+ "extends": [
44
+ "eslint:recommended",
45
+ "plugin:@typescript-eslint/recommended"
46
+ ]
47
+ },
48
+ "devDependencies": {
49
+ "@types/adm-zip": "^0.5.5",
50
+ "@types/node": "^20.11.19",
51
+ "@types/semver": "^7.5.7",
52
+ "@typescript-eslint/eslint-plugin": "^7.0.2",
53
+ "@typescript-eslint/parser": "^7.0.2",
54
+ "eslint": "^8.57.0",
55
+ "husky": "^9.0.11",
56
+ "lint-staged": "^15.2.2",
57
+ "prettier": "^3.2.5",
58
+ "ts-node-dev": "^2.0.0",
59
+ "typescript": "^5.3.3"
60
+ },
61
+ "dependencies": {
62
+ "@ckb-lumos/lumos": "0.21.1",
63
+ "adm-zip": "^0.5.10",
64
+ "axios": "^1.6.7",
65
+ "child_process": "^1.0.2",
66
+ "commander": "^12.0.0",
67
+ "semver": "^7.6.0"
68
+ }
69
+ }