大创
前言
大创的一些问题笔记
环境配置for linux
```
sudo apt-get install nodejs1
2
3
4
5
6
7
2. ```
sudo apt install redis-server
验证:redis-server
结果如下
关闭使用redis-cli shutdown
如果杀死不了,则是开了保护进程,杀死一个就会再开一个,这时使用/etc/init.d/redis-server stop安装.NET Core,高版本兼容低版本,所以不必一定安装3.1
.NET 下载(Linux、macOS 和 Windows) (microsoft.com)
1
2
3
4
5
6
7
8
9
10wget https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb
#注意那个22.04,看你的系统版本
sudo apt-get update; \
sudo apt-get install -y apt-transport-https && \
sudo apt-get update && \
sudo apt-get install -y dotnet-sdk-6.0
aelf笔记
- 运行
1 | # enter the Launcher folder and build |
- 运行测试
1 | cd ../../test/AElf.Contracts.HelloWorldContract.Tests/ |
3.code generator代码生成器
1 | /*Navigate to AElf.Boilerplate.CodeGenerator folder and open appsettings.json, modify Content node, tune New values as you wish*/ |
eg:
1 | # enter the Launcher folder and build |
合约部署contract deployment
自己去读吧
创建一个合约
- create the project: generate the contract template using AElf Boilerplate’s code generator.
- define the contract and its types: the methods and types needed in your contract should be defined in a protobuf file, following typical protobuf syntax.
1 | 有一些protobuf讲解,下有链接,主要讲这个 |
- generate the code: build the project to generate the base contract code from the proto definition.
- extend the generated code: implement the logic of the contract methods.
Smart contract implementation — AElf 0.6.0 documentation (aelf-boilerplate-docs.readthedocs.io)
- 断言assert
1 | 在觉得可能有问题的地方建议都加一句断言,方便debug |
7.log
1 | Context.LogDebug(() => "Hello {0}!", input.Value); |
- front end前端
1 | 前提:After you run Boilerplate, open another terminal at the repo’s root and navigate to the greeter project: |
- 部署
直接上链接Smart contract deployment — AElf release/1.0.0 documentation
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 焚琴煮鹤のBlog!
评论