Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
43 changed files
with
2,041 additions
and
213 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package mbc | ||
|
||
import mbc.config.BlockChainConfig | ||
import mbc.network.client.PeerClient | ||
import mbc.network.server.PeerServer | ||
|
||
fun main(args: Array<String>) { | ||
val mbc = MiniBlockChain() | ||
mbc.init() | ||
mbc.start() | ||
} | ||
|
||
class MiniBlockChain { | ||
|
||
var config: BlockChainConfig | ||
|
||
constructor() : this(BlockChainConfig.default()) | ||
|
||
constructor(config: BlockChainConfig) { | ||
this.config = config | ||
|
||
|
||
} | ||
|
||
lateinit var peerClient: PeerClient | ||
|
||
lateinit var peerServer: PeerServer | ||
|
||
fun init() { | ||
|
||
// 检查NodeId,如果不存在就自动生成NodeId。 | ||
val nodeId = config.getNodeId() | ||
|
||
} | ||
|
||
fun start() { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.