https://github.com/superthinking/basic-blockchain-in-elixir
Learning & Implementing Blockchain and its concepts
https://github.com/superthinking/basic-blockchain-in-elixir
Last synced: about 1 month ago
JSON representation
Learning & Implementing Blockchain and its concepts
- Host: GitHub
- URL: https://github.com/superthinking/basic-blockchain-in-elixir
- Owner: SuperThinking
- Created: 2021-08-22T17:00:12.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-08-22T17:09:43.000Z (almost 5 years ago)
- Last Synced: 2025-11-13T05:04:17.762Z (9 months ago)
- Language: Elixir
- Size: 196 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
⛓
Each block has the following properties:
- Height
- Timestamp
- Previous Hash
- Hash
- Data
---
Run Tests
```bash
cd ex_chain
mix test
```
---
Try Out!
```bash
cd ex_chain
iex -S mix
```
```elixir
alias ExChain.Blockchain.{Block, Blockchain}
# Initialize Blockchain
blockchain = Blockchain.new()
# Add a block to this blockchain
blockchain = Blockchain.add_block(blockchain, "Some Data")
```
___
Glossary (full list can be found [here](https://consensys.net/knowledge-base/a-blockchain-glossary-for-beginners/)):
- Genesis Block - It's the first block in any blockchain.
- Mining - The process by which blocks (or transactions) are verified and added to the blockchain.
---
Sources:
- [How to build a blockchain in elixir](https://medium.com/coinmonks/building-a-blockchain-in-elixir-part-1-4d4ed889525b)