github.com/prysmaticlabs/prysm@v1.4.4/shared/params/io_config.go (about) 1 package params 2 3 import ( 4 "os" 5 "runtime" 6 "time" 7 ) 8 9 // IoConfig defines the shared io parameters. 10 type IoConfig struct { 11 ReadWritePermissions os.FileMode 12 ReadWriteExecutePermissions os.FileMode 13 BoltTimeout time.Duration 14 } 15 16 var defaultIoConfig = &IoConfig{ 17 ReadWritePermissions: 0600, //-rw------- Read and Write permissions for user 18 ReadWriteExecutePermissions: 0700, //-rwx------ Read Write and Execute (traverse) permissions for user 19 BoltTimeout: 1 * time.Second, // 1 second for the bolt DB to timeout. 20 } 21 22 var defaultWindowsIoConfig = &IoConfig{ 23 ReadWritePermissions: 0666, 24 ReadWriteExecutePermissions: 0777, 25 BoltTimeout: 1 * time.Second, 26 } 27 28 // BeaconIoConfig returns the current io config for 29 // the beacon chain. 30 func BeaconIoConfig() *IoConfig { 31 if runtime.GOOS == "windows" { 32 return defaultWindowsIoConfig 33 } 34 return defaultIoConfig 35 }