mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-05 17:22:18 +00:00
5aac06f04e
* begin move * use same import path * imports * regen protos * regen * no rename * generate ssz * gaz * fmt * edit build file * imports * modify * remove generated files * remove protos * edit imports in prysm * beacon chain all builds * edit script * add generated pbs * add replace rules * license for ethereumapis protos * change visibility * fmt * update build files to gaz ignore * use proper form * edit imports * wrap block * revert scripts * revert go mod
26 lines
720 B
Go
26 lines
720 B
Go
package beacon
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
"reflect"
|
|
|
|
ethpb "github.com/prysmaticlabs/prysm/proto/eth/v1alpha1"
|
|
"github.com/prysmaticlabs/prysm/shared/params"
|
|
"google.golang.org/protobuf/types/known/emptypb"
|
|
)
|
|
|
|
// GetBeaconConfig retrieves the current configuration parameters of the beacon chain.
|
|
func (bs *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
|
|
}
|