Expand description
Bundles resources in the ckb binary.
This crate bundles the files ckb.toml, ckb-miner.toml, default.db-options, and all files in the
directory specs
in the binary.
The bundled files can be read via Resource::Bundled
, for example:
// Read bundled ckb.toml
use ckb_resource::{Resource, CKB_CONFIG_FILE_NAME};
let ckb_toml_bytes = Resource::bundled(CKB_CONFIG_FILE_NAME.to_string()).get().unwrap();
println!("ckb.toml\n{}", String::from_utf8(ckb_toml_bytes.to_vec()).unwrap());
These bundled files can be customized for different chains using spec branches. See Template.
Structs§
- Error
- The error type for I/O operations of the
Read
,Write
,Seek
, and associated traits. - Template
- A simple template which supports spec branches and variables.
- Template
Context - The context used to expand the
Template
.
Enums§
- Resource
- Represents a resource, which is either bundled in the CKB binary or resident in the local file system.
Constants§
- AVAILABLE_
SPECS - The list of bundled chain specs.
- CKB_
CONFIG_ FILE_ NAME - CKB config file name.
- CODE_
HASH_ DAO - Data hash of the cell containing DAO type script.
- CODE_
HASH_ SECP256 K1_ BLAK E160_ MULTISIG_ ALL - Data hash of the cell containing secp256k1 blake160 multisig all lock script.
- CODE_
HASH_ SECP256 K1_ BLAK E160_ SIGHASH_ ALL - Data hash of the cell containing secp256k1 blake160 sighash all lock script.
- CODE_
HASH_ SECP256 K1_ DATA - Data hash of the cell containing secp256k1 data.
- DB_
OPTIONS_ FILE_ NAME - The file name of the generated RocksDB options file.
- DEFAULT_
P2P_ PORT - The default P2P listen port 8115.
- DEFAULT_
RPC_ PORT - The default RPC listen port 8114.
- DEFAULT_
SPEC - Default chain spec.
- MINER_
CONFIG_ FILE_ NAME - CKB miner config file name.
- SPEC_
DEV_ FILE_ NAME - The relative spec file path for the dev chain.
Statics§
- BUNDLED
- Bundled resources in ckb binary.