https://github.com/dotbithq/das-lock
https://github.com/dotbithq/das-lock
c contract iterable
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/dotbithq/das-lock
- Owner: dotbitHQ
- License: mit
- Created: 2021-12-24T09:45:51.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-04-12T20:14:21.000Z (about 1 year ago)
- Last Synced: 2025-04-12T21:24:03.391Z (about 1 year ago)
- Topics: c, contract, iterable
- Language: C
- Size: 2.7 MB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DAS LOCK
A dispatch contract and some dynamic libraries.
## Overview
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.
## Dependencies
* Docker: [dotbitteam/ckb-dev-all-in-one](https://hub.docker.com/r/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](https://github.com/nervosnetwork/ckb-binary-patcher)
* libecc: [dotbitteam/libecc](https://github.com/dotbitHQ/libecc-riscv-optimized)
* secp256k1
## Features
* 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
## Build Instructions
1. Clone the repository:
```shell
git clone https://github.com/dotbitHQ/das-lock
```
2. Initialize environment and submodules:
```shell
make init-build-env
```
3. Pull the Docker image:
```shell
make pull-docker-image
```
4. Build all contracts and libraries:
```shell
make debug-all-via-docker # or make all-via-docker
```
5. Copy the generated binaries to the other directory:
```shell
cp -r build/debugs/* /path/to/other/directory
```
## Configuration
The `Makefile` supports the following environment variables:
* `NET_TYPE`: The type of blockchain network, default is `testnet2`.
```shell
make debug-all-via-docker NET_TYPE=mainnet
```
* `CFLAGS`: Flags for the C compiler.
## License
[License](LICENSE)