河曲智叟 发表于 2024-5-20 13:59:52

Substrate 区块链应用开发之存证模块的功能开发

Substrate 区块链应用开发之存证模块的功能开发

存证是一种在线服务,可用于在某一时间点验证盘算机文件的存在性,最早是通过比特币网络带偶然间戳的交易实现的。
存证的应用场景有:

[*]数字版权
[*]司法存证
[*]供应链溯源
[*]电子发票
[*]...
存证的作用是:

[*]证实文件在某一时间点确实存在
[*]证实文件在某一时间点确实没有被篡改
[*]证实文件在某一时间点确实由某个人创建
实操


[*]Open a terminal shell on your computer.
[*]Clone the node template repository by running the following command:
git clone https://github.com/substrate-developer-hub/substrate-node-template
[*]Change to the root of the node template directory by running the following command:
    cd substrate-node-template
[*]Create a new branch to contain your work:
    git switch -c my-learning-branch-2024-04-05
[*]Compile the node template by running the following command:
    cargo build --release
[*]In the same terminal where you compiled your node, you can now start the node in development mode by running the following command:
    ./target/release/node-template --dev --tmphttps://img2024.cnblogs.com/blog/2486240/202404/2486240-20240405144114493-1267667684.jpg

[*]polkadot.js.org/apps 查看
https://img2024.cnblogs.com/blog/2486240/202404/2486240-20240405144146671-2046480440.png
[*]交易前查询状态 None
https://img2024.cnblogs.com/blog/2486240/202404/2486240-20240405144203902-1453731862.png
[*]交易
https://img2024.cnblogs.com/blog/2486240/202404/2486240-20240405144220989-361777481.png
[*]提交交易
https://img2024.cnblogs.com/blog/2486240/202404/2486240-20240405144239015-1672047049.png
[*]交易后查询状态
https://img2024.cnblogs.com/blog/2486240/202404/2486240-20240405144253113-571996729.png
问题


[*]编译报错后使用的下令
    cargo clean
    cargo update
    cargo update -p wasm-bindgen
    cargo update -p librocksdb-sys
    cargo update -p schnorrkel@0.11.4
    cargo update -p anstream@0.6.13-Z sparse-registry   
[*]编译报错:error: associated type BlockNumber not found for T
https://img2024.cnblogs.com/blog/2486240/202404/2486240-20240405144317870-468954520.png
办理: 更换T::BlockNumber为BlockNumberFor

[*]https://substrate.stackexchange.com/questions/9848/associated-type-blocknumber-not-found-for-t
参考


[*]https://docs.substrate.io/tutorials/build-a-blockchain/build-local-blockchain/
[*]https://substrate.stackexchange.com/questions/9848/associated-type-blocknumber-not-found-for-t
[*]https://polkadot.js.org/apps
更多详情


[*]https://github.com/qiaopengjun5162/substrate-pallets-poe

免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
页: [1]
查看完整版本: Substrate 区块链应用开发之存证模块的功能开发