blockchain sandbox: UTXO chain, p2p mining, attacker node
This commit is contained in:
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user