Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rhymeswithmogul/psblockchain
A simple, class-based blockchain implementation in PowerShell.
https://github.com/rhymeswithmogul/psblockchain
blockchain-demo powershell powershell-class powershell-core powershell-module windows-powershell
Last synced: 27 days ago
JSON representation
A simple, class-based blockchain implementation in PowerShell.
- Host: GitHub
- URL: https://github.com/rhymeswithmogul/psblockchain
- Owner: rhymeswithmogul
- License: gpl-3.0
- Created: 2019-09-03T16:16:24.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2019-09-04T05:04:18.000Z (about 5 years ago)
- Last Synced: 2024-09-29T04:21:14.449Z (about 1 month ago)
- Topics: blockchain-demo, powershell, powershell-class, powershell-core, powershell-module, windows-powershell
- Language: PowerShell
- Size: 30.3 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# PSBlockchain
This module, and its [`[PSBlockchain]`](https://github.com/rhymeswithmogul/PSBlockchain/blob/master/en-us/about_PSBlockchain.help.txt) and [`[PSBlockchainBlock]`](https://github.com/rhymeswithmogul/PSBlockchain/blob/master/en-us/about_PSBlockchainBlock.help.txt) classes, represent a blockchain. It is compatible with Windows PowerShell 5 as well as PowerShell Core.## Quick Example
````powershell
PS C:\> $chain = [PSBlockchain]::new("This is PSCoin's ledger.")
PS C:\> $chain.Add("Alice mined 50 PSC into her wallet.")
PS C:\> $chain.Add("Bob mined 50 PSC into his wallet.")
PS C:\> $chain.Add("Alice sent 25 PSC to Bob.")
PS C:\> $chain.Add("Bob sent 10 PSC to Chris.")PS C:\> $chain.GetBlock(2)
Name Value
---- -----
Version 1
BlockID 2
Timestamp 132120434319335190
PrevBlockHash 87A938599211B54F1FEA0D9786FB4AD0D0A8243DBE3710E82F2CE7F840EC5376
Nonce LuwSGjUaoAKBrRTbFkecJZxfCPMyvHnp
Content Bob mined 50 PSC into his wallet.
Hash 3997F88BC627988564A5E70AE15B4CF600EFD0F9DB9DB3BC79EFF0318F4CAFBFPS C:\> $chain.Verify()
True
````