@ickb/v1-core
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

iCKB v1 core

Setup

Deploy contracts

  1. Download this repo in a folder of your choice:
git clone https://github.com/ickb/v1-core.git
  1. Enter into the repo's folder:
cd v1-core/
  1. 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

  1. Enter home:
cd ~;
  1. 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
  1. Create a ~/ckb directory:
mkdir ~/ckb
  1. 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
  1. Install capsule v0.10.1

Devchain configuration

This is section takes material from both Nervos devchain guide and Ian instructions.

From within ~/ckb:

  1. Init devchain:
ckb init --chain dev
  1. 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"
  1. In the ckb.toml file under the [logger] section set:
[logger]
filter = "ckb-script=debug"# instead of "info"
# Other parameters...
  1. 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
  1. In the ckb-miner.toml file under the [miner.client] section set:
[miner.client]
# Other parameters...
poll_interval = 100 # instead of 1000
  1. In the ckb-miner.toml file under the [[miner.workers]] section set:
[[miner.workers]]
# Other parameters...
value = 200 # instead of 5000
  1. In a new terminal start ckb node and miner:
(trap 'kill -INT 0' SIGINT; cd ~/ckb/; ckb run --indexer & sleep 5 && ckb miner)
  1. Create Private Key Files:
echo 0xd00c06bfd800d27397002dca6fb0993d5ba6399b4238b2f29ee9deb97593d2bc > pk1
echo 0x63d86723e08f0f813a36ce6aa123bb2289d90680ae1e99d4de8cdb334553f24d > pk2
  1. 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.

Readme

Keywords

none

Package Sidebar

Install

npm i @ickb/v1-core

Weekly Downloads

4

Version

1.0.1

License

MIT

Unpacked Size

71.2 kB

Total Files

19

Last publish

Collaborators

  • phroi