A dispatch contract and some dynamic libraries.
This project is a Rust and C hybrid project that targets the riscv64-unknown-linux-gnu
platform. It uses Rust for the contract entry (dispatch
) and C for dynamic libraries (ckb_sign
, tron_sign
, etc). The Makefile handles the build process, enabling development through both native and Docker environments. The project also depends on the Nervos Network CKB blockchain protocol and several cryptography libraries.
- Docker: dotbitteam/ckb-dev-all-in-one
- Rust Toolchain: Targeting riscv64imac-unknown-none-elf
- C Toolchain: Targeting riscv64-unknown-linux-gnu
- ckb-binary-patcher: ckb/ckb-binary-patcher
- libecc: dotbitteam/libecc
- secp256k1
- Build for multiple net types (default is
testnet2
) - Optimize and strip binaries
- Debug and Release build types
- Control build flags via environment variables
- Docker environment for isolated building
- Compile contracts and dynamic libraries with security features
- Clone the repository:
git clone https://github.com/dotbitHQ/das-lock
- Initialize environment and submodules:
make init-build-env
- Pull the Docker image:
make pull-docker-image
- Build all contracts and libraries:
make debug-all-via-docker # or make all-via-docker
- Copy the generated binaries to the other directory:
cp -r build/debugs/* /path/to/other/directory
The Makefile
supports the following environment variables:
NET_TYPE
: The type of blockchain network, default istestnet2
.make debug-all-via-docker NET_TYPE=mainnet
CFLAGS
: Flags for the C compiler.