41 lines
588 B
Go
41 lines
588 B
Go
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
|
|
}
|