Skip to content

Instantly share code, notes, and snippets.

@bluepnume
Last active May 17, 2021 04:30
Show Gist options
  • Save bluepnume/9b8ccba6dbd5e51fd5ec7c3a0bbedc8c to your computer and use it in GitHub Desktop.
Save bluepnume/9b8ccba6dbd5e51fd5ec7c3a0bbedc8c to your computer and use it in GitHub Desktop.
const mine = async () : Promise<void> => {
await loop(async () => {
const transactions = mempool.slice(0, BLOCK_SIZE_LIMIT);
const hashedBlock = await blockchain.createBlock(await keypair.publicKey, transactions);
if (hashedBlock) {
await network.broadcast('ADD_BLOCK', hashedBlock);
}
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment