Last active
April 9, 2021 20:34
-
-
Save leightkt/5d02be914e8eb3099605f940f8c641e7 to your computer and use it in GitHub Desktop.
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
let BelayChain = {} | |
const loadBelayChain = () => { | |
Block.find({}) | |
.then(blocks => { | |
BelayChain = new Blockchain(blocks) | |
return BelayChain | |
}) | |
.then(BelayChain => { | |
Node.find({}) | |
.then((nodes => { | |
nodes.forEach(node => BelayChain.networkNodes.push(node.nodeURL)) | |
})) | |
}) | |
} | |
app.listen(port, loadBelayChain()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment