Skip to content

Latest commit

 

History

History
57 lines (37 loc) · 1.09 KB

README.md

File metadata and controls

57 lines (37 loc) · 1.09 KB

Substrate SM2

substrate-sm2 is a simple SM2 integration for Substrate. With this, you can sign message with SM2 algorithm and submit it into substrate for verifying.

DO NOT use it as-is in real applications.

Build

Install Rust:

curl https://sh.rustup.rs -sSf | sh

Build Wasm and native code:

cargo build --release

Run

Single node development chain

Purge any existing developer chain state:

./target/release/node-template purge-chain --dev

Start a development chain with:

./target/release/node-template --dev

Detailed logs may be shown by running the node with the following environment variables set: RUST_LOG=debug RUST_BACKTRACE=1 cargo run -- --dev.

Test

Go to utils, run:

cargo run --release

for testing. For this showcase, you will see:

    Finished release [optimized] target(s) in 8.95s
     Running `/Users/hammer/Documents/paritytech/code/hammeWang/substrate-sm2/target/release/utils`
Balance transfer success: value: 10000

Thanks

Many thanks to CITA