mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-09 11:11:20 +00:00
5a66807989
* First take at updating everything to v5 * Patch gRPC gateway to use prysm v5 Fix patch * Update go ssz --------- Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
26 lines
727 B
Go
26 lines
727 B
Go
package beacon
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
"reflect"
|
|
|
|
"github.com/prysmaticlabs/prysm/v5/config/params"
|
|
ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1"
|
|
"google.golang.org/protobuf/types/known/emptypb"
|
|
)
|
|
|
|
// GetBeaconConfig retrieves the current configuration parameters of the beacon chain.
|
|
func (_ *Server) GetBeaconConfig(_ context.Context, _ *emptypb.Empty) (*ethpb.BeaconConfig, error) {
|
|
conf := params.BeaconConfig()
|
|
val := reflect.ValueOf(conf).Elem()
|
|
numFields := val.Type().NumField()
|
|
res := make(map[string]string, numFields)
|
|
for i := 0; i < numFields; i++ {
|
|
res[val.Type().Field(i).Name] = fmt.Sprintf("%v", val.Field(i).Interface())
|
|
}
|
|
return ðpb.BeaconConfig{
|
|
Config: res,
|
|
}, nil
|
|
}
|