Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/propilideno/blockchain
Blockchain implementation using Go + Fiber
https://github.com/propilideno/blockchain
bitcoin blockchain crypto ethereum fiber go smart-contracts web3
Last synced: 10 days ago
JSON representation
Blockchain implementation using Go + Fiber
- Host: GitHub
- URL: https://github.com/propilideno/blockchain
- Owner: propilideno
- License: mit
- Created: 2024-08-03T19:00:13.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-08-11T22:57:01.000Z (5 months ago)
- Last Synced: 2024-11-10T00:33:07.606Z (2 months ago)
- Topics: bitcoin, blockchain, crypto, ethereum, fiber, go, smart-contracts, web3
- Language: Go
- Homepage:
- Size: 49.8 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Blockchain
The best way to learn blockchain is by building one. This repository guides you from creating a basic blockchain to understanding advanced concepts, providing hands-on experience along the way. Dive in and start your blockchain journey today!## [Simple Blockchain](./0-simple-blockchain/README.md)
```
docker run -p 7000:7000 propilideno/simple-blockchain
``````mermaid
classDiagram
direction LRclass Blockchain {
+Block[] Chain
+int Difficulty
+Transaction[] MemoryPool
+Block mine()
+void addTransaction(transaction Transaction)
+bool isValid()
}class Block {
+Transaction[] Transactions
+string PreviousHash
+string Hash
+time.Time Timestamp
+int Nonce
+string calculateHash()
+void mine(difficulty int)
}Blockchain "1" --> "*" Block : contains
Block <|-- Block1 : PreviousHash
Block1 <|-- Block2 : PreviousHash
Block2 <|-- Block3 : PreviousHash
Block3 <|-- Block4 : PreviousHash```
#### Routes
- GET /chain
- GET /memorypool
- GET /mine
- POST /transactions/new
- body: `{ "from": "Lucas", "to": "Filipe", "amount": 10 }`
#### Lacks of
- Transaction validation
- Persistence
- Miner Reward
- Descentralization
- P2P Network
- Node discovery## [Simple Transactional Blockchain](./1-simple-transactional-blockchain/README.md)
```
docker run -p 7000:7000 propilideno/simple-transactional-blockchain
```
```mermaid
classDiagram
direction LRclass Blockchain {
+Block[] Chain
+int Difficulty
+float64 RewardPerBlock
+float64 MaxCoins
+float64 getMinedCoins()
+float64 getBalance(address string)
+bool isValid()
+Block mine(miner string) Block
+void addBlockData(data BlockData)
}class Block {
+BlockData[] Data
+BlockReward Reward
+string PreviousHash
+string Hash
+time.Time Timestamp
+int Nonce
+string calculateHash()
+void mine(difficulty int)
}Blockchain "1" --> "*" Block : contains
Block <|-- Block1 : PreviousHash
Block1 <|-- Block2 : PreviousHash
Block2 <|-- Block3 : PreviousHash
Block3 <|-- Block4 : PreviousHash
```
#### Routes
- GET /info?wallet=**wallet_id**
- GET /chain
- GET /memorypool
- GET /mine?wallet=**wallet_id**
- POST /data/new
- body: `{ "from": "Lucas", "to": "Filipe", "amount": 10 }`## Lacks of
- Persistence
- Descentralization
- P2P Network
- Node discovery#### Lacks of
- Persistence
- Descentralization
- P2P Network
- Node discovery