iCKB v1 core
Setup
Deploy contracts
- Download this repo in a folder of your choice:
git clone https://github.com/ickb/v1-core.git
- Enter into the repo's folder:
cd v1-core/
- Install dependencies:
npm i
4.a Build and deploy the release version of contracts and generate a config.json
:
Start local devnet, refer to the Complete Setup section for further instructions:
(trap 'kill -INT 0' SIGINT; cd ~/ckb/; ckb run --indexer & sleep 5 && ckb miner)
Deploy the contracts
npm run deploy --chain=devnet
4.b Build and deploy the release version of contracts on testnet and generate a config.json
:
npm run deploy --chain=testnet
Complete Setup for devnet
Environment Setup
- Enter home:
cd ~;
- Download
ckb 0.111.0 (Portable)
:
wget https://github.com/nervosnetwork/ckb/releases/download/v0.111.0/ckb_v0.111.0_x86_64-unknown-linux-gnu-portable.tar.gz
- Create a
~/ckb
directory:
mkdir ~/ckb
- Extract the
ckb
compressed folder into~/ckb
tar --extract --file=ckb_v0.111.0_x86_64-unknown-linux-gnu-portable.tar.gz --strip-components=1 --directory=ckb
- Install capsule v0.10.1
Devchain configuration
This is section takes material from both Nervos devchain guide and Ian instructions.
From within ~/ckb
:
- Init devchain:
ckb init --chain dev
- In the
ckb.toml
file under the[block_assembler]
section set:
[block_assembler]
code_hash = "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8"
args = "0xc8328aabcd9b9e8e64fbc566c4385c3bdeb219d7" # ckt1...gwga account
hash_type = "type"
message = "0x"
- In the
ckb.toml
file under the[logger]
section set:
[logger]
filter = "ckb-script=debug"# instead of "info"
# Other parameters...
- In the
specs/dev.toml
file under the[params]
section set:
[params]
# Other parameters...
epoch_duration_target = 2 # instead of 14400
genesis_epoch_length = 2 # instead of 1000
permanent_difficulty_in_dummy = true
- In the
ckb-miner.toml
file under the[miner.client]
section set:
[miner.client]
# Other parameters...
poll_interval = 100 # instead of 1000
- In the
ckb-miner.toml
file under the[[miner.workers]]
section set:
[[miner.workers]]
# Other parameters...
value = 200 # instead of 5000
- In a new terminal start ckb node and miner:
(trap 'kill -INT 0' SIGINT; cd ~/ckb/; ckb run --indexer & sleep 5 && ckb miner)
- Create Private Key Files:
echo 0xd00c06bfd800d27397002dca6fb0993d5ba6399b4238b2f29ee9deb97593d2bc > pk1
echo 0x63d86723e08f0f813a36ce6aa123bb2289d90680ae1e99d4de8cdb334553f24d > pk2
- Import the Private Keys:
ckb-cli account import --privkey-path pk1
ckb-cli account import --privkey-path pk2
Run the project
Please refer to the initial Setup section.
Licensing
The license is the MIT License, see the LICENSE
.