每个 Substrate 运行时都有一个RuntimeVersion。此 RuntimeVersion 结构中的字段指示运行时的各个方面何时发生变化,并且每个字段都有自己在这些文档中描述的语义。
我不确定这authoring_version意味着什么,什么时候应该改变。文档中的描述对我来说并不完全清楚
authoring_version: u32
authoring_version is the version of the authorship interface.
An authoring node will not attempt to author blocks unless this
is equal to its native runtime.
Run Code Online (Sandbox Code Playgroud)
如果可能,请提供升级示例,其中:
spec_version并authoring_version会改变spec_version会改变,但authoring_version不会authoring_version会改变,但spec_version不会如何在基板运行时对浮点值进行数学运算。作为一个简单的例子,假设我想跟踪去中心化金融中的利率。
我可以使用百分比作为整数进行原型设计
let rate = 2;
let dividend = capital * rate / 100;
Run Code Online (Sandbox Code Playgroud)
但是如果我的利率是 2.5% 或 2.4554% 呢?
是否有任何标准方法来进行浮点运算?
在 Substrate 生态系统中,通过分叉Substrate Node Template开始编写新的区块链节点是很常见的。用户界面有几个选项(例如Apps和front-end-template),它们都基于相同的底层Polkadot-JS API。
某些版本的 API 与某些版本的节点模板一起使用,无需任何自定义配置,但通常必须向 API 提供有关节点使用哪些类型的信息。提供类型的过程记录在https://polkadot.js.org/api/start/types.extend.html#impact-on-extrinsics但我需要提供哪些类型?
Substrate支持“可插入共识”,因此开发人员可以从几种共识算法中进行选择。它标配有四种算法:
Some of these (eg babe and grandpa) can even be used together in a single node. What are the differences between each consensus algorithm, and which ones can or should be used together?