blockchain sandbox: UTXO chain, p2p mining, attacker node

This commit is contained in:
2026-07-26 20:37:26 +03:00
commit 7ce39c8964
18 changed files with 2536 additions and 0 deletions
+40
View File
@@ -0,0 +1,40 @@
package config
import "time"
var Default = Config{
Chain: ChainConfig{
Difficulty: 4,
MiningReward: 10,
},
P2P: P2PConfig{
OutboundPeers: 3, // Bitcoin: 8
MaxPeers: 20, // Bitcoin: 125
},
Sim: SimConfig{
NumNodes: 30,
HashDelay: 5 * time.Millisecond,
},
}
type ChainConfig struct {
Difficulty int
MiningReward int
}
type P2PConfig struct {
OutboundPeers int
MaxPeers int
NetDelay time.Duration
}
type SimConfig struct {
NumNodes int
HashDelay time.Duration
}
type Config struct {
Chain ChainConfig
P2P P2PConfig
Sim SimConfig
}