Giter Site home page Giter Site logo

dckb-rescurer's Introduction

dCKB rescuer v1 interface

Setup

Environment Setup

  1. Install Git
  2. Install Node.js 16 LTS
  3. Create ckb_dev folder and move the compiled node ckb#4097 in it:
mkdir ~/ckb_dev &&
cd ~/ckb_dev &&
git clone https://github.com/nervosnetwork/ckb.git &&
mv ckb ckb_tmp &&
cd ckb_tmp &&
git fetch origin pull/4097/head &&
git checkout -b pullrequest FETCH_HEAD &&
make prod_portable &&
mv ./target/prod/ckb ~/ckb_dev &&
cd .. &&
rm -fr ckb_tmp

Devchain configuration

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

  1. Copy the data directory from an existing ckb mainnet installation to ckb_dev:
cd ~/ckb_dev &&
cp -r ~/.config/Neuron/chains/mainnet/data .
  1. Download the corresponding mainnet spec and force import it into a devnet spec:
cd ~/ckb_dev &&
wget https://raw.githubusercontent.com/nervosnetwork/ckb/develop/resource/specs/mainnet.toml &&
mv mainnet.toml mainnet_tmp.toml &&
./ckb init -c dev --import-spec mainnet_tmp.toml --force &&
rm mainnet_tmp.toml
  1. In the specs/dev.toml file change the first line to:
name = "ckb_dev"
  1. In the specs/dev.toml file under the [params] section set:
[params]
genesis_epoch_length = 1743 # keep genesis_epoch_length the same as original file
# Other parameters...
initial_primary_epoch_reward = 1_917_808_21917808
secondary_epoch_reward = 613_698_63013698
max_block_cycles = 10_000_000_000
cellbase_maturity = 0
primary_epoch_reward_halving_interval = 8760
epoch_duration_target = 2 # instead of 14400
permanent_difficulty_in_dummy = true
  1. In the specs/dev.toml file under the [pow] section set:
[pow]
func = "Dummy"
  1. In the ckb.toml file under the [logger] section set:
[logger]
filter = "ckb-script=debug"# instead of "info"
# Other parameters...
  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-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_dev/; ./ckb run --skip-spec-check --overwrite-spec --indexer & sleep 5 && ./ckb miner)

Configure project with local devchain

  1. Download this repo in a folder of your choice:
git clone https://github.com/dckb-rescuer/v1-interface.git
  1. Enter into the repo:
cd v1-interface
  1. Install dependencies:
npm i
  1. Run bot demo:
npm run start

dckb-rescurer's People

Contributors

phroi avatar yixyxiu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.