├── .circleci └── config.yml ├── .gitignore ├── README.md ├── docs ├── assets │ ├── ckb-explorer │ │ ├── block1.png │ │ ├── block2.png │ │ ├── charts.png │ │ ├── navigation.png │ │ ├── nervosdao1.png │ │ └── nervosdao2.png │ ├── ckb-structure.png │ ├── getting-started │ │ ├── backup-neuron.png │ │ ├── backup-nkm.png │ │ ├── blocknumber.png │ │ ├── deposit.png │ │ ├── import-keystore1.png │ │ ├── import-keystore2.png │ │ ├── import-seed1.png │ │ ├── import-seed2.png │ │ ├── lookup.png │ │ ├── nervosdao.png │ │ ├── number-explorer.png │ │ ├── seed.png │ │ ├── sync.png │ │ ├── transfer.png │ │ ├── withdraw1.png │ │ └── withdraw2.png │ ├── nervos-layers.png │ ├── nervos-logo-title.svg │ ├── neuron-wallet-guide │ │ ├── backupwallet.png │ │ ├── claim.png │ │ ├── deposit.png │ │ ├── deposit2.png │ │ ├── export.png │ │ ├── importkeystore.png │ │ ├── importseed1.png │ │ ├── importseed2.png │ │ ├── keystorefile.png │ │ ├── nkm.png │ │ ├── password.png │ │ ├── seed.png │ │ ├── send.png │ │ ├── synchronize.png │ │ ├── viewlockedtoken.png │ │ ├── withdraw1.png │ │ └── withdraw2.png │ ├── neuron-wallet │ │ ├── addresses.png │ │ ├── deposit.png │ │ ├── history.png │ │ ├── menu1.png │ │ ├── nervosdao.png │ │ ├── overview.png │ │ ├── receive.png │ │ ├── send.png │ │ └── settings.png │ ├── tooling │ │ └── introduction.png │ └── transaction-validation-lifecycle │ │ ├── 未命名文件 (1).jpg │ │ └── 未命名文件 (2).jpg ├── dev-guide │ ├── api.md │ ├── ckb-cli.md │ ├── ckb-sdk.md │ ├── debugging-ckb-script.md │ ├── devchain.md │ ├── faucet.md │ ├── introduction.md │ └── testnet.md ├── getting-started │ ├── introduction.md │ └── run-node.md ├── glossary │ ├── glossary-economic.md │ ├── glossary-general.md │ └── glossary-technical.md ├── introduction │ ├── nervos-intro.md │ └── welcome.md ├── key-concepts │ ├── cell-model.md │ ├── ckb-vm.md │ ├── consensus.md │ ├── economics.md │ ├── introduction.md │ └── nervos-blockchain.md ├── references │ ├── mining-resources.md │ ├── nervos-design.md │ ├── neuron-faq.md │ ├── neuron-wallet-guide.md │ └── troubleshooting.md ├── technical-concepts │ ├── architecture.md │ ├── ckb-vm-verification-rules.md │ ├── design-philosophy.md │ ├── script-dependencies.md │ ├── state-tokens.md │ └── transaction-validation-lifecycle.md └── tooling │ ├── ckb-explorer.md │ ├── ckb-sdk-js.md │ ├── ckb-sdk-ruby.md │ ├── community.md │ ├── introduction.md │ ├── neuron.md │ └── useful-materials.md └── website ├── core └── Footer.js ├── package.json ├── sidebars.json ├── siteConfig.js ├── static ├── .circleci │ └── config.yml ├── css │ ├── code-block-buttons.css │ └── custom.css ├── img │ ├── favicon.png │ └── nervos-logo.svg ├── index.html └── js │ └── code-block-buttons.js └── yarn-error.log /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | 3 | jobs: 4 | deploy: 5 | docker: 6 | - image: circleci/node:11.11.0 7 | 8 | steps: 9 | - checkout 10 | - add_ssh_keys: 11 | fingerprints: 12 | - "db:86:9b:dc:4c:18:b1:b9:b9:be:77:2f:d7:39:88:19" 13 | - run: 14 | name: Deploying to GitHub Pages 15 | command: | 16 | git config --global user.email "CipherWang@users.noreply.github.com" 17 | git config --global user.name "CipherWang" 18 | echo "machine github.com login CipherWang password $GITHUB_TOKEN" > ~/.netrc 19 | cd website && yarn install && GIT_USER=CipherWang yarn run publish-gh-pages 20 | 21 | workflows: 22 | version: 2 23 | build_and_deploy: 24 | jobs: 25 | - deploy: 26 | filters: 27 | branches: 28 | only: 29 | - master 30 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | 3 | */node_modules 4 | 5 | lib/core/metadata.js 6 | lib/core/MetadataBlog.js 7 | 8 | website/translated_docs 9 | website/build/ 10 | website/yarn.lock 11 | website/node_modules 12 | website/i18n/* 13 | 14 | siteConfig-staging.js -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # Nervos CKB Documentation Website 3 | 4 | > This is the old and deprecated Nervos CKB Documentation, see https://github.com/nervosnetwork/docs-new for the new one, kept here only for reference reasons. 5 | 6 | [![CircleCI](https://circleci.com/gh/nervosnetwork/docs.svg?style=svg)](https://circleci.com/gh/nervosnetwork/docs) 7 | 8 | This is the Nervos CKB documentation website. 9 | 10 | It is built with [docusaurus](https://docusaurus.io/). 11 | 12 | 13 | ## Clone the Repo 14 | ```bash 15 | git clone https://github.com/nervosnetwork/docs.git && \ 16 | cd docs && \ 17 | cd website 18 | ``` 19 | 20 | ## Install Dependencies 21 | Install [yarn](https://yarnpkg.com/en/). 22 | 23 | In `website` folder: 24 | ```bash 25 | yarn install 26 | ``` 27 | 28 | ## Preview the Site 29 | In `website` folder: 30 | ```bash 31 | yarn start 32 | ``` 33 | 34 | Then you should be able to preview the website at `http://localhost:3000/` in your browser. 35 | 36 | ## Build the Site 37 | In `website` folder: 38 | ```bash 39 | yarn build 40 | ``` 41 | 42 | The generated static files will be in `website/build`. 43 | 44 | ## Deploy 45 | Just serve the generated static files in `website/build`. 46 | 47 | 48 | ## Docs 49 | All the documents go into the `docs` folder. All the images should be in the `docs/assets` folder. 50 | 51 | To add a document: 52 | * add the the document to `docs` 53 | * add [header](https://docusaurus.io/docs/en/next/adding-blog#adding-posts) to the document (id and title is required) 54 | * add the path of the folder to the `website/sidebars.json` file 55 | -------------------------------------------------------------------------------- /docs/assets/ckb-explorer/block1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nervosnetwork/docs/4d5abdfb038c896a5438e7ccfe06e6282daa41dd/docs/assets/ckb-explorer/block1.png -------------------------------------------------------------------------------- /docs/assets/ckb-explorer/block2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nervosnetwork/docs/4d5abdfb038c896a5438e7ccfe06e6282daa41dd/docs/assets/ckb-explorer/block2.png -------------------------------------------------------------------------------- /docs/assets/ckb-explorer/charts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nervosnetwork/docs/4d5abdfb038c896a5438e7ccfe06e6282daa41dd/docs/assets/ckb-explorer/charts.png -------------------------------------------------------------------------------- /docs/assets/ckb-explorer/navigation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nervosnetwork/docs/4d5abdfb038c896a5438e7ccfe06e6282daa41dd/docs/assets/ckb-explorer/navigation.png -------------------------------------------------------------------------------- /docs/assets/ckb-explorer/nervosdao1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nervosnetwork/docs/4d5abdfb038c896a5438e7ccfe06e6282daa41dd/docs/assets/ckb-explorer/nervosdao1.png -------------------------------------------------------------------------------- /docs/assets/ckb-explorer/nervosdao2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nervosnetwork/docs/4d5abdfb038c896a5438e7ccfe06e6282daa41dd/docs/assets/ckb-explorer/nervosdao2.png -------------------------------------------------------------------------------- /docs/assets/ckb-structure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nervosnetwork/docs/4d5abdfb038c896a5438e7ccfe06e6282daa41dd/docs/assets/ckb-structure.png -------------------------------------------------------------------------------- /docs/assets/getting-started/backup-neuron.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nervosnetwork/docs/4d5abdfb038c896a5438e7ccfe06e6282daa41dd/docs/assets/getting-started/backup-neuron.png -------------------------------------------------------------------------------- /docs/assets/getting-started/backup-nkm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nervosnetwork/docs/4d5abdfb038c896a5438e7ccfe06e6282daa41dd/docs/assets/getting-started/backup-nkm.png -------------------------------------------------------------------------------- /docs/assets/getting-started/blocknumber.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nervosnetwork/docs/4d5abdfb038c896a5438e7ccfe06e6282daa41dd/docs/assets/getting-started/blocknumber.png -------------------------------------------------------------------------------- /docs/assets/getting-started/deposit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nervosnetwork/docs/4d5abdfb038c896a5438e7ccfe06e6282daa41dd/docs/assets/getting-started/deposit.png -------------------------------------------------------------------------------- /docs/assets/getting-started/import-keystore1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nervosnetwork/docs/4d5abdfb038c896a5438e7ccfe06e6282daa41dd/docs/assets/getting-started/import-keystore1.png -------------------------------------------------------------------------------- /docs/assets/getting-started/import-keystore2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nervosnetwork/docs/4d5abdfb038c896a5438e7ccfe06e6282daa41dd/docs/assets/getting-started/import-keystore2.png -------------------------------------------------------------------------------- /docs/assets/getting-started/import-seed1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nervosnetwork/docs/4d5abdfb038c896a5438e7ccfe06e6282daa41dd/docs/assets/getting-started/import-seed1.png -------------------------------------------------------------------------------- /docs/assets/getting-started/import-seed2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nervosnetwork/docs/4d5abdfb038c896a5438e7ccfe06e6282daa41dd/docs/assets/getting-started/import-seed2.png -------------------------------------------------------------------------------- /docs/assets/getting-started/lookup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nervosnetwork/docs/4d5abdfb038c896a5438e7ccfe06e6282daa41dd/docs/assets/getting-started/lookup.png -------------------------------------------------------------------------------- /docs/assets/getting-started/nervosdao.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nervosnetwork/docs/4d5abdfb038c896a5438e7ccfe06e6282daa41dd/docs/assets/getting-started/nervosdao.png -------------------------------------------------------------------------------- /docs/assets/getting-started/number-explorer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nervosnetwork/docs/4d5abdfb038c896a5438e7ccfe06e6282daa41dd/docs/assets/getting-started/number-explorer.png -------------------------------------------------------------------------------- /docs/assets/getting-started/seed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nervosnetwork/docs/4d5abdfb038c896a5438e7ccfe06e6282daa41dd/docs/assets/getting-started/seed.png -------------------------------------------------------------------------------- /docs/assets/getting-started/sync.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nervosnetwork/docs/4d5abdfb038c896a5438e7ccfe06e6282daa41dd/docs/assets/getting-started/sync.png -------------------------------------------------------------------------------- /docs/assets/getting-started/transfer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nervosnetwork/docs/4d5abdfb038c896a5438e7ccfe06e6282daa41dd/docs/assets/getting-started/transfer.png -------------------------------------------------------------------------------- /docs/assets/getting-started/withdraw1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nervosnetwork/docs/4d5abdfb038c896a5438e7ccfe06e6282daa41dd/docs/assets/getting-started/withdraw1.png -------------------------------------------------------------------------------- /docs/assets/getting-started/withdraw2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nervosnetwork/docs/4d5abdfb038c896a5438e7ccfe06e6282daa41dd/docs/assets/getting-started/withdraw2.png -------------------------------------------------------------------------------- /docs/assets/nervos-layers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nervosnetwork/docs/4d5abdfb038c896a5438e7ccfe06e6282daa41dd/docs/assets/nervos-layers.png -------------------------------------------------------------------------------- /docs/assets/nervos-logo-title.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 17 | 18 | 19 | 22 | 23 | 29 | 36 | 37 | 38 | 40 | 41 | 42 | 43 | 44 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /docs/assets/neuron-wallet-guide/backupwallet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nervosnetwork/docs/4d5abdfb038c896a5438e7ccfe06e6282daa41dd/docs/assets/neuron-wallet-guide/backupwallet.png -------------------------------------------------------------------------------- /docs/assets/neuron-wallet-guide/claim.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nervosnetwork/docs/4d5abdfb038c896a5438e7ccfe06e6282daa41dd/docs/assets/neuron-wallet-guide/claim.png -------------------------------------------------------------------------------- /docs/assets/neuron-wallet-guide/deposit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nervosnetwork/docs/4d5abdfb038c896a5438e7ccfe06e6282daa41dd/docs/assets/neuron-wallet-guide/deposit.png -------------------------------------------------------------------------------- /docs/assets/neuron-wallet-guide/deposit2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nervosnetwork/docs/4d5abdfb038c896a5438e7ccfe06e6282daa41dd/docs/assets/neuron-wallet-guide/deposit2.png -------------------------------------------------------------------------------- /docs/assets/neuron-wallet-guide/export.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nervosnetwork/docs/4d5abdfb038c896a5438e7ccfe06e6282daa41dd/docs/assets/neuron-wallet-guide/export.png -------------------------------------------------------------------------------- /docs/assets/neuron-wallet-guide/importkeystore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nervosnetwork/docs/4d5abdfb038c896a5438e7ccfe06e6282daa41dd/docs/assets/neuron-wallet-guide/importkeystore.png -------------------------------------------------------------------------------- /docs/assets/neuron-wallet-guide/importseed1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nervosnetwork/docs/4d5abdfb038c896a5438e7ccfe06e6282daa41dd/docs/assets/neuron-wallet-guide/importseed1.png -------------------------------------------------------------------------------- /docs/assets/neuron-wallet-guide/importseed2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nervosnetwork/docs/4d5abdfb038c896a5438e7ccfe06e6282daa41dd/docs/assets/neuron-wallet-guide/importseed2.png -------------------------------------------------------------------------------- /docs/assets/neuron-wallet-guide/keystorefile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nervosnetwork/docs/4d5abdfb038c896a5438e7ccfe06e6282daa41dd/docs/assets/neuron-wallet-guide/keystorefile.png -------------------------------------------------------------------------------- /docs/assets/neuron-wallet-guide/nkm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nervosnetwork/docs/4d5abdfb038c896a5438e7ccfe06e6282daa41dd/docs/assets/neuron-wallet-guide/nkm.png -------------------------------------------------------------------------------- /docs/assets/neuron-wallet-guide/password.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nervosnetwork/docs/4d5abdfb038c896a5438e7ccfe06e6282daa41dd/docs/assets/neuron-wallet-guide/password.png -------------------------------------------------------------------------------- /docs/assets/neuron-wallet-guide/seed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nervosnetwork/docs/4d5abdfb038c896a5438e7ccfe06e6282daa41dd/docs/assets/neuron-wallet-guide/seed.png -------------------------------------------------------------------------------- /docs/assets/neuron-wallet-guide/send.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nervosnetwork/docs/4d5abdfb038c896a5438e7ccfe06e6282daa41dd/docs/assets/neuron-wallet-guide/send.png -------------------------------------------------------------------------------- /docs/assets/neuron-wallet-guide/synchronize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nervosnetwork/docs/4d5abdfb038c896a5438e7ccfe06e6282daa41dd/docs/assets/neuron-wallet-guide/synchronize.png -------------------------------------------------------------------------------- /docs/assets/neuron-wallet-guide/viewlockedtoken.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nervosnetwork/docs/4d5abdfb038c896a5438e7ccfe06e6282daa41dd/docs/assets/neuron-wallet-guide/viewlockedtoken.png -------------------------------------------------------------------------------- /docs/assets/neuron-wallet-guide/withdraw1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nervosnetwork/docs/4d5abdfb038c896a5438e7ccfe06e6282daa41dd/docs/assets/neuron-wallet-guide/withdraw1.png -------------------------------------------------------------------------------- /docs/assets/neuron-wallet-guide/withdraw2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nervosnetwork/docs/4d5abdfb038c896a5438e7ccfe06e6282daa41dd/docs/assets/neuron-wallet-guide/withdraw2.png -------------------------------------------------------------------------------- /docs/assets/neuron-wallet/addresses.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nervosnetwork/docs/4d5abdfb038c896a5438e7ccfe06e6282daa41dd/docs/assets/neuron-wallet/addresses.png -------------------------------------------------------------------------------- /docs/assets/neuron-wallet/deposit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nervosnetwork/docs/4d5abdfb038c896a5438e7ccfe06e6282daa41dd/docs/assets/neuron-wallet/deposit.png -------------------------------------------------------------------------------- /docs/assets/neuron-wallet/history.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nervosnetwork/docs/4d5abdfb038c896a5438e7ccfe06e6282daa41dd/docs/assets/neuron-wallet/history.png -------------------------------------------------------------------------------- /docs/assets/neuron-wallet/menu1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nervosnetwork/docs/4d5abdfb038c896a5438e7ccfe06e6282daa41dd/docs/assets/neuron-wallet/menu1.png -------------------------------------------------------------------------------- /docs/assets/neuron-wallet/nervosdao.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nervosnetwork/docs/4d5abdfb038c896a5438e7ccfe06e6282daa41dd/docs/assets/neuron-wallet/nervosdao.png -------------------------------------------------------------------------------- /docs/assets/neuron-wallet/overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nervosnetwork/docs/4d5abdfb038c896a5438e7ccfe06e6282daa41dd/docs/assets/neuron-wallet/overview.png -------------------------------------------------------------------------------- /docs/assets/neuron-wallet/receive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nervosnetwork/docs/4d5abdfb038c896a5438e7ccfe06e6282daa41dd/docs/assets/neuron-wallet/receive.png -------------------------------------------------------------------------------- /docs/assets/neuron-wallet/send.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nervosnetwork/docs/4d5abdfb038c896a5438e7ccfe06e6282daa41dd/docs/assets/neuron-wallet/send.png -------------------------------------------------------------------------------- /docs/assets/neuron-wallet/settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nervosnetwork/docs/4d5abdfb038c896a5438e7ccfe06e6282daa41dd/docs/assets/neuron-wallet/settings.png -------------------------------------------------------------------------------- /docs/assets/tooling/introduction.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nervosnetwork/docs/4d5abdfb038c896a5438e7ccfe06e6282daa41dd/docs/assets/tooling/introduction.png -------------------------------------------------------------------------------- /docs/assets/transaction-validation-lifecycle/未命名文件 (1).jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nervosnetwork/docs/4d5abdfb038c896a5438e7ccfe06e6282daa41dd/docs/assets/transaction-validation-lifecycle/未命名文件 (1).jpg -------------------------------------------------------------------------------- /docs/assets/transaction-validation-lifecycle/未命名文件 (2).jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nervosnetwork/docs/4d5abdfb038c896a5438e7ccfe06e6282daa41dd/docs/assets/transaction-validation-lifecycle/未命名文件 (2).jpg -------------------------------------------------------------------------------- /docs/dev-guide/api.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: api 3 | title: CKB JSON-RPC Protocols 4 | --- 5 | **JSON**-**RPC** is a remote procedure call protocol encoded in **JSON**. It is a very simple protocol defining only a few data types and commands. 6 | 7 | Please refer to the [CKB JSON RPC Protocols](https://github.com/nervosnetwork/ckb/blob/master/rpc/README.md) document for more details. Please note that this file is auto-generated,don't update this file directly 8 | -------------------------------------------------------------------------------- /docs/dev-guide/ckb-cli.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: ckb-cli 3 | title: ckb-cli 4 | --- 5 | ckb-cli is a command line tool for debugging CKB in development to facilitate user interaction with CKB. 6 | 7 | * Download and unzip the latest released [ckb-cli](https://github.com/nervosnetwork/ckb-cli/releases) 8 | * `./ckb-cli `and open in command line. 9 | * ckb-cli includes functionality to: 10 | * search blockchain info, 11 | * configure environment variables, 12 | * invoke RPC to interact with the CKB node, 13 | * handle mock transactions, 14 | * create wallets and query balance etc. 15 | * You can use `--help` to check subcommands. 16 | * Please refer to the [Github](https://github.com/nervosnetwork/ckb-cli) for more details. 17 | 18 | ``` 19 | CKB> --help 20 | interactive 0.25.2 21 | 22 | USAGE: 23 | interactive [SUBCOMMAND] 24 | 25 | FLAGS: 26 | -h, --help Prints help information 27 | 28 | SUBCOMMANDS: 29 | config Config environment 30 | info Display global variables 31 | exit Exit the interactive interface [aliases: quit] 32 | rpc Invoke RPC call to node 33 | account Manage accounts 34 | mock-tx Handle mock transactions (verify/send) 35 | util Utilities 36 | wallet Transfer / query balance (with local index) / key utils 37 | help Prints this message or the help of the given subcommand(s) 38 | ``` -------------------------------------------------------------------------------- /docs/dev-guide/ckb-sdk.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: ckb-sdk 3 | title: ckb-sdk 4 | --- 5 | There are a couple different aspects to developing blockchain applications with CKB: 6 | 7 | 1. Smart contract development - writing code that gets deployed to the blockchain. 8 | 2. Developing websites or clients that interact with the blockchain - writing code that reads data from or writes data to the blockchain with smart contracts. 9 | 10 | ckb-sdk enables the second method of development, developing client applications that interact with the Nervos CKB blockchain. 11 | 12 | ckb-sdk is a collection of libraries which allow you to interact with a local or remote CKB node by using JSON-RPC. **Please note that ckb-sdk is still under development and NOT production ready.** You should get familiar with CKB transaction structure and [JSON-RPC](https://github.com/nervosnetwork/ckb/tree/develop/rpc) before using it. now ckb-sdk is implemented by four kind of programming language: JavaScript、Ruby、Swift、Java. 13 | 14 | * ckb-sdk-js [Github](https://github.com/nervosnetwork/ckb-sdk-js) 15 | * ckb-sdk-js is an SDK implemented in JavaScript, and published in [NPM Registry](https://www.npmjs.com/package/@nervosnetwork/ckb-sdk-core/), and provides APIs for developers to send requests to the CKB blockchain. Neuron Wallet utilizes ckb-sdk-js . 16 | * ckb-sdk-ruby [Github](https://github.com/nervosnetwork/ckb-sdk-ruby) 17 | * ckb-sdk-ruby is an SDK implemented in Ruby and provides APIs for developers to send requests to the CKB blockchain. CKB-Explorer utilizes ckb-sdk-ruby . 18 | * ckb-sdk-swift [Github](https://github.com/nervosnetwork/ckb-sdk-swift) 19 | * ckb-sdk-swift is an SDK implemented in Swift and provides APIs for developers to send requests to the CKB blockchain. Testnet Faucet utilizes ckb-sdk-swift . 20 | * ckb-sdk-java [Github](https://github.com/nervosnetwork/ckb-sdk-java) 21 | * ckb-sdk-java is an SDK implemented in Java and provides APIs for developers to send requests to the CKB blockchain. -------------------------------------------------------------------------------- /docs/dev-guide/debugging-ckb-script.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: debugging-ckb-script 3 | title: Debugging CKB script 4 | --- 5 | CKB VM simulates the RISC-V instruction set, which is very different from other VMs that hard-code functionality through opcodes. Given the generalized nature of CKB VM, various languages and toolchains can be supported- every language and toolchain will be a bit different and implementers should provide appropriate documentation and support for the community. 6 | 7 | This document introduces several tips for debugging CKB scripts. 8 | 9 | 10 | ## Error codes 11 | 12 | The CKB node only reports an exit code on transaction verification failure; the most straightforward way to distinguish errors is to use a different exit code (between -128 and 127) to represent errors. 13 | 14 | For example, see the default lock script error codes: [secp256k1 error codes](https://github.com/nervosnetwork/ckb-system-scripts/wiki/Error-codes) 15 | 16 | > A common mistake is mixing up lock script errors and type script errors. A simple debugging method is to remove the type script, then execute the transaction again; if the error still exists, you can be sure the error is being caused by the lock script; otherwise, it is caused by the type script. 17 | 18 | 19 | ## Debug syscall 20 | 21 | When we want to output additional information from the script; the [debug syscall](https://github.com/nervosnetwork/rfcs/blob/master/rfcs/0009-vm-syscalls/0009-vm-syscalls.md#debug) is used. 22 | 23 | By default, the CKB node does not output the debug syscall message, however `ckb.toml` can be configured to enable it. 24 | 25 | ``` 26 | [logger] 27 | filter = "info,ckb-script=debug" 28 | ``` 29 | 30 | You can also choose to run the script under a debugging environment like [ckb-cli](https://github.com/nervosnetwork/ckb-cli), [VM debugger](https://github.com/xxuejie/ckb-standalone-debugger) or [ckb-contract-tool](https://github.com/jjyr/ckb-contract-tool). 31 | 32 | > For language / toolchain implementers, it is recommended that you integrate [debug syscall](https://github.com/nervosnetwork/rfcs/blob/master/rfcs/0009-vm-syscalls/0009-vm-syscalls.md#debug) to print the error backtrace if your language supports it. For example: if you are using Rust with [ckb-contract-std](https://github.com/jjyr/ckb-contract-std), you can see the panic location where the program crashed. 33 | 34 | 35 | ## ckb-cli 36 | 37 | [ckb-cli](https://github.com/nervosnetwork/ckb-cli) supports generation of a mock transaction and verification under the debugging environment. 38 | 39 | 40 | ### 1. Generate mock-tx template 41 | 42 | ``` 43 | ckb-cli mock-tx template --lock-arg --output-file debug-tx.json 44 | ``` 45 | 46 | 47 | 48 | ### 2. Modify the template 49 | 50 | Add your script cell to the `cell_deps` and modify the transaction structure to use a lock script or type script. 51 | 52 | 53 | ### 3. Complete the template 54 | 55 | ``` 56 | ckb-cli mock-tx complete --tx-file debug-tx.json 57 | ``` 58 | 59 | 60 | This command signs the transaction with the private key according to your lock arg. 61 | 62 | 63 | ### 4. Verify the transaction 64 | 65 | ``` 66 | ckb-cli mock-tx verify --tx-file debug-tx.json 67 | ``` 68 | 69 | 70 | You will see the verification result and the debug output. 71 | 72 | See the [transaction RFC](https://github.com/nervosnetwork/rfcs/blob/master/rfcs/0022-transaction-structure/0022-transaction-structure.md) for instructions on how to construct a transaction. 73 | 74 | 75 | ## Using VM debugger and GDB 76 | 77 | ### 1. Install ckb-standalone-debugger 78 | 79 | ``` 80 | git clone https://github.com/nervosnetwork/ckb-standalone-debugger 81 | cd ckb-standalone-debugger/bins 82 | cargo build --release 83 | ``` 84 | 85 | 86 | 87 | ### 2. Start standalone debugger 88 | 89 | [ckb-standalone-debugger](https://github.com/xxuejie/ckb-standalone-debugger) supports a ckb-cli generated template. To debug a script, we indicate the script group type with `-g 9 | Nervos Docs 10 | 11 | 12 | If you are not redirected automatically, follow this link. 13 | 14 | -------------------------------------------------------------------------------- /website/static/js/code-block-buttons.js: -------------------------------------------------------------------------------- 1 | // Turn off ESLint for this file because it's sent down to users as-is. 2 | /* eslint-disable */ 3 | window.addEventListener('load', function() { 4 | function button(label, ariaLabel, icon, className) { 5 | const btn = document.createElement('button'); 6 | btn.classList.add('btnIcon', className); 7 | btn.setAttribute('type', 'button'); 8 | btn.setAttribute('aria-label', ariaLabel); 9 | btn.innerHTML = 10 | '
' + 11 | icon + 12 | '' + 13 | label + 14 | '' + 15 | '
'; 16 | return btn; 17 | } 18 | 19 | function addButtons(codeBlockSelector, btn) { 20 | document.querySelectorAll(codeBlockSelector).forEach(function(code) { 21 | code.parentNode.appendChild(btn.cloneNode(true)); 22 | }); 23 | } 24 | 25 | const copyIcon = 26 | ''; 27 | 28 | addButtons( 29 | '.hljs', 30 | button('Copy', 'Copy code to clipboard', copyIcon, 'btnClipboard'), 31 | ); 32 | 33 | const clipboard = new ClipboardJS('.btnClipboard', { 34 | target: function(trigger) { 35 | return trigger.parentNode.querySelector('code'); 36 | }, 37 | }); 38 | 39 | clipboard.on('success', function(event) { 40 | event.clearSelection(); 41 | const textEl = event.trigger.querySelector('.btnIcon__label'); 42 | textEl.textContent = 'Copied'; 43 | setTimeout(function() { 44 | textEl.textContent = 'Copy'; 45 | }, 2000); 46 | }); 47 | }); -------------------------------------------------------------------------------- /website/yarn-error.log: -------------------------------------------------------------------------------- 1 | Arguments: 2 | /usr/local/bin/node /usr/local/Cellar/yarn/1.17.3/libexec/bin/yarn.js install 3 | 4 | PATH: 5 | /Users/zengbing/.rvm/gems/ruby-2.5.3/bin:/Users/zengbing/.rvm/gems/ruby-2.5.3@global/bin:/Users/zengbing/.rvm/rubies/ruby-2.5.3/bin:/usr/local/opt/ruby/bin:/Users/zengbing/.cargo/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/Users/zengbing/.rvm/bin 6 | 7 | Yarn version: 8 | 1.17.3 9 | 10 | Node version: 11 | 12.6.0 12 | 13 | Platform: 14 | darwin x64 15 | 16 | Trace: 17 | Error: https://registry.yarnpkg.com/docusaurus: tunneling socket could not be established, cause=connect ECONNREFUSED 127.0.0.1:10080 18 | at ClientRequest.onError (/usr/local/Cellar/yarn/1.17.3/libexec/lib/cli.js:151950:17) 19 | at Object.onceWrapper (events.js:291:20) 20 | at ClientRequest.emit (events.js:203:13) 21 | at Socket.socketErrorListener (_http_client.js:402:9) 22 | at Socket.emit (events.js:203:13) 23 | at emitErrorNT (internal/streams/destroy.js:91:8) 24 | at emitErrorAndCloseNT (internal/streams/destroy.js:59:3) 25 | at processTicksAndRejections (internal/process/task_queues.js:77:11) 26 | 27 | npm manifest: 28 | { 29 | "scripts": { 30 | "examples": "docusaurus-examples", 31 | "start": "docusaurus-start", 32 | "build": "docusaurus-build", 33 | "publish-gh-pages": "docusaurus-publish", 34 | "write-translations": "docusaurus-write-translations", 35 | "version": "docusaurus-version", 36 | "rename-version": "docusaurus-rename-version" 37 | }, 38 | "devDependencies": { 39 | "docusaurus": "^1.9.0" 40 | } 41 | } 42 | 43 | yarn manifest: 44 | No manifest 45 | 46 | Lockfile: 47 | No lockfile 48 | --------------------------------------------------------------------------------