From 11d5c03041c1fa9d31731d2275dda94039379552 Mon Sep 17 00:00:00 2001 From: Anmol Date: Tue, 8 Aug 2023 17:29:35 +0530 Subject: [PATCH 1/8] Reduce the delay before startup for registry service (#165) --- charts/devnet/templates/registry.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/charts/devnet/templates/registry.yaml b/charts/devnet/templates/registry.yaml index bbaa9fa3..b60af7dc 100644 --- a/charts/devnet/templates/registry.yaml +++ b/charts/devnet/templates/registry.yaml @@ -79,13 +79,13 @@ spec: readinessProbe: tcpSocket: port: 8080 - initialDelaySeconds: 60 - periodSeconds: 30 + initialDelaySeconds: 20 + periodSeconds: 10 livenessProbe: tcpSocket: port: 8080 - initialDelaySeconds: 60 - periodSeconds: 30 + initialDelaySeconds: 20 + periodSeconds: 10 volumes: {{- range $chain := .Values.chains }} - name: registry-configs-{{ $chain.name }} From 50512929e2faa85e8c851714ed3224598cc59cc1 Mon Sep 17 00:00:00 2001 From: Anmol Date: Tue, 8 Aug 2023 18:45:35 +0530 Subject: [PATCH 2/8] feature: add faucet.concurrency directive, add to tests (#164) * add faucet.concurrency directive, add to tests * update docs for faucet * add resources to faucet, add resources to node * fetch node id seperately, exit early * add condition to exit early * upgrade starship-action version * add concurrency for faucet * update resources for faucet --- .github/workflows/pr-tests.yaml | 2 +- charts/devnet/templates/chains/cosmos/genesis.yaml | 2 +- .../devnet/templates/chains/cosmos/validator.yaml | 8 +++++++- charts/devnet/values.yaml | 1 + docs/pages/config/chains.mdx | 5 +++++ tests/configs/multi-validator.yaml | 14 +++++++------- tests/configs/one-chain.yaml | 2 ++ 7 files changed, 24 insertions(+), 10 deletions(-) diff --git a/.github/workflows/pr-tests.yaml b/.github/workflows/pr-tests.yaml index 957683de..cc29f82b 100644 --- a/.github/workflows/pr-tests.yaml +++ b/.github/workflows/pr-tests.yaml @@ -41,7 +41,7 @@ jobs: - name: Setup Test infra id: starship-action - uses: cosmology-tech/starship-action@0.2.11 + uses: cosmology-tech/starship-action@0.2.12 with: values: ${{ env.CONFIG_FILE }} port-forward: true diff --git a/charts/devnet/templates/chains/cosmos/genesis.yaml b/charts/devnet/templates/chains/cosmos/genesis.yaml index f2ad0f8d..88ac7322 100644 --- a/charts/devnet/templates/chains/cosmos/genesis.yaml +++ b/charts/devnet/templates/chains/cosmos/genesis.yaml @@ -191,7 +191,7 @@ spec: imagePullPolicy: Always env: - name: FAUCET_CONCURRENCY - value: "10" + value: "{{ $faucet.concurrency }}" - name: FAUCET_PORT value: "{{ $faucet.ports.rest }}" - name: FAUCET_MEMO diff --git a/charts/devnet/templates/chains/cosmos/validator.yaml b/charts/devnet/templates/chains/cosmos/validator.yaml index 26d6ad05..4d3a8695 100644 --- a/charts/devnet/templates/chains/cosmos/validator.yaml +++ b/charts/devnet/templates/chains/cosmos/validator.yaml @@ -132,7 +132,13 @@ spec: echo "Setup config files" bash -e /scripts/setup_config.sh - GENESIS_NODE_P2P=$(curl -s http://$GENESIS_HOST.$NAMESPACE.svc.cluster.local:$GENESIS_PORT/node_id | jq -r ".node_id")@$GENESIS_HOST.$NAMESPACE.svc.cluster.local:26656 + curl -s http://$GENESIS_HOST.$NAMESPACE.svc.cluster.local:$GENESIS_PORT/node_id + NODE_ID=$(curl -s http://$GENESIS_HOST.$NAMESPACE.svc.cluster.local:$GENESIS_PORT/node_id | jq -r ".node_id") + if [[ $NODE_ID == "" ]]; then + echo "Node ID is null, exiting early" + exit 1 + fi + GENESIS_NODE_P2P=$NODE_ID@$GENESIS_HOST.$NAMESPACE.svc.cluster.local:26656 echo "Node P2P: $GENESIS_NODE_P2P" sed -i "s/persistent_peers = \"\"/persistent_peers = \"$GENESIS_NODE_P2P\"/g" $CHAIN_DIR/config/config.toml diff --git a/charts/devnet/values.yaml b/charts/devnet/values.yaml index 226f2738..09c2796a 100644 --- a/charts/devnet/values.yaml +++ b/charts/devnet/values.yaml @@ -31,6 +31,7 @@ exposer: faucet: image: ghcr.io/cosmology-tech/starship/cosmjs-faucet:v0.31.0 + concurrency: 10 ports: rest: 8000 resources: diff --git a/docs/pages/config/chains.mdx b/docs/pages/config/chains.mdx index 48b22733..0e1adca7 100644 --- a/docs/pages/config/chains.mdx +++ b/docs/pages/config/chains.mdx @@ -154,11 +154,16 @@ chains: numValidators: 1 faucet: image: ghcr.io/cosmology-tech/starship/cosmjs-faucet:v0.30.1 + concurrency: 2 # default is 10 resources: cpu: "0.3" memory: "600M" ``` +Note `concurrency` in `faucet` is the number of concurrent requests the faucet can handle. +If you are running a chain with less resources, or want faster startup time, +then you can reduce the `concurrency` to a lower number. + ## `build` (optional) With the `build` directive in the chain, one can basically build chain binaries on the fly before starting the chain. When the directive is `enabled`, then the docker image is set to a [`runner` docker image](https://github.com/cosmology-tech/starship/blob/main/docker/starship/runner/Dockerfile) diff --git a/tests/configs/multi-validator.yaml b/tests/configs/multi-validator.yaml index 53a68b11..3fefd8a8 100644 --- a/tests/configs/multi-validator.yaml +++ b/tests/configs/multi-validator.yaml @@ -7,8 +7,13 @@ chains: rpc: 26653 exposer: 38083 resources: - cpu: "0.2" - memory: 400M + cpu: "0.3" + memory: 600M + faucet: + concurrency: 2 + resources: + cpu: "0.1" + memory: "300M" registry: enabled: true @@ -28,8 +33,3 @@ exposer: resources: cpu: "0.1" memory: 100M - -faucet: - resources: - cpu: "0.1" - memory: "300M" diff --git a/tests/configs/one-chain.yaml b/tests/configs/one-chain.yaml index a02c6a99..8e72900c 100644 --- a/tests/configs/one-chain.yaml +++ b/tests/configs/one-chain.yaml @@ -9,6 +9,8 @@ chains: resources: cpu: "0.5" memory: 500M + faucet: + concurrency: 2 registry: enabled: true From 233392935f1a1f2a3de0ec2c119acb10d775d775 Mon Sep 17 00:00:00 2001 From: Anmol Date: Tue, 8 Aug 2023 18:46:00 +0530 Subject: [PATCH 3/8] use generic struct instead of genesis message (#162) * use generic struct instead of genesis message * add pb struct to proto * Remove unused genesis protos, remove buf from proto, update exposer tests * Remove make command for protos * add dependencies to bazel tests --- Makefile | 7 - exposer/BUILD.bazel | 1 + exposer/exposer/genesis.pb.go | 601 ------------------------------- exposer/exposer/genesis.pb.gw.go | 3 - exposer/exposer/service.pb.go | 106 +++--- exposer/handler.go | 16 +- proto/Makefile | 8 +- proto/buf.gen.yaml | 19 - proto/buf.lock | 11 - proto/buf.yaml | 13 - proto/exposer/BUILD.bazel | 1 - proto/exposer/genesis.proto | 17 - proto/exposer/service.proto | 4 +- tests/BUILD.bazel | 20 +- tests/Makefile | 2 +- tests/e2e_test.go | 4 + tests/exposer_test.go | 5 +- 17 files changed, 83 insertions(+), 755 deletions(-) delete mode 100755 exposer/exposer/genesis.pb.go delete mode 100755 exposer/exposer/genesis.pb.gw.go delete mode 100644 proto/buf.gen.yaml delete mode 100644 proto/buf.lock delete mode 100644 proto/buf.yaml delete mode 100644 proto/exposer/genesis.proto diff --git a/Makefile b/Makefile index 4508da2c..b124679d 100644 --- a/Makefile +++ b/Makefile @@ -8,13 +8,6 @@ endif KEYS_CONFIG = charts/$(HELM_CHART)/configs/keys.json VALUES_FILE = charts/$(HELM_CHART)/values.yaml -############################################################################### -### Proto commands ### -############################################################################### -.PHONY: proto -proto: - (cd proto/ && make build-proto) - ############################################################################### ### Helm commands ### ############################################################################### diff --git a/exposer/BUILD.bazel b/exposer/BUILD.bazel index a883ef21..c7f7e2fd 100644 --- a/exposer/BUILD.bazel +++ b/exposer/BUILD.bazel @@ -31,6 +31,7 @@ go_library( "@org_golang_google_grpc//codes", "@org_golang_google_grpc//status", "@org_golang_google_protobuf//types/known/emptypb", + "@org_golang_google_protobuf//types/known/structpb", "@org_uber_go_zap//:zap", ], ) diff --git a/exposer/exposer/genesis.pb.go b/exposer/exposer/genesis.pb.go deleted file mode 100755 index e2bb34a2..00000000 --- a/exposer/exposer/genesis.pb.go +++ /dev/null @@ -1,601 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.29.1 -// protoc v3.15.5 -// source: proto/exposer/genesis.proto - -package exposer - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - _ "google.golang.org/protobuf/types/known/anypb" - structpb "google.golang.org/protobuf/types/known/structpb" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type GenesisState struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - GenesisTime *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=genesis_time,proto3" json:"genesis_time,omitempty"` - ChainId string `protobuf:"bytes,2,opt,name=chain_id,proto3" json:"chain_id,omitempty"` - InitialHeight string `protobuf:"bytes,3,opt,name=initial_height,proto3" json:"initial_height,omitempty"` - ConsensusParams *GenesisState_ConsensusParams `protobuf:"bytes,4,opt,name=consensus_params,proto3" json:"consensus_params,omitempty"` - AppHash string `protobuf:"bytes,5,opt,name=app_hash,proto3" json:"app_hash,omitempty"` - AppState *structpb.Struct `protobuf:"bytes,6,opt,name=app_state,proto3" json:"app_state,omitempty"` -} - -func (x *GenesisState) Reset() { - *x = GenesisState{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_exposer_genesis_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GenesisState) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GenesisState) ProtoMessage() {} - -func (x *GenesisState) ProtoReflect() protoreflect.Message { - mi := &file_proto_exposer_genesis_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GenesisState.ProtoReflect.Descriptor instead. -func (*GenesisState) Descriptor() ([]byte, []int) { - return file_proto_exposer_genesis_proto_rawDescGZIP(), []int{0} -} - -func (x *GenesisState) GetGenesisTime() *timestamppb.Timestamp { - if x != nil { - return x.GenesisTime - } - return nil -} - -func (x *GenesisState) GetChainId() string { - if x != nil { - return x.ChainId - } - return "" -} - -func (x *GenesisState) GetInitialHeight() string { - if x != nil { - return x.InitialHeight - } - return "" -} - -func (x *GenesisState) GetConsensusParams() *GenesisState_ConsensusParams { - if x != nil { - return x.ConsensusParams - } - return nil -} - -func (x *GenesisState) GetAppHash() string { - if x != nil { - return x.AppHash - } - return "" -} - -func (x *GenesisState) GetAppState() *structpb.Struct { - if x != nil { - return x.AppState - } - return nil -} - -type GenesisState_Block struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - MaxBytes string `protobuf:"bytes,1,opt,name=max_bytes,proto3" json:"max_bytes,omitempty"` - MaxGas string `protobuf:"bytes,2,opt,name=max_gas,proto3" json:"max_gas,omitempty"` - TimeIotaMs string `protobuf:"bytes,3,opt,name=time_iota_ms,proto3" json:"time_iota_ms,omitempty"` -} - -func (x *GenesisState_Block) Reset() { - *x = GenesisState_Block{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_exposer_genesis_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GenesisState_Block) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GenesisState_Block) ProtoMessage() {} - -func (x *GenesisState_Block) ProtoReflect() protoreflect.Message { - mi := &file_proto_exposer_genesis_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GenesisState_Block.ProtoReflect.Descriptor instead. -func (*GenesisState_Block) Descriptor() ([]byte, []int) { - return file_proto_exposer_genesis_proto_rawDescGZIP(), []int{0, 0} -} - -func (x *GenesisState_Block) GetMaxBytes() string { - if x != nil { - return x.MaxBytes - } - return "" -} - -func (x *GenesisState_Block) GetMaxGas() string { - if x != nil { - return x.MaxGas - } - return "" -} - -func (x *GenesisState_Block) GetTimeIotaMs() string { - if x != nil { - return x.TimeIotaMs - } - return "" -} - -type GenesisState_Evidence struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - MaxAgeNumBlocks string `protobuf:"bytes,1,opt,name=max_age_num_blocks,proto3" json:"max_age_num_blocks,omitempty"` - MaxAgeDuration string `protobuf:"bytes,2,opt,name=max_age_duration,proto3" json:"max_age_duration,omitempty"` - MaxBytes string `protobuf:"bytes,3,opt,name=max_bytes,proto3" json:"max_bytes,omitempty"` -} - -func (x *GenesisState_Evidence) Reset() { - *x = GenesisState_Evidence{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_exposer_genesis_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GenesisState_Evidence) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GenesisState_Evidence) ProtoMessage() {} - -func (x *GenesisState_Evidence) ProtoReflect() protoreflect.Message { - mi := &file_proto_exposer_genesis_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GenesisState_Evidence.ProtoReflect.Descriptor instead. -func (*GenesisState_Evidence) Descriptor() ([]byte, []int) { - return file_proto_exposer_genesis_proto_rawDescGZIP(), []int{0, 1} -} - -func (x *GenesisState_Evidence) GetMaxAgeNumBlocks() string { - if x != nil { - return x.MaxAgeNumBlocks - } - return "" -} - -func (x *GenesisState_Evidence) GetMaxAgeDuration() string { - if x != nil { - return x.MaxAgeDuration - } - return "" -} - -func (x *GenesisState_Evidence) GetMaxBytes() string { - if x != nil { - return x.MaxBytes - } - return "" -} - -type GenesisState_Validator struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - PubKeyTypes []string `protobuf:"bytes,1,rep,name=pub_key_types,proto3" json:"pub_key_types,omitempty"` -} - -func (x *GenesisState_Validator) Reset() { - *x = GenesisState_Validator{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_exposer_genesis_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GenesisState_Validator) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GenesisState_Validator) ProtoMessage() {} - -func (x *GenesisState_Validator) ProtoReflect() protoreflect.Message { - mi := &file_proto_exposer_genesis_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GenesisState_Validator.ProtoReflect.Descriptor instead. -func (*GenesisState_Validator) Descriptor() ([]byte, []int) { - return file_proto_exposer_genesis_proto_rawDescGZIP(), []int{0, 2} -} - -func (x *GenesisState_Validator) GetPubKeyTypes() []string { - if x != nil { - return x.PubKeyTypes - } - return nil -} - -type GenesisState_Version struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *GenesisState_Version) Reset() { - *x = GenesisState_Version{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_exposer_genesis_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GenesisState_Version) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GenesisState_Version) ProtoMessage() {} - -func (x *GenesisState_Version) ProtoReflect() protoreflect.Message { - mi := &file_proto_exposer_genesis_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GenesisState_Version.ProtoReflect.Descriptor instead. -func (*GenesisState_Version) Descriptor() ([]byte, []int) { - return file_proto_exposer_genesis_proto_rawDescGZIP(), []int{0, 3} -} - -type GenesisState_ConsensusParams struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Block *GenesisState_Block `protobuf:"bytes,1,opt,name=block,proto3" json:"block,omitempty"` - Evidence *GenesisState_Evidence `protobuf:"bytes,2,opt,name=evidence,proto3" json:"evidence,omitempty"` - Validator *GenesisState_Validator `protobuf:"bytes,3,opt,name=validator,proto3" json:"validator,omitempty"` - Version *GenesisState_Version `protobuf:"bytes,4,opt,name=version,proto3" json:"version,omitempty"` -} - -func (x *GenesisState_ConsensusParams) Reset() { - *x = GenesisState_ConsensusParams{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_exposer_genesis_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GenesisState_ConsensusParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GenesisState_ConsensusParams) ProtoMessage() {} - -func (x *GenesisState_ConsensusParams) ProtoReflect() protoreflect.Message { - mi := &file_proto_exposer_genesis_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GenesisState_ConsensusParams.ProtoReflect.Descriptor instead. -func (*GenesisState_ConsensusParams) Descriptor() ([]byte, []int) { - return file_proto_exposer_genesis_proto_rawDescGZIP(), []int{0, 4} -} - -func (x *GenesisState_ConsensusParams) GetBlock() *GenesisState_Block { - if x != nil { - return x.Block - } - return nil -} - -func (x *GenesisState_ConsensusParams) GetEvidence() *GenesisState_Evidence { - if x != nil { - return x.Evidence - } - return nil -} - -func (x *GenesisState_ConsensusParams) GetValidator() *GenesisState_Validator { - if x != nil { - return x.Validator - } - return nil -} - -func (x *GenesisState_ConsensusParams) GetVersion() *GenesisState_Version { - if x != nil { - return x.Version - } - return nil -} - -var File_proto_exposer_genesis_proto protoreflect.FileDescriptor - -var file_proto_exposer_genesis_proto_rawDesc = []byte{ - 0x0a, 0x1b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x2f, - 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x65, - 0x78, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x22, 0xdf, 0x06, 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x53, 0x74, 0x61, 0x74, - 0x65, 0x12, 0x3e, 0x0a, 0x0c, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x5f, 0x74, 0x69, 0x6d, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x52, 0x0c, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x5f, 0x74, 0x69, 0x6d, - 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x12, 0x26, 0x0a, - 0x0e, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x68, - 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x52, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, - 0x75, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x26, 0x2e, 0x65, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, - 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, - 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x10, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, - 0x75, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x70, 0x70, - 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x70, 0x70, - 0x5f, 0x68, 0x61, 0x73, 0x68, 0x12, 0x35, 0x0a, 0x09, 0x61, 0x70, 0x70, 0x5f, 0x73, 0x74, 0x61, - 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, - 0x74, 0x52, 0x09, 0x61, 0x70, 0x70, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x1a, 0x63, 0x0a, 0x05, - 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x62, 0x79, 0x74, - 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x62, 0x79, - 0x74, 0x65, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x61, 0x78, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x61, 0x78, 0x5f, 0x67, 0x61, 0x73, 0x12, 0x22, 0x0a, - 0x0c, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x69, 0x6f, 0x74, 0x61, 0x5f, 0x6d, 0x73, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0c, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x69, 0x6f, 0x74, 0x61, 0x5f, 0x6d, - 0x73, 0x1a, 0x84, 0x01, 0x0a, 0x08, 0x45, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x2e, - 0x0a, 0x12, 0x6d, 0x61, 0x78, 0x5f, 0x61, 0x67, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x5f, 0x62, 0x6c, - 0x6f, 0x63, 0x6b, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x6d, 0x61, 0x78, 0x5f, - 0x61, 0x67, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x12, 0x2a, - 0x0a, 0x10, 0x6d, 0x61, 0x78, 0x5f, 0x61, 0x67, 0x65, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x6d, 0x61, 0x78, 0x5f, 0x61, 0x67, - 0x65, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x61, - 0x78, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, - 0x61, 0x78, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x1a, 0x31, 0x0a, 0x09, 0x56, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x24, 0x0a, 0x0d, 0x70, 0x75, 0x62, 0x5f, 0x6b, 0x65, 0x79, - 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x75, - 0x62, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x1a, 0x09, 0x0a, 0x07, 0x56, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x1a, 0xf9, 0x01, 0x0a, 0x10, 0x43, 0x6f, 0x6e, 0x73, 0x65, - 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x31, 0x0a, 0x05, 0x62, - 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x65, 0x78, 0x70, - 0x6f, 0x73, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x53, 0x74, 0x61, 0x74, - 0x65, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x3a, - 0x0a, 0x08, 0x65, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1e, 0x2e, 0x65, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x73, - 0x69, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x45, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, - 0x52, 0x08, 0x65, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x3d, 0x0a, 0x09, 0x76, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, - 0x65, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x53, - 0x74, 0x61, 0x74, 0x65, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x09, - 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x37, 0x0a, 0x07, 0x76, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x65, 0x78, 0x70, - 0x6f, 0x73, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x53, 0x74, 0x61, 0x74, - 0x65, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x42, 0x34, 0x5a, 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x6c, 0x6f, 0x67, 0x79, 0x2d, 0x74, 0x65, 0x63, 0x68, 0x2f, - 0x73, 0x74, 0x61, 0x72, 0x73, 0x68, 0x69, 0x70, 0x2f, 0x65, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x72, - 0x2f, 0x65, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_proto_exposer_genesis_proto_rawDescOnce sync.Once - file_proto_exposer_genesis_proto_rawDescData = file_proto_exposer_genesis_proto_rawDesc -) - -func file_proto_exposer_genesis_proto_rawDescGZIP() []byte { - file_proto_exposer_genesis_proto_rawDescOnce.Do(func() { - file_proto_exposer_genesis_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_exposer_genesis_proto_rawDescData) - }) - return file_proto_exposer_genesis_proto_rawDescData -} - -var file_proto_exposer_genesis_proto_msgTypes = make([]protoimpl.MessageInfo, 6) -var file_proto_exposer_genesis_proto_goTypes = []interface{}{ - (*GenesisState)(nil), // 0: exposer.GenesisState - (*GenesisState_Block)(nil), // 1: exposer.GenesisState.Block - (*GenesisState_Evidence)(nil), // 2: exposer.GenesisState.Evidence - (*GenesisState_Validator)(nil), // 3: exposer.GenesisState.Validator - (*GenesisState_Version)(nil), // 4: exposer.GenesisState.Version - (*GenesisState_ConsensusParams)(nil), // 5: exposer.GenesisState.Consensus_params - (*timestamppb.Timestamp)(nil), // 6: google.protobuf.Timestamp - (*structpb.Struct)(nil), // 7: google.protobuf.Struct -} -var file_proto_exposer_genesis_proto_depIdxs = []int32{ - 6, // 0: exposer.GenesisState.genesis_time:type_name -> google.protobuf.Timestamp - 5, // 1: exposer.GenesisState.consensus_params:type_name -> exposer.GenesisState.Consensus_params - 7, // 2: exposer.GenesisState.app_state:type_name -> google.protobuf.Struct - 1, // 3: exposer.GenesisState.Consensus_params.block:type_name -> exposer.GenesisState.Block - 2, // 4: exposer.GenesisState.Consensus_params.evidence:type_name -> exposer.GenesisState.Evidence - 3, // 5: exposer.GenesisState.Consensus_params.validator:type_name -> exposer.GenesisState.Validator - 4, // 6: exposer.GenesisState.Consensus_params.version:type_name -> exposer.GenesisState.Version - 7, // [7:7] is the sub-list for method output_type - 7, // [7:7] is the sub-list for method input_type - 7, // [7:7] is the sub-list for extension type_name - 7, // [7:7] is the sub-list for extension extendee - 0, // [0:7] is the sub-list for field type_name -} - -func init() { file_proto_exposer_genesis_proto_init() } -func file_proto_exposer_genesis_proto_init() { - if File_proto_exposer_genesis_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_proto_exposer_genesis_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GenesisState); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_exposer_genesis_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GenesisState_Block); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_exposer_genesis_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GenesisState_Evidence); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_exposer_genesis_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GenesisState_Validator); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_exposer_genesis_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GenesisState_Version); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_exposer_genesis_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GenesisState_ConsensusParams); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_proto_exposer_genesis_proto_rawDesc, - NumEnums: 0, - NumMessages: 6, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_proto_exposer_genesis_proto_goTypes, - DependencyIndexes: file_proto_exposer_genesis_proto_depIdxs, - MessageInfos: file_proto_exposer_genesis_proto_msgTypes, - }.Build() - File_proto_exposer_genesis_proto = out.File - file_proto_exposer_genesis_proto_rawDesc = nil - file_proto_exposer_genesis_proto_goTypes = nil - file_proto_exposer_genesis_proto_depIdxs = nil -} diff --git a/exposer/exposer/genesis.pb.gw.go b/exposer/exposer/genesis.pb.gw.go deleted file mode 100755 index b76fb609..00000000 --- a/exposer/exposer/genesis.pb.gw.go +++ /dev/null @@ -1,3 +0,0 @@ -// +build ignore - -package ignore \ No newline at end of file diff --git a/exposer/exposer/service.pb.go b/exposer/exposer/service.pb.go index 0055349d..57eed685 100755 --- a/exposer/exposer/service.pb.go +++ b/exposer/exposer/service.pb.go @@ -17,6 +17,7 @@ import ( _ "google.golang.org/protobuf/types/descriptorpb" _ "google.golang.org/protobuf/types/known/anypb" emptypb "google.golang.org/protobuf/types/known/emptypb" + structpb "google.golang.org/protobuf/types/known/structpb" reflect "reflect" sync "sync" ) @@ -186,52 +187,52 @@ var file_proto_exposer_service_proto_rawDesc = []byte{ 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x2f, 0x6d, 0x6e, - 0x65, 0x6d, 0x6f, 0x6e, 0x69, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x2f, 0x67, 0x65, 0x6e, 0x65, - 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x2a, 0x0a, 0x0e, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x44, 0x12, 0x18, 0x0a, 0x07, 0x6e, - 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x6f, - 0x64, 0x65, 0x5f, 0x69, 0x64, 0x22, 0x36, 0x0a, 0x0e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, - 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x22, 0x26, 0x0a, - 0x10, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x44, 0x61, 0x74, - 0x61, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x04, 0x64, 0x61, 0x74, 0x61, 0x32, 0x97, 0x03, 0x0a, 0x07, 0x45, 0x78, 0x70, 0x6f, 0x73, 0x65, - 0x72, 0x12, 0x4e, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x44, 0x12, 0x16, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x17, 0x2e, 0x65, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x72, - 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x44, 0x22, - 0x10, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0a, 0x12, 0x08, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, - 0x64, 0x12, 0x4e, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x12, 0x16, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x17, 0x2e, 0x65, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x72, - 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x22, - 0x10, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0a, 0x12, 0x08, 0x2f, 0x70, 0x75, 0x62, 0x5f, 0x6b, 0x65, - 0x79, 0x12, 0x51, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x46, - 0x69, 0x6c, 0x65, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x15, 0x2e, 0x65, 0x78, - 0x70, 0x6f, 0x73, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x53, 0x74, 0x61, - 0x74, 0x65, 0x22, 0x10, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0a, 0x12, 0x08, 0x2f, 0x67, 0x65, 0x6e, - 0x65, 0x73, 0x69, 0x73, 0x12, 0x3f, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x73, 0x12, + 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x2f, 0x6d, 0x6e, 0x65, 0x6d, + 0x6f, 0x6e, 0x69, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x2a, 0x0a, 0x0e, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x44, 0x12, 0x18, 0x0a, 0x07, + 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, + 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x64, 0x22, 0x36, 0x0a, 0x0e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, + 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x22, 0x26, + 0x0a, 0x10, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x44, 0x61, + 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x32, 0x99, 0x03, 0x0a, 0x07, 0x45, 0x78, 0x70, 0x6f, 0x73, + 0x65, 0x72, 0x12, 0x4e, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x44, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x0d, 0x2e, 0x65, 0x78, 0x70, 0x6f, 0x73, 0x65, - 0x72, 0x2e, 0x4b, 0x65, 0x79, 0x73, 0x22, 0x0d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x07, 0x12, 0x05, - 0x2f, 0x6b, 0x65, 0x79, 0x73, 0x12, 0x58, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x50, 0x72, 0x69, 0x76, - 0x4b, 0x65, 0x79, 0x73, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, - 0x1a, 0x19, 0x2e, 0x65, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x2e, 0x50, 0x72, 0x69, 0x76, 0x56, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x4b, 0x65, 0x79, 0x22, 0x12, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x0c, 0x12, 0x0a, 0x2f, 0x70, 0x72, 0x69, 0x76, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x42, - 0x34, 0x5a, 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x6c, 0x6f, 0x67, 0x79, 0x2d, 0x74, 0x65, 0x63, 0x68, 0x2f, 0x73, 0x74, 0x61, - 0x72, 0x73, 0x68, 0x69, 0x70, 0x2f, 0x65, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x2f, 0x65, 0x78, - 0x70, 0x6f, 0x73, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x17, 0x2e, 0x65, 0x78, 0x70, 0x6f, 0x73, 0x65, + 0x72, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x44, + 0x22, 0x10, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0a, 0x12, 0x08, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x5f, + 0x69, 0x64, 0x12, 0x4e, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x12, + 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x17, 0x2e, 0x65, 0x78, 0x70, 0x6f, 0x73, 0x65, + 0x72, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, + 0x22, 0x10, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0a, 0x12, 0x08, 0x2f, 0x70, 0x75, 0x62, 0x5f, 0x6b, + 0x65, 0x79, 0x12, 0x53, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, + 0x46, 0x69, 0x6c, 0x65, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x17, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, + 0x74, 0x72, 0x75, 0x63, 0x74, 0x22, 0x10, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0a, 0x12, 0x08, 0x2f, + 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x12, 0x3f, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x4b, 0x65, + 0x79, 0x73, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x0d, 0x2e, 0x65, 0x78, 0x70, + 0x6f, 0x73, 0x65, 0x72, 0x2e, 0x4b, 0x65, 0x79, 0x73, 0x22, 0x0d, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x07, 0x12, 0x05, 0x2f, 0x6b, 0x65, 0x79, 0x73, 0x12, 0x58, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x50, + 0x72, 0x69, 0x76, 0x4b, 0x65, 0x79, 0x73, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x16, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, + 0x70, 0x74, 0x79, 0x1a, 0x19, 0x2e, 0x65, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x2e, 0x50, 0x72, + 0x69, 0x76, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x4b, 0x65, 0x79, 0x22, 0x12, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0c, 0x12, 0x0a, 0x2f, 0x70, 0x72, 0x69, 0x76, 0x5f, 0x6b, 0x65, + 0x79, 0x73, 0x42, 0x34, 0x5a, 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x6c, 0x6f, 0x67, 0x79, 0x2d, 0x74, 0x65, 0x63, 0x68, 0x2f, + 0x73, 0x74, 0x61, 0x72, 0x73, 0x68, 0x69, 0x70, 0x2f, 0x65, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x72, + 0x2f, 0x65, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -252,7 +253,7 @@ var file_proto_exposer_service_proto_goTypes = []interface{}{ (*ResponsePubKey)(nil), // 1: exposer.ResponsePubKey (*ResponseFileData)(nil), // 2: exposer.ResponseFileData (*emptypb.Empty)(nil), // 3: google.protobuf.Empty - (*GenesisState)(nil), // 4: exposer.GenesisState + (*structpb.Struct)(nil), // 4: google.protobuf.Struct (*Keys)(nil), // 5: exposer.Keys (*PrivValidatorKey)(nil), // 6: exposer.PrivValidatorKey } @@ -264,7 +265,7 @@ var file_proto_exposer_service_proto_depIdxs = []int32{ 3, // 4: exposer.Exposer.GetPrivKeysFile:input_type -> google.protobuf.Empty 0, // 5: exposer.Exposer.GetNodeID:output_type -> exposer.ResponseNodeID 1, // 6: exposer.Exposer.GetPubKey:output_type -> exposer.ResponsePubKey - 4, // 7: exposer.Exposer.GetGenesisFile:output_type -> exposer.GenesisState + 4, // 7: exposer.Exposer.GetGenesisFile:output_type -> google.protobuf.Struct 5, // 8: exposer.Exposer.GetKeys:output_type -> exposer.Keys 6, // 9: exposer.Exposer.GetPrivKeysFile:output_type -> exposer.PrivValidatorKey 5, // [5:10] is the sub-list for method output_type @@ -280,7 +281,6 @@ func file_proto_exposer_service_proto_init() { return } file_proto_exposer_mnemonic_proto_init() - file_proto_exposer_genesis_proto_init() if !protoimpl.UnsafeEnabled { file_proto_exposer_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ResponseNodeID); i { @@ -353,7 +353,7 @@ const _ = grpc.SupportPackageIsVersion6 type ExposerClient interface { GetNodeID(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ResponseNodeID, error) GetPubKey(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ResponsePubKey, error) - GetGenesisFile(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GenesisState, error) + GetGenesisFile(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*structpb.Struct, error) GetKeys(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*Keys, error) GetPrivKeysFile(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*PrivValidatorKey, error) } @@ -384,8 +384,8 @@ func (c *exposerClient) GetPubKey(ctx context.Context, in *emptypb.Empty, opts . return out, nil } -func (c *exposerClient) GetGenesisFile(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GenesisState, error) { - out := new(GenesisState) +func (c *exposerClient) GetGenesisFile(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*structpb.Struct, error) { + out := new(structpb.Struct) err := c.cc.Invoke(ctx, "/exposer.Exposer/GetGenesisFile", in, out, opts...) if err != nil { return nil, err @@ -415,7 +415,7 @@ func (c *exposerClient) GetPrivKeysFile(ctx context.Context, in *emptypb.Empty, type ExposerServer interface { GetNodeID(context.Context, *emptypb.Empty) (*ResponseNodeID, error) GetPubKey(context.Context, *emptypb.Empty) (*ResponsePubKey, error) - GetGenesisFile(context.Context, *emptypb.Empty) (*GenesisState, error) + GetGenesisFile(context.Context, *emptypb.Empty) (*structpb.Struct, error) GetKeys(context.Context, *emptypb.Empty) (*Keys, error) GetPrivKeysFile(context.Context, *emptypb.Empty) (*PrivValidatorKey, error) } @@ -430,7 +430,7 @@ func (*UnimplementedExposerServer) GetNodeID(context.Context, *emptypb.Empty) (* func (*UnimplementedExposerServer) GetPubKey(context.Context, *emptypb.Empty) (*ResponsePubKey, error) { return nil, status.Errorf(codes.Unimplemented, "method GetPubKey not implemented") } -func (*UnimplementedExposerServer) GetGenesisFile(context.Context, *emptypb.Empty) (*GenesisState, error) { +func (*UnimplementedExposerServer) GetGenesisFile(context.Context, *emptypb.Empty) (*structpb.Struct, error) { return nil, status.Errorf(codes.Unimplemented, "method GetGenesisFile not implemented") } func (*UnimplementedExposerServer) GetKeys(context.Context, *emptypb.Empty) (*Keys, error) { diff --git a/exposer/handler.go b/exposer/handler.go index 481da62f..a48e0c2c 100644 --- a/exposer/handler.go +++ b/exposer/handler.go @@ -5,12 +5,14 @@ import ( "encoding/json" "fmt" "io" + "io/ioutil" "net/http" "os" "github.com/golang/protobuf/jsonpb" "go.uber.org/zap" "google.golang.org/protobuf/types/known/emptypb" + "google.golang.org/protobuf/types/known/structpb" pb "github.com/cosmology-tech/starship/exposer/exposer" ) @@ -66,19 +68,25 @@ func (a *AppServer) GetPubKey(ctx context.Context, _ *emptypb.Empty) (*pb.Respon return resPubKey, nil } -func (a *AppServer) GetGenesisFile(ctx context.Context, _ *emptypb.Empty) (*pb.GenesisState, error) { +func (a *AppServer) GetGenesisFile(ctx context.Context, _ *emptypb.Empty) (*structpb.Struct, error) { jsonFile, err := os.Open(a.config.GenesisFile) if err != nil { return nil, err } - state := &pb.GenesisState{} - err = jsonpb.Unmarshal(jsonFile, state) + byteValue, err := ioutil.ReadAll(jsonFile) if err != nil { return nil, err } - return state, nil + state := map[string]interface{}{} + + err = json.Unmarshal(byteValue, &state) + if err != nil { + return nil, err + } + + return structpb.NewStruct(state) } func (a *AppServer) GetKeys(ctx context.Context, _ *emptypb.Empty) (*pb.Keys, error) { diff --git a/proto/Makefile b/proto/Makefile index de40961b..cbac255c 100644 --- a/proto/Makefile +++ b/proto/Makefile @@ -3,8 +3,12 @@ build-proto: build-exposer build-registry .PHONY: build-registry build-registry: - buf generate --path $(CURDIR)/registry/ --output $(CURDIR)/../registry + bazel build //proto/registry:registry_go_proto .PHONY: build-exposer build-exposer: - buf generate --path $(CURDIR)/exposer/ --output $(CURDIR)/../exposer \ No newline at end of file + bazel build //proto/exposer:exposer_go_proto + +.PHONY: update-go-pbs +update-go-pbs: + cd $(CURDIR)/../ && bash scripts/update-go-pbs.sh diff --git a/proto/buf.gen.yaml b/proto/buf.gen.yaml deleted file mode 100644 index 67b39abc..00000000 --- a/proto/buf.gen.yaml +++ /dev/null @@ -1,19 +0,0 @@ -version: v1 -managed: - enabled: true - go_package_prefix: - default: github.com/cosmology-tech/starship - except: - - buf.build/googleapis/googleapis -plugins: - - plugin: buf.build/protocolbuffers/go - out: . - opt: paths=source_relative - - plugin: buf.build/grpc/go - out: . - opt: paths=source_relative - - plugin: buf.build/grpc-ecosystem/gateway - out: . - opt: - - paths=source_relative - - generate_unbound_methods=true diff --git a/proto/buf.lock b/proto/buf.lock deleted file mode 100644 index 6aaf62f8..00000000 --- a/proto/buf.lock +++ /dev/null @@ -1,11 +0,0 @@ -# Generated by buf. DO NOT EDIT. -version: v1 -deps: - - remote: buf.build - owner: googleapis - repository: googleapis - commit: c0ec788bbbb747fca594a1e2347edd4e - - remote: buf.build - owner: grpc-ecosystem - repository: grpc-gateway - commit: a1ecdc58eccd49aa8bea2a7a9022dc27 diff --git a/proto/buf.yaml b/proto/buf.yaml deleted file mode 100644 index 5ec04eb4..00000000 --- a/proto/buf.yaml +++ /dev/null @@ -1,13 +0,0 @@ -version: v1 -name: buf.build/anmol1696/starship -deps: - - buf.build/googleapis/googleapis - - buf.build/grpc-ecosystem/grpc-gateway -breaking: - use: - - FILE -lint: - use: - - DEFAULT - - COMMENTS - - FILE_LOWER_SNAKE_CASE diff --git a/proto/exposer/BUILD.bazel b/proto/exposer/BUILD.bazel index f6fa9a92..99abd819 100644 --- a/proto/exposer/BUILD.bazel +++ b/proto/exposer/BUILD.bazel @@ -4,7 +4,6 @@ load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") proto_library( name = "exposer_proto", srcs = [ - "genesis.proto", "mnemonic.proto", "node.proto", "service.proto", diff --git a/proto/exposer/genesis.proto b/proto/exposer/genesis.proto deleted file mode 100644 index 03e04fda..00000000 --- a/proto/exposer/genesis.proto +++ /dev/null @@ -1,17 +0,0 @@ -syntax = "proto3"; -package exposer; - -import "google/protobuf/timestamp.proto"; -import "google/protobuf/any.proto"; -import "google/protobuf/struct.proto"; - -option go_package = "github.com/cosmology-tech/starship/exposer/exposer"; - -message GenesisState { - google.protobuf.Timestamp genesis_time = 1 [ json_name = "genesis_time" ]; - string chain_id = 2 [ json_name = "chain_id" ]; - string initial_height = 3 [ json_name = "initial_height" ]; - google.protobuf.Struct consensus_params = 4 [ json_name = "consensus_params" ]; - string app_hash = 5 [ json_name = "app_hash" ]; - google.protobuf.Struct app_state = 6 [ json_name = "app_state" ]; -} diff --git a/proto/exposer/service.proto b/proto/exposer/service.proto index 41f87760..2f67722c 100644 --- a/proto/exposer/service.proto +++ b/proto/exposer/service.proto @@ -3,11 +3,11 @@ package exposer; import "google/api/annotations.proto"; import "google/protobuf/empty.proto"; +import "google/protobuf/struct.proto"; import "google/protobuf/any.proto"; import "google/protobuf/descriptor.proto"; import "proto/exposer/mnemonic.proto"; -import "proto/exposer/genesis.proto"; option go_package = "github.com/cosmology-tech/starship/exposer/exposer"; @@ -22,7 +22,7 @@ service Exposer { option (google.api.http) = { get: "/pub_key" }; } // GetGenesisFile returns the genesis file of the node - rpc GetGenesisFile(google.protobuf.Empty) returns (GenesisState) { + rpc GetGenesisFile(google.protobuf.Empty) returns (google.protobuf.Struct) { option (google.api.http) = { get: "/genesis" }; } // GetKeysFile returns the keys of the node diff --git a/tests/BUILD.bazel b/tests/BUILD.bazel index 29ee04de..020f3cc7 100644 --- a/tests/BUILD.bazel +++ b/tests/BUILD.bazel @@ -38,25 +38,7 @@ go_test( "@com_github_json_iterator_go//:go", "@com_github_stretchr_testify//suite", "@in_gopkg_yaml_v3//:yaml_v3", - "@org_uber_go_zap//:zap", - ], -) - -go_test( - name = "tests_test", - srcs = [ - "e2e_test.go", - "exposer_test.go", - "registry_test.go", - ], - embed = [":tests"], - deps = [ - "//proto/exposer:exposer_go_proto", - "//proto/registry:registry_go_proto", - "@com_github_golang_protobuf//jsonpb", - "@com_github_golang_protobuf//proto", - "@com_github_stretchr_testify//suite", - "@in_gopkg_yaml_v3//:yaml_v3", + "@org_golang_google_protobuf//types/known/structpb", "@org_uber_go_zap//:zap", ], ) diff --git a/tests/Makefile b/tests/Makefile index 70a1cbc4..c339dab8 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -19,7 +19,7 @@ stop: stop-forward delete ############################################################################### install: - helm install -f $(HELM_FILE) $(HELM_NAME) ../charts/$(HELM_CHART) --wait --debug + helm install -f $(HELM_FILE) $(HELM_NAME) ../charts/$(HELM_CHART) upgrade: helm upgrade --debug $(HELM_NAME) ../charts/$(HELM_CHART) -f $(HELM_FILE) diff --git a/tests/e2e_test.go b/tests/e2e_test.go index 35ca471e..5851ed36 100644 --- a/tests/e2e_test.go +++ b/tests/e2e_test.go @@ -33,6 +33,10 @@ func (s *TestSuite) SetupTest() { // read config file from yaml configFile := os.Getenv(configEnvKey) + if configFile == "" { + s.T().Log(fmt.Errorf("env var %s not set, using default value", configEnvKey)) + configFile = "configs/two-chain.yaml" + } configFile = strings.Replace(configFile, "tests/", "", -1) yamlFile, err := os.ReadFile(configFile) s.Require().NoError(err) diff --git a/tests/exposer_test.go b/tests/exposer_test.go index 14c24b29..fe5deaaf 100644 --- a/tests/exposer_test.go +++ b/tests/exposer_test.go @@ -7,6 +7,7 @@ import ( "github.com/golang/protobuf/jsonpb" "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/types/known/structpb" pb "github.com/cosmology-tech/starship/exposer/exposer" ) @@ -48,12 +49,12 @@ func (s *TestSuite) TestExposer_GetGenesisFile() { s.Require().NoError(err) // todo: fix unmarshalling of genesis into proto - resp := &pb.GenesisState{} + resp := &structpb.Struct{} s.MakeExposerRequest(chain, req, resp) // assert results to expected values s.Assert().NotNil(resp) - s.Assert().Equal(chain.Name, resp.ChainId) + s.Assert().Equal(chain.Name, resp.AsMap()["chain_id"]) } func (s *TestSuite) TestExposer_GetPubKey() { From cafaf2c246f1852551496e7eed2cdd0a9df927ef Mon Sep 17 00:00:00 2001 From: Anmol Date: Tue, 8 Aug 2023 18:46:28 +0530 Subject: [PATCH 4/8] move default chains and relayers to defaults.yaml file (#163) --- charts/devnet/defaults.yaml | 263 +++++++++++++++++ .../templates/chains/cosmos/genesis.yaml | 3 +- .../templates/chains/cosmos/validator.yaml | 3 +- .../chains/virtual/eth/statefulset.yaml | 3 +- charts/devnet/templates/explorer.yaml | 3 +- charts/devnet/templates/registry.yaml | 3 +- .../relayers/go-relayer/configmap.yaml | 3 +- .../relayers/go-relayer/statefulset.yaml | 3 +- .../templates/relayers/hermes/configmap.yaml | 3 +- .../relayers/hermes/statefulset.yaml | 3 +- .../relayers/ts-relayer/configmap.yaml | 3 +- .../relayers/ts-relayer/statefulset.yaml | 3 +- charts/devnet/values.yaml | 265 ------------------ 13 files changed, 285 insertions(+), 276 deletions(-) create mode 100644 charts/devnet/defaults.yaml diff --git a/charts/devnet/defaults.yaml b/charts/devnet/defaults.yaml new file mode 100644 index 00000000..b562e9dd --- /dev/null +++ b/charts/devnet/defaults.yaml @@ -0,0 +1,263 @@ +# API for interacting with the charts for devnet +# TODO: need a way to create state reaching jobs, those will run user bash scripts +# after the chain has been initialized, get the chain to a state and then complete +defaultChains: + osmosis: + image: ghcr.io/cosmology-tech/starship/osmosis:v15.1.2-wasmvm1.1.2 + home: /root/.osmosisd + binary: osmosisd + prefix: osmo + denom: uosmo + coins: 100000000000000uosmo,100000000000000uion + hdPath: m/44'/118'/0'/0/0 + coinType: 118 + repo: https://github.com/osmosis-labs/osmosis + juno: + image: ghcr.io/cosmology-tech/starship/juno:v15.0.0 + home: /root/.juno + binary: junod + prefix: juno + denom: ujuno + coins: 100000000000000ujuno + hdPath: m/44'/118'/0'/0/0 + coinType: 118 + repo: https://github.com/CosmosContracts/juno + wasmd: + image: anmol1696/wasmd:latest + home: /root/.wasmd + binary: wasmd + prefix: wasm + denom: stake + coins: 100000000000000ucosm,100000000000000stake + hdPath: m/44'/118'/0'/0/0 + coinType: 118 + repo: https://github.com/CosmWasm/wasmd + cosmos: + image: ghcr.io/cosmology-tech/starship/gaia:v9.1.1 + home: /root/.gaia + binary: gaiad + prefix: cosmos + denom: uatom + coins: 100000000000000stake,100000000000000uatom + hdPath: m/44'/118'/0'/0/0 + coinType: 118 + repo: https://github.com/cosmos/gaia + simapp: + image: ghcr.io/cosmology-tech/starship/simapp:v0.47.3 + home: /root/.simapp + binary: simd + prefix: cosmos + denom: stake + coins: 100000000000000stake + hdPath: m/44'/118'/0'/0/0 + coinType: 118 + repo: https://github.com/cosmos/cosmos-sdk/tree/main/simapp + persistencecore: + image: anmol1696/persistencecore:latest + home: /root/.persistenceCore + binary: persistenceCore + prefix: persistence + denom: uxprt + coins: 100000000000000uxprt + hdPath: m/44'/118'/0'/0/0 + coinType: 118 + repo: https://github.com/persistenceOne/persistenceCore + stride: + image: ghcr.io/cosmology-tech/starship/stride:v9.2.1 + home: /root/.stride + binary: strided + prefix: stride + denom: ustrd + coins: 100000000000000ustrd + hdPath: m/44'/118'/0'/0/0 + coinType: 118 + repo: https://github.com/Stride-Labs/stride + injective: + image: ghcr.io/cosmology-tech/starship/injective:v1.11-1685225746 + home: /root/.injectived + binary: injectived + prefix: inj + denom: inj + coins: 100000000000000inj + hdPath: m/44'/60'/0'/0/0 + coinType: 60 + repo: https://github.com/InjectiveLabs/injective-chain-releases + ics: + image: ghcr.io/cosmology-tech/starship/ics:v0.1.0 + home: /root/.ics + binary: interchain-security-pd + prefix: cosmos + denom: uatom + coins: 100000000000000stake,100000000000000uatom + hdPath: m/44'/118'/0'/0/0 + coinType: 118 + repo: https://github.com/cosmos/interchain-security + cronos: + image: ghcr.io/cosmology-tech/starship/cronos:v1.0.4 + home: /root/.cronos + binary: cronosd + prefix: crc + denom: basecro + coins: 100000000000000basecro + hdPath: m/44'/60'/0'/0/0 + coinType: 60 + repo: https://github.com/crypto-org-chain/cronos + cryptoorgchain: + image: ghcr.io/cosmology-tech/starship/cryptoorgchain:v4.1.2 + home: /root/.cryptoorgchain + binary: chain-maind + prefix: cro + denom: basecro + coins: 100000000000000basecro + hdPath: m/44'/118'/0'/0/0 + coinType: 118 + repo: https://github.com/crypto-org-chain/chain-main + evmos: + image: ghcr.io/cosmology-tech/starship/evmos:v12.1.5 + home: /root/.evmosd + binary: evmosd + prefix: evmos + denom: aevmos + coins: 100000000000000aevmos + hdPath: m/44'/60'/0'/0/0 + coinType: 60 + repo: https://github.com/evmos/evmos + regen: + image: ghcr.io/cosmology-tech/starship/regen:v5.0.0 + home: /root/.regen + binary: regen + prefix: regen + denom: uregen + coins: 100000000000000uregen + hdPath: m/44'/118'/0'/0/0 + coinType: 118 + repo: https://github.com/regen-network/regen-ledger + quasar: + image: ghcr.io/cosmology-tech/starship/quasar:v0.1.1 + home: /root/.quasarnode + binary: quasarnoded + prefix: quasar + denom: uqsr + coins: 100000000000000uqsr + hdPath: m/44'/118'/0'/0/0 + coinType: 118 + repo: https://github.com/quasar-finance/quasar-preview + quicksilver: + image: ghcr.io/cosmology-tech/starship/quicksilver:v0.6.6 + home: /root/.quicksilverd + binary: quicksilverd + prefix: quick + denom: uqck + coins: 100000000000000uqck + hdPath: m/44'/118'/0'/0/0 + coinType: 118 + repo: https://github.com/ingenuity-build/quicksilver + sei: + image: ghcr.io/cosmology-tech/starship/sei:2.0.46beta + home: /root/.seid + binary: seid + prefix: sei + denom: usei + coins: 100000000000000usei + hdPath: m/44'/118'/0'/0/0 + coinType: 118 + repo: https://github.com/sei-protocol/sei-chain + sommelier: + image: ghcr.io/cosmology-tech/starship/sommelier:v6.0.0 + home: /root/.sommelier + binary: sommelier + prefix: somm + denom: usomm + coins: 100000000000000usomm + hdPath: m/44'/118'/0'/0/0 + coinType: 118 + repo: https://github.com/PeggyJV/sommelier + stargaze: + image: ghcr.io/cosmology-tech/starship/stargaze:v10.0.1 + home: /root/.starsd + binary: starsd + prefix: stars + denom: ustars + coins: 100000000000000ustars + hdPath: m/44'/118'/0'/0/0 + coinType: 118 + repo: https://github.com/public-awesome/stargaze + umee: + image: ghcr.io/cosmology-tech/starship/umee:v3.1.0 + home: /root/.umee + binary: umeed + prefix: umee + denom: uumee + coins: 100000000000000uumee + hdPath: m/44'/118'/0'/0/0 + coinType: 118 + repo: https://github.com/umee-network/umee + eth: + prysmCtl: + image: gcr.io/prysmaticlabs/prysm/cmd/prysmctl + command: ["/app/cmd/prysmctl/prysmctl"] + args: + - testnet + - generate-genesis + - --num-validators=36 + - --output-ssz=/ethereum/consensus/genesis.ssz + - --chain-config-file=/etc/config/config.yml + geth: + image: ethereum/client-go:v1.10.26 + args: + - --nodiscover + - --http + - --http.api=eth,net,web3,debug + - --http.addr=0.0.0.0 + - --http.vhosts=* + - --authrpc.addr=0.0.0.0 + - --authrpc.jwtsecret=/etc/secrets/jwt.hex + - --datadir=/ethereum/execution + - --allow-insecure-unlock + - --unlock=0x123463a4B065722E99115D6c222f267d9cABb524 + - --password=/dev/null + - --syncmode=full + - --mine + - --miner.etherbase=0x123463a4b065722e99115d6c222f267d9cabb524 + - --networkid=32382 + beaconChain: + image: gcr.io/prysmaticlabs/prysm/beacon-chain:v4.0.7 + command: ["/app/cmd/beacon-chain/beacon-chain"] + args: + - --datadir=/ethereum/consensus/beacon + - --min-sync-peers=0 + - --genesis-state=/ethereum/consensus/genesis.ssz + - --bootstrap-node= + - --chain-config-file=/etc/config/config.yml + - --config-file=/etc/config/config.yml + - --chain-id=32382 + - --rpc-host=0.0.0.0 + - --contract-deployment-block=0 + - --grpc-gateway-host=0.0.0.0 + - --execution-endpoint=http://localhost:8551 + - --accept-terms-of-use + - --jwt-secret=/etc/secrets/jwt.hex + - --contract-deployment-block=0 + - --suggested-fee-recipient=0x123463a4B065722E99115D6c222f267d9cABb524 + validator: + image: gcr.io/prysmaticlabs/prysm/validator:v4.0.7 + command: ["/app/cmd/validator/validator"] + args: + - --accept-terms-of-use + - --beacon-rpc-provider=localhost:4000 + - --datadir=/ethereum/consensus/validator + - --interop-num-validators=36 + - --interop-start-index=0 + - --force-clear-db + - --chain-config-file=/etc/config/config.yml + - --config-file=/etc/config/config.yml + - --suggested-fee-recipient=0x0C46c2cAFE097b4f7e1BB868B89e5697eE65f934 + contracts: [] + +defaultRelayers: + ts-relayer: + image: ghcr.io/cosmology-tech/starship/ts-relayer:0.9.0 + hermes: + image: ghcr.io/cosmology-tech/starship/hermes:1.5.1 + go-relayer: + image: ghcr.io/polymerdao/relayer-ibcx:starship-integration diff --git a/charts/devnet/templates/chains/cosmos/genesis.yaml b/charts/devnet/templates/chains/cosmos/genesis.yaml index 88ac7322..ff2222ea 100644 --- a/charts/devnet/templates/chains/cosmos/genesis.yaml +++ b/charts/devnet/templates/chains/cosmos/genesis.yaml @@ -1,7 +1,8 @@ {{- range $chain := .Values.chains }} {{- if ne $chain.type "virtual" }} {{ $dataExposer := dict "chain" $chain.name "port" ($.Values.exposer.ports.rest | quote | default "8081") }} -{{ $defaultChain := get $.Values.defaultChains $chain.type | default dict }} +{{ $defaultFile := $.Files.Get "defaults.yaml" | fromYaml }} +{{ $defaultChain := get $defaultFile.defaultChains $chain.type | default dict }} # merge defaultChain values into the $chain dict {{ $chain = merge $chain $defaultChain }} diff --git a/charts/devnet/templates/chains/cosmos/validator.yaml b/charts/devnet/templates/chains/cosmos/validator.yaml index 4d3a8695..0ed1be02 100644 --- a/charts/devnet/templates/chains/cosmos/validator.yaml +++ b/charts/devnet/templates/chains/cosmos/validator.yaml @@ -2,7 +2,8 @@ {{- if ne $chain.type "virtual" }} {{- if gt $chain.numValidators 1.0 }} {{ $dataExposer := dict "chain" $chain.name "port" ($.Values.exposer.ports.rest | quote | default "8081") }} -{{ $defaultChain := get $.Values.defaultChains $chain.type | default dict }} +{{ $defaultFile := $.Files.Get "defaults.yaml" | fromYaml }} +{{ $defaultChain := get $defaultFile.defaultChains $chain.type | default dict }} # merge defaultChain values into the $chain dict {{ $chain = merge $chain $defaultChain }} diff --git a/charts/devnet/templates/chains/virtual/eth/statefulset.yaml b/charts/devnet/templates/chains/virtual/eth/statefulset.yaml index b1e92adf..7b448157 100644 --- a/charts/devnet/templates/chains/virtual/eth/statefulset.yaml +++ b/charts/devnet/templates/chains/virtual/eth/statefulset.yaml @@ -2,7 +2,8 @@ {{- if eq $chain.type "virtual" }} {{- if eq $chain.subtype "eth" }} -{{ $defaultChain := get $.Values.defaultChains $chain.subtype | default dict }} +{{ $defaultFile := $.Files.Get "defaults.yaml" | fromYaml }} +{{ $defaultChain := get $defaultFile.defaultChains $chain.subtype | default dict }} {{ $chain = merge $chain $defaultChain }} diff --git a/charts/devnet/templates/explorer.yaml b/charts/devnet/templates/explorer.yaml index 719c5135..59eaac83 100644 --- a/charts/devnet/templates/explorer.yaml +++ b/charts/devnet/templates/explorer.yaml @@ -76,7 +76,8 @@ metadata: name: explorer data: {{- range $chain := .Values.chains }} - {{ $defaultChain := get $.Values.defaultChains $chain.type | default dict }} + {{ $defaultFile := $.Files.Get "defaults.yaml" | fromYaml }} + {{ $defaultChain := get $defaultFile.defaultChains $chain.type | default dict }} {{ $chain = merge $chain $defaultChain }} {{ $host := "localhost" }} {{- if not $.Values.explorer.localhost }} diff --git a/charts/devnet/templates/registry.yaml b/charts/devnet/templates/registry.yaml index b60af7dc..be90f3c0 100644 --- a/charts/devnet/templates/registry.yaml +++ b/charts/devnet/templates/registry.yaml @@ -94,7 +94,8 @@ spec: {{- end }} --- {{- range $chain := .Values.chains }} -{{ $defaultChain := get $.Values.defaultChains $chain.type | default dict }} +{{ $defaultFile := $.Files.Get "defaults.yaml" | fromYaml }} +{{ $defaultChain := get $defaultFile.defaultChains $chain.type | default dict }} {{ $chain = merge $chain $defaultChain }} {{ $host := "localhost" }} {{- if not $.Values.registry.localhost }} diff --git a/charts/devnet/templates/relayers/go-relayer/configmap.yaml b/charts/devnet/templates/relayers/go-relayer/configmap.yaml index b5e16b84..42c6176b 100644 --- a/charts/devnet/templates/relayers/go-relayer/configmap.yaml +++ b/charts/devnet/templates/relayers/go-relayer/configmap.yaml @@ -24,7 +24,8 @@ data: {{- range $i, $chain := $relayer.chains }} {{- range $fullchain := $.Values.chains }} {{- if eq $fullchain.name $chain }} - {{ $defaultChain := get $.Values.defaultChains $fullchain.type }} + {{ $defaultFile := $.Files.Get "defaults.yaml" | fromYaml }} + {{ $defaultChain := get $defaultFile.defaultChains $fullchain.type | default dict }} {{ $fullchain = merge $fullchain $defaultChain }} {{ $fullchain.name }}.json: |- { diff --git a/charts/devnet/templates/relayers/go-relayer/statefulset.yaml b/charts/devnet/templates/relayers/go-relayer/statefulset.yaml index 2d8e6a78..e287c382 100644 --- a/charts/devnet/templates/relayers/go-relayer/statefulset.yaml +++ b/charts/devnet/templates/relayers/go-relayer/statefulset.yaml @@ -1,6 +1,7 @@ {{- range $relayer := .Values.relayers }} {{- if eq $relayer.type "go-relayer" }} -{{ $defaultRelayer := get $.Values.defaultRelayers $relayer.type }} +{{ $defaultFile := $.Files.Get "defaults.yaml" | fromYaml }} +{{ $defaultRelayer := get $defaultFile.defaultRelayers $relayer.type | default dict }} {{ $initParams := dict "chains" $relayer.chains "port" $.Values.exposer.ports.rest "context" $ }} {{ $imagePullSecrets := $relayer.imagePullSecrets | default list }} diff --git a/charts/devnet/templates/relayers/hermes/configmap.yaml b/charts/devnet/templates/relayers/hermes/configmap.yaml index 5ce3bd1e..f325f7c9 100644 --- a/charts/devnet/templates/relayers/hermes/configmap.yaml +++ b/charts/devnet/templates/relayers/hermes/configmap.yaml @@ -81,7 +81,8 @@ data: {{- range $i, $chain := $relayer.chains }} {{- range $fullchain := $.Values.chains }} {{- if eq $fullchain.name $chain }} - {{ $defaultChain := get $.Values.defaultChains $fullchain.type | default dict }} + {{ $defaultFile := $.Files.Get "defaults.yaml" | fromYaml }} + {{ $defaultChain := get $defaultFile.defaultChains $fullchain.type | default dict }} {{ $fullchain = merge $fullchain $defaultChain }} [[chains]] id = "{{ $chain }}" diff --git a/charts/devnet/templates/relayers/hermes/statefulset.yaml b/charts/devnet/templates/relayers/hermes/statefulset.yaml index 308ffa50..447c1818 100644 --- a/charts/devnet/templates/relayers/hermes/statefulset.yaml +++ b/charts/devnet/templates/relayers/hermes/statefulset.yaml @@ -1,6 +1,7 @@ {{- range $relayer := .Values.relayers }} {{- if eq $relayer.type "hermes" }} -{{ $defaultRelayer := get $.Values.defaultRelayers $relayer.type }} +{{ $defaultFile := $.Files.Get "defaults.yaml" | fromYaml }} +{{ $defaultRelayer := get $defaultFile.defaultRelayers $relayer.type | default dict }} {{ $initParams := dict "chains" $relayer.chains "port" $.Values.exposer.ports.rest "context" $ }} --- apiVersion: apps/v1 diff --git a/charts/devnet/templates/relayers/ts-relayer/configmap.yaml b/charts/devnet/templates/relayers/ts-relayer/configmap.yaml index 46cf49bd..dc9db892 100644 --- a/charts/devnet/templates/relayers/ts-relayer/configmap.yaml +++ b/charts/devnet/templates/relayers/ts-relayer/configmap.yaml @@ -19,7 +19,8 @@ data: {{ $chain }}: {{- range $fullchain := $.Values.chains }} {{- if eq $fullchain.name $chain }} - {{ $defaultChain := get $.Values.defaultChains $fullchain.type | default dict }} + {{ $defaultFile := $.Files.Get "defaults.yaml" | fromYaml }} + {{ $defaultChain := get $defaultFile.defaultChains $fullchain.type | default dict }} {{ $fullchain = merge $fullchain $defaultChain }} chain_id: {{ $chain }} # You can include multiple RPC endpoints and it will rotate through them if diff --git a/charts/devnet/templates/relayers/ts-relayer/statefulset.yaml b/charts/devnet/templates/relayers/ts-relayer/statefulset.yaml index ba304131..f7aea7d1 100644 --- a/charts/devnet/templates/relayers/ts-relayer/statefulset.yaml +++ b/charts/devnet/templates/relayers/ts-relayer/statefulset.yaml @@ -1,6 +1,7 @@ {{- range $relayer := .Values.relayers }} {{- if eq $relayer.type "ts-relayer" }} -{{ $defaultRelayer := get $.Values.defaultRelayers $relayer.type }} +{{ $defaultFile := $.Files.Get "defaults.yaml" | fromYaml }} +{{ $defaultRelayer := get $defaultFile.defaultRelayers $relayer.type | default dict }} {{ $initParams := dict "chains" $relayer.chains "port" $.Values.exposer.ports.rest "context" $ }} --- apiVersion: apps/v1 diff --git a/charts/devnet/values.yaml b/charts/devnet/values.yaml index 09c2796a..0d6dccec 100644 --- a/charts/devnet/values.yaml +++ b/charts/devnet/values.yaml @@ -49,271 +49,6 @@ timeouts: timeout_precommit_delta: 400ms timeout_commit: 800ms -# API for interacting with the charts for devnet -# TODO: need a way to create state reaching jobs, those will run user bash scripts -# after the chain has been initialized, get the chain to a state and then complete -defaultChains: - osmosis: - image: ghcr.io/cosmology-tech/starship/osmosis:v15.1.2-wasmvm1.1.2 - home: /root/.osmosisd - binary: osmosisd - prefix: osmo - denom: uosmo - coins: 100000000000000uosmo,100000000000000uion - hdPath: m/44'/118'/0'/0/0 - coinType: 118 - repo: https://github.com/osmosis-labs/osmosis - juno: - image: ghcr.io/cosmology-tech/starship/juno:v15.0.0 - home: /root/.juno - binary: junod - prefix: juno - denom: ujuno - coins: 100000000000000ujuno - hdPath: m/44'/118'/0'/0/0 - coinType: 118 - repo: https://github.com/CosmosContracts/juno - wasmd: - image: anmol1696/wasmd:latest - home: /root/.wasmd - binary: wasmd - prefix: wasm - denom: stake - coins: 100000000000000ucosm,100000000000000stake - hdPath: m/44'/118'/0'/0/0 - coinType: 118 - repo: https://github.com/CosmWasm/wasmd - cosmos: - image: ghcr.io/cosmology-tech/starship/gaia:v9.1.1 - home: /root/.gaia - binary: gaiad - prefix: cosmos - denom: uatom - coins: 100000000000000stake,100000000000000uatom - hdPath: m/44'/118'/0'/0/0 - coinType: 118 - repo: https://github.com/cosmos/gaia - simapp: - image: ghcr.io/cosmology-tech/starship/simapp:v0.47.3 - home: /root/.simapp - binary: simd - prefix: cosmos - denom: stake - coins: 100000000000000stake - hdPath: m/44'/118'/0'/0/0 - coinType: 118 - repo: https://github.com/cosmos/cosmos-sdk/tree/main/simapp - persistencecore: - image: anmol1696/persistencecore:latest - home: /root/.persistenceCore - binary: persistenceCore - prefix: persistence - denom: uxprt - coins: 100000000000000uxprt - hdPath: m/44'/118'/0'/0/0 - coinType: 118 - repo: https://github.com/persistenceOne/persistenceCore - stride: - image: ghcr.io/cosmology-tech/starship/stride:v9.2.1 - home: /root/.stride - binary: strided - prefix: stride - denom: ustrd - coins: 100000000000000ustrd - hdPath: m/44'/118'/0'/0/0 - coinType: 118 - repo: https://github.com/Stride-Labs/stride - injective: - image: ghcr.io/cosmology-tech/starship/injective:v1.11-1685225746 - home: /root/.injectived - binary: injectived - prefix: inj - denom: inj - coins: 100000000000000inj - hdPath: m/44'/60'/0'/0/0 - coinType: 60 - repo: https://github.com/InjectiveLabs/injective-chain-releases - ics: - image: ghcr.io/cosmology-tech/starship/ics:v0.1.0 - home: /root/.ics - binary: interchain-security-pd - prefix: cosmos - denom: uatom - coins: 100000000000000stake,100000000000000uatom - hdPath: m/44'/118'/0'/0/0 - coinType: 118 - repo: https://github.com/cosmos/interchain-security - cronos: - image: ghcr.io/cosmology-tech/starship/cronos:v1.0.4 - home: /root/.cronos - binary: cronosd - prefix: crc - denom: basecro - coins: 100000000000000basecro - hdPath: m/44'/60'/0'/0/0 - coinType: 60 - repo: https://github.com/crypto-org-chain/cronos - cryptoorgchain: - image: ghcr.io/cosmology-tech/starship/cryptoorgchain:v4.1.2 - home: /root/.cryptoorgchain - binary: chain-maind - prefix: cro - denom: basecro - coins: 100000000000000basecro - hdPath: m/44'/118'/0'/0/0 - coinType: 118 - repo: https://github.com/crypto-org-chain/chain-main - evmos: - image: ghcr.io/cosmology-tech/starship/evmos:v12.1.5 - home: /root/.evmosd - binary: evmosd - prefix: evmos - denom: aevmos - coins: 100000000000000aevmos - hdPath: m/44'/60'/0'/0/0 - coinType: 60 - repo: https://github.com/evmos/evmos - regen: - image: ghcr.io/cosmology-tech/starship/regen:v5.0.0 - home: /root/.regen - binary: regen - prefix: regen - denom: uregen - coins: 100000000000000uregen - hdPath: m/44'/118'/0'/0/0 - coinType: 118 - repo: https://github.com/regen-network/regen-ledger - quasar: - image: ghcr.io/cosmology-tech/starship/quasar:v0.1.1 - home: /root/.quasarnode - binary: quasarnoded - prefix: quasar - denom: uqsr - coins: 100000000000000uqsr - hdPath: m/44'/118'/0'/0/0 - coinType: 118 - repo: https://github.com/quasar-finance/quasar-preview - quicksilver: - image: ghcr.io/cosmology-tech/starship/quicksilver:v0.6.6 - home: /root/.quicksilverd - binary: quicksilverd - prefix: quick - denom: uqck - coins: 100000000000000uqck - hdPath: m/44'/118'/0'/0/0 - coinType: 118 - repo: https://github.com/ingenuity-build/quicksilver - sei: - image: ghcr.io/cosmology-tech/starship/sei:2.0.46beta - home: /root/.seid - binary: seid - prefix: sei - denom: usei - coins: 100000000000000usei - hdPath: m/44'/118'/0'/0/0 - coinType: 118 - repo: https://github.com/sei-protocol/sei-chain - sommelier: - image: ghcr.io/cosmology-tech/starship/sommelier:v6.0.0 - home: /root/.sommelier - binary: sommelier - prefix: somm - denom: usomm - coins: 100000000000000usomm - hdPath: m/44'/118'/0'/0/0 - coinType: 118 - repo: https://github.com/PeggyJV/sommelier - stargaze: - image: ghcr.io/cosmology-tech/starship/stargaze:v10.0.1 - home: /root/.starsd - binary: starsd - prefix: stars - denom: ustars - coins: 100000000000000ustars - hdPath: m/44'/118'/0'/0/0 - coinType: 118 - repo: https://github.com/public-awesome/stargaze - umee: - image: ghcr.io/cosmology-tech/starship/umee:v3.1.0 - home: /root/.umee - binary: umeed - prefix: umee - denom: uumee - coins: 100000000000000uumee - hdPath: m/44'/118'/0'/0/0 - coinType: 118 - repo: https://github.com/umee-network/umee - eth: - prysmCtl: - image: gcr.io/prysmaticlabs/prysm/cmd/prysmctl - command: ["/app/cmd/prysmctl/prysmctl"] - args: - - testnet - - generate-genesis - - --num-validators=36 - - --output-ssz=/ethereum/consensus/genesis.ssz - - --chain-config-file=/etc/config/config.yml - geth: - image: ethereum/client-go:v1.10.26 - args: - - --nodiscover - - --http - - --http.api=eth,net,web3,debug - - --http.addr=0.0.0.0 - - --http.vhosts=* - - --authrpc.addr=0.0.0.0 - - --authrpc.jwtsecret=/etc/secrets/jwt.hex - - --datadir=/ethereum/execution - - --allow-insecure-unlock - - --unlock=0x123463a4B065722E99115D6c222f267d9cABb524 - - --password=/dev/null - - --syncmode=full - - --mine - - --miner.etherbase=0x123463a4b065722e99115d6c222f267d9cabb524 - - --networkid=32382 - beaconChain: - image: gcr.io/prysmaticlabs/prysm/beacon-chain:v4.0.7 - command: ["/app/cmd/beacon-chain/beacon-chain"] - args: - - --datadir=/ethereum/consensus/beacon - - --min-sync-peers=0 - - --genesis-state=/ethereum/consensus/genesis.ssz - - --bootstrap-node= - - --chain-config-file=/etc/config/config.yml - - --config-file=/etc/config/config.yml - - --chain-id=32382 - - --rpc-host=0.0.0.0 - - --contract-deployment-block=0 - - --grpc-gateway-host=0.0.0.0 - - --execution-endpoint=http://localhost:8551 - - --accept-terms-of-use - - --jwt-secret=/etc/secrets/jwt.hex - - --contract-deployment-block=0 - - --suggested-fee-recipient=0x123463a4B065722E99115D6c222f267d9cABb524 - validator: - image: gcr.io/prysmaticlabs/prysm/validator:v4.0.7 - command: ["/app/cmd/validator/validator"] - args: - - --accept-terms-of-use - - --beacon-rpc-provider=localhost:4000 - - --datadir=/ethereum/consensus/validator - - --interop-num-validators=36 - - --interop-start-index=0 - - --force-clear-db - - --chain-config-file=/etc/config/config.yml - - --config-file=/etc/config/config.yml - - --suggested-fee-recipient=0x0C46c2cAFE097b4f7e1BB868B89e5697eE65f934 - contracts: [] - - -defaultRelayers: - ts-relayer: - image: ghcr.io/cosmology-tech/starship/ts-relayer:0.9.0 - hermes: - image: ghcr.io/cosmology-tech/starship/hermes:1.5.1 - go-relayer: - image: ghcr.io/polymerdao/relayer-ibcx:starship-integration - chains: [] # Examples running chains # - name: osmosis-1 From 7048c365a5ce275b602a18e1da391ee5334b2164 Mon Sep 17 00:00:00 2001 From: Anmol1696 Date: Tue, 8 Aug 2023 18:47:16 +0530 Subject: [PATCH 5/8] Chart release 0.1.41 --- charts/devnet/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/devnet/Chart.yaml b/charts/devnet/Chart.yaml index 47b2abd8..13f16053 100644 --- a/charts/devnet/Chart.yaml +++ b/charts/devnet/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.40 +version: 0.1.41 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to From 48170c23b1260d7023f6e0056f25d7ed734acd82 Mon Sep 17 00:00:00 2001 From: Anmol Date: Tue, 8 Aug 2023 20:12:02 +0530 Subject: [PATCH 6/8] update create-validator script to handle cosmos-sdk version (#167) --- charts/devnet/scripts/create_validator.sh | 91 +++++++++++++++---- .../cosmos-simapp-multi/configs/local.yaml | 14 ++- 2 files changed, 83 insertions(+), 22 deletions(-) diff --git a/charts/devnet/scripts/create_validator.sh b/charts/devnet/scripts/create_validator.sh index 7efa8d25..1a5dd982 100644 --- a/charts/devnet/scripts/create_validator.sh +++ b/charts/devnet/scripts/create_validator.sh @@ -17,20 +17,77 @@ do sleep 30 done -# Run create validator tx command -echo "Running txn for create-validator" -$CHAIN_BIN tx staking create-validator \ - --pubkey=$($CHAIN_BIN tendermint show-validator) \ - --moniker $VAL_NAME \ - --amount 5000000000$DENOM \ - --chain-id $CHAIN_ID \ - --from $VAL_NAME \ - --commission-rate="0.10" \ - --commission-max-rate="0.20" \ - --commission-max-change-rate="0.01" \ - --min-self-delegation="1000000" \ - --fees 100000$DENOM \ - --gas="auto" \ - --gas-adjustment 1.5 --yes > /validator.log - -cat /validator.log | jq +# Function to compare version numbers +version_compare() { + version1="$1" + version2="$2" + if [[ "$(printf '%s\n' "$version1" "$version2" | sort -V | head -n 1)" == "$version1" ]]; then + return 1 # version1 is greater + else + return 0 # version2 is greater or equal + fi +} + +# Check if cosmos_sdk_version is greater than a specified version +is_greater() { + version_compare "$1" "$2" + return $? +} + +function cosmos-sdk-version-v50() { + # Content for the validator.json file + json_content='{ + "pubkey": '$($CHAIN_BIN tendermint show-validator)', + "amount": "5000000000'$DENOM'", + "moniker": "'$VAL_NAME'", + "commission-rate": "0.1", + "commission-max-rate": "0.2", + "commission-max-change-rate": "0.01", + "min-self-delegation": "1000000" + }' + echo "$json_content" > /validator.json + cat /validator.json + + # Run create validator tx command + echo "Running txn for create-validator" + $CHAIN_BIN tx staking create-validator /validator.json \ + --chain-id $CHAIN_ID \ + --from $VAL_NAME \ + --fees 100000$DENOM \ + --gas="auto" \ + --gas-adjustment 1.5 --yes > /validator.log + + cat /validator.log | jq +} + +function cosmos-sdk-version-default() { + # Run create validator tx command + echo "Running txn for create-validator" + $CHAIN_BIN tx staking create-validator \ + --pubkey=$($CHAIN_BIN tendermint show-validator) \ + --moniker $VAL_NAME \ + --amount 5000000000$DENOM \ + --chain-id $CHAIN_ID \ + --from $VAL_NAME \ + --commission-rate="0.10" \ + --commission-max-rate="0.20" \ + --commission-max-change-rate="0.01" \ + --min-self-delegation="1000000" \ + --fees 100000$DENOM \ + --gas="auto" \ + --gas-adjustment 1.5 --yes > /validator.log + + cat /validator.log | jq +} + +# Fetch the cosmos-sdk version to be able to perform the create-validator tx +cosmos_sdk_version=$($CHAIN_BIN version --long | sed -n 's/cosmos_sdk_version: \(.*\)/\1/p') +echo "cosmos_sdk_version: $cosmos_sdk_version" + +if is_greater "$cosmos_sdk_version" "v0.50.0"; then + echo "cosmos_sdk_version is greater than v0.50.0, running create-validator tx with new format" + cosmos-sdk-version-v50 +else + echo "cosmos_sdk_version is less than v0.50.0, running create-validator tx with old format" + cosmos-sdk-version-default +fi diff --git a/examples/cosmos-simapp-multi/configs/local.yaml b/examples/cosmos-simapp-multi/configs/local.yaml index 75720f99..d54c8d96 100644 --- a/examples/cosmos-simapp-multi/configs/local.yaml +++ b/examples/cosmos-simapp-multi/configs/local.yaml @@ -1,16 +1,20 @@ chains: - name: simapp type: simapp - image: ghcr.io/cosmology-tech/starship/simapp:v0.47.3 + image: ghcr.io/cosmos/simapp:latest numValidators: 2 ports: rest: 1317 rpc: 26657 + grpc: 9091 + faucet: 8001 faucet: - image: ghcr.io/cosmology-tech/starship/cosmjs-faucet:v0.31.0-alpha.2 - resources: - cpu: "1" - memory: "2Gi" + # use v0.31.0-alpha.2 cosmjs-faucet for compatibility with simapp v0.47.3 + image: ghcr.io/cosmology-tech/starship/cosmjs-faucet:v0.31.0 + concurrency: 4 + +exposer: + image: ghcr.io/cosmology-tech/starship/exposer:20230808-2333929 registry: enabled: true From 8abf22f5bd64df8a42332b6212b84ee62531aa14 Mon Sep 17 00:00:00 2001 From: Anmol Date: Tue, 8 Aug 2023 20:15:04 +0530 Subject: [PATCH 7/8] fix default chain reading from defaults.yaml file (#166) --- charts/devnet/templates/relayers/go-relayer/statefulset.yaml | 3 ++- charts/devnet/templates/relayers/hermes/statefulset.yaml | 3 ++- charts/devnet/templates/relayers/ts-relayer/statefulset.yaml | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/charts/devnet/templates/relayers/go-relayer/statefulset.yaml b/charts/devnet/templates/relayers/go-relayer/statefulset.yaml index e287c382..b8ff3dc6 100644 --- a/charts/devnet/templates/relayers/go-relayer/statefulset.yaml +++ b/charts/devnet/templates/relayers/go-relayer/statefulset.yaml @@ -61,7 +61,8 @@ spec: {{- range $i, $chain := $relayer.chains }} {{- range $fullchain := $.Values.chains }} {{- if eq $fullchain.name $chain }} - {{ $defaultChain := get $.Values.defaultChains $fullchain.type | default dict }} + {{ $defaultFile := $.Files.Get "defaults.yaml" | fromYaml }} + {{ $defaultChain := get $defaultFile.defaultChains $fullchain.type | default dict }} {{ $fullchain = merge $fullchain $defaultChain }} echo "Adding {{ $fullchain.name }} chain" diff --git a/charts/devnet/templates/relayers/hermes/statefulset.yaml b/charts/devnet/templates/relayers/hermes/statefulset.yaml index 447c1818..9a65c984 100644 --- a/charts/devnet/templates/relayers/hermes/statefulset.yaml +++ b/charts/devnet/templates/relayers/hermes/statefulset.yaml @@ -63,7 +63,8 @@ spec: {{- range $i, $chain := $relayer.chains }} {{- range $fullchain := $.Values.chains }} {{- if eq $fullchain.name $chain }} - {{ $defaultChain := get $.Values.defaultChains $fullchain.type | default dict }} + {{ $defaultFile := $.Files.Get "defaults.yaml" | fromYaml }} + {{ $defaultChain := get $defaultFile.defaultChains $fullchain.type | default dict }} {{ $fullchain = merge $fullchain $defaultChain }} echo "Creating key for {{ $chain }}..." hermes keys add \ diff --git a/charts/devnet/templates/relayers/ts-relayer/statefulset.yaml b/charts/devnet/templates/relayers/ts-relayer/statefulset.yaml index f7aea7d1..49fc1d06 100644 --- a/charts/devnet/templates/relayers/ts-relayer/statefulset.yaml +++ b/charts/devnet/templates/relayers/ts-relayer/statefulset.yaml @@ -70,7 +70,8 @@ spec: {{- range $i, $chain := $relayer.chains }} {{- range $fullchain := $.Values.chains }} {{- if eq $fullchain.name $chain }} - {{ $defaultChain := get $.Values.defaultChains $fullchain.type | default dict }} + {{ $defaultFile := $.Files.Get "defaults.yaml" | fromYaml }} + {{ $defaultChain := get $defaultFile.defaultChains $fullchain.type | default dict }} {{ $fullchain = merge $fullchain $defaultChain }} DENOM="{{ $fullchain.denom }}" RLY_ADDR=$(ibc-setup keys list | grep "{{ $fullchain.name }}" | awk '{print $2}') From 056d0850b10baf5dadec6b45204d1b72441a50e7 Mon Sep 17 00:00:00 2001 From: Anmol1696 Date: Tue, 8 Aug 2023 21:54:33 +0530 Subject: [PATCH 8/8] create 0.1.42 release --- charts/devnet/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/devnet/Chart.yaml b/charts/devnet/Chart.yaml index 13f16053..c82dc118 100644 --- a/charts/devnet/Chart.yaml +++ b/charts/devnet/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.41 +version: 0.1.42 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to