istanbul

SimpleChain Singularity(奇点) 星辰时代

本小妞迷上赌 提交于 2020-08-16 07:55:44
Simplechain星辰时代已经呼啸而至,而此次跨时代之作是Simplechain的主链性能,共识机制,主子链通信(跨链),社区建设,落地应用等全模块全面升级。Simplechain新版本的发布,极大的提振了整个区块链行业,有利于主子链生态的协同融合,互相促进。加速推进整个Simplechain构建数字经济网络。我们来看一下 SimpleChain Singularity 星辰时代 技术迭代的详细内容 技术迭代内容 主链 更新了p2p网络的寻址,有助于节点之间更快发现。 增加区块同步检查点功能,防止区块同步出错。 优化虚拟机,数据库模式,存储树(trie)访问模式,提高区块数据处理的性能。 增加Freezer数据库,数据的传输,存储更加高效。 增加独立的交易签名器Clef,使得签名更加便利。 对Simplechain子系统和事件添加监控。 引入基于 GraphQL 节点查询接口。用户在查询数据的同时仍然保持计算并且数据传输的开销最小化。 子链 添加子链模块,sipe支持以子链模式启动,便于用户快速部署simplechain生态下符合自身业务场景的子链; 子链添加多种共识算法,包括 dpos,istanbul和raft。为创建子链的用户提供多种选择。 跨链 在虚拟机中添加chainid()和nonce()方法,支持跨链交易。 更新主链的协议层,主要包括跨链合约,跨链接口

Istanbul BFT共识算法解读

喜夏-厌秋 提交于 2020-08-15 03:45:27
Istanbul BFT共识算法详细文档 Istanbul BFT 作为BFT类算法的一种已经有过在以太坊上的实践。虽然Istanbul目前还存在一些 潜在的问题 ,但其算法思想和实现还是值得学习和借鉴的。 源代码: https://github.com/jpmorganchase/quorum/tree/master/consensus/istanbul 术语 Validator: 区块验证者。 Proposer: 出块者。 Round: 共识的轮数。一轮从出块者提出一个区块proposal开始,结束于区块提交或者轮数改变(轮数改变可能由于出错或者区块更新)。 Proposal: 提出的一个在处理中的新的区块。 Sequence: proposal的高度。块高和sequence相对应。 Blocklog: 将来的信息记录在backlog里面。 core.backlogs Round state: Round 和 Sequence 绑定在一起组成 view , Consensus proof: 提交的区块签名。每个 validator 对区块验证后会对其进行签名。 Snapshot: validator的投票状态。 共识算法描述 Istanbul BFT修改自PBFT算法,包括三个阶段: PRE-PREPARE 、 PREPARE 以及 COMMIT 。在 N 个节点的网络中

uniapp引入vue-i18n进行语言转换

自作多情 提交于 2020-08-10 22:06:31
首先目录结构是这样的 lib文件夹里面存放四个js文件,ch(存放中文语言)、en(存放英文语言)、index(设置语言)、vue-i18n(vue-i18n插件);同时在main.js中配置就可以使用了; ch.js export default { index: { msg: '信息' } } en.js export default { index: { msg: 'information' } } index.js // 引入文件 import LangEn from './en.js' import LangChs from './ch.js' import Vue from 'vue' import VueI18n from './vue-i18n' Vue.use(VueI18n) // 在本地存储中找用户设备信息,如果没有则获取用户设备信息 const system_info = uni.getStorageSync('system_info') if (!system_info) { // 获取设备信息 uni.getSystemInfo({ success: function(res) { // 存到storage里面,后续操作都需要用到 uni.setStorageSync('system_info', res); } }) } //

如何快速部署一条Simplechain子链

老子叫甜甜 提交于 2020-08-06 07:14:33
我们都知道Simplechain是一种主子链架构,主链Simplechain是POW共识算法的公链。那如何快速创建一条属于自己的子链呢?下面我们就是快速部署一条子链流程。首先clone 源码 , 然后按照下面流程操作。 部署DPOS共识子链网络 创世区块 { "config": { "chainId": 10388, "dpos": { "period": 3, "epoch": 300, "maxSignersCount": 21, "minVoterBalance": 100000000000000000000, "genesisTimestamp": 1554004800, "signers": [ "3d50e12fa9c76e4e517cd4ace1b36c453e6a9bcd", "f97df7fe5e064a9fe4b996141c2d9fb8a3e2b53e", "ef90068860527015097cd031bd2425cb90985a40" ], "pbft": false, "voterReward": true } }, "nonce": "0x0", "timestamp": "0x5ca03b40", "extraData":

How do I setup code coverage on my Express based API?

江枫思渺然 提交于 2020-07-18 03:44:49
问题 I've been at this problem for a while and I cannot make the existing solutions work for me. I have a Node.js API written in Express.js. I have been writing tests for the API using Mocha, Chai, and Supertest. These test are mostly integration tests. One test may look like: it('should fail to register a new user without the proper information', function(done) { api.post('/user') .send({}) .expect(400) .expect('Content-Type', /json/) .end(function(err, res) { should.exist(res.body); should.exist

How do I setup code coverage on my Express based API?

折月煮酒 提交于 2020-07-18 03:44:41
问题 I've been at this problem for a while and I cannot make the existing solutions work for me. I have a Node.js API written in Express.js. I have been writing tests for the API using Mocha, Chai, and Supertest. These test are mostly integration tests. One test may look like: it('should fail to register a new user without the proper information', function(done) { api.post('/user') .send({}) .expect(400) .expect('Content-Type', /json/) .end(function(err, res) { should.exist(res.body); should.exist

How do I setup code coverage on my Express based API?

只愿长相守 提交于 2020-07-18 03:44:09
问题 I've been at this problem for a while and I cannot make the existing solutions work for me. I have a Node.js API written in Express.js. I have been writing tests for the API using Mocha, Chai, and Supertest. These test are mostly integration tests. One test may look like: it('should fail to register a new user without the proper information', function(done) { api.post('/user') .send({}) .expect(400) .expect('Content-Type', /json/) .end(function(err, res) { should.exist(res.body); should.exist

How do I run nyc merge from Makefile?

丶灬走出姿态 提交于 2020-05-17 07:08:08
问题 I've inherited a JS code base with Jasmine unit tests. The testing framework uses karma and instanbul-combine to get code coverage. It seems istanbul-combine isn't working with present node modules, and besides is no longer maintained: the recommended replacement is nyc . I'm having trouble replacing istanbul-combine with nyc in the Makefile . Here's are my attempts at merging the data (not even trying to get a report yet): #1 @for dir in $(shell ls -d coverage/*/); do \ echo "Merging $${dir}

How to exclude spec files while getting code coverage [Angular]

强颜欢笑 提交于 2020-04-30 06:25:43
问题 I'm trying to get the code coverage of my angular project. I'm not very well versed with the tools. I decided to use "istanbul-instrumenter-loader": "^3.0.1" . I tried taking help from this question: angular cli exclude files/directory for ng test--code-coverage and Regex that doesn't match spec.ts and spec.tsx but should match any other .ts and .tsx And many other solutions given on the same thread. My problem is that I want to exclude spec files which I wrote for unit testing. Here is the