truechain-consensus-core
truechain-consensus-core copied to clipboard
TrueChain Consensus Protocol: Minerva
enhance logging for truechain, just like in https://github.com/truechain/py-trueconsensus (truechain's py based alt-ego) for orchestrator, referred to as `minverva.py`: ``` py-trueconsensus ./minerva.py loaded local_config.py from /etc/truechain Storing engine logs to...
To use this consensus by an orchestration tool, we need to expose it using interfaces. Ongoing work under https://github.com/arcolife/truechain-consensus-core/commit/2762a44729b5a7b2d96b5d3b8137fa5950d00937 Related to #26
解决了以下的问题: 1. 一些变量读写并没有加锁保护 2. 一些地方出现error,应该return而没有return 3. 建议用同一的方法打日志,而不是fmt.Printf和自定义方法MyPrint混用(可能还存在其他地方) 一些建议: 1. node那个struct由于有好几个属性变量,但是node只有一个lock,是否可以按照成员属性变量对于有一个锁,进而提高效率? 2. 建议对属性变量的修改,涉及到锁保护的,都封装为函数,尽可能很简短的函数。函数里面统一加上mu.lock()和defer mu.Unlock(),否则非常容易出现死锁,尤其在node.go那个文件,里面有些函数比较长的情况。