github.com/prysmaticlabs/prysm@v1.4.4/beacon-chain/rpc/prysm/v1alpha1/beacon/config.go (about) 1 package beacon 2 3 import ( 4 "context" 5 "fmt" 6 "reflect" 7 8 ethpb "github.com/prysmaticlabs/prysm/proto/eth/v1alpha1" 9 "github.com/prysmaticlabs/prysm/shared/params" 10 "google.golang.org/protobuf/types/known/emptypb" 11 ) 12 13 // GetBeaconConfig retrieves the current configuration parameters of the beacon chain. 14 func (bs *Server) GetBeaconConfig(_ context.Context, _ *emptypb.Empty) (*ethpb.BeaconConfig, error) { 15 conf := params.BeaconConfig() 16 val := reflect.ValueOf(conf).Elem() 17 numFields := val.Type().NumField() 18 res := make(map[string]string, numFields) 19 for i := 0; i < numFields; i++ { 20 res[val.Type().Field(i).Name] = fmt.Sprintf("%v", val.Field(i).Interface()) 21 } 22 return ðpb.BeaconConfig{ 23 Config: res, 24 }, nil 25 }