Skip to content
This repository has been archived by the owner on Oct 24, 2024. It is now read-only.

Feat/add text record #114

Merged
merged 6 commits into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 72 additions & 10 deletions docs/static/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51019,7 +51019,7 @@ paths:
title: 'Rule: CHAINNAME_ENVIRONMENT_NETWORK'
value:
type: string
metadata:
textRecord:
type: object
properties:
key:
Expand Down Expand Up @@ -51153,6 +51153,56 @@ paths:
additionalProperties: {}
tags:
- Query
/mycel-domain/mycel/resolver/text_record/{domainName}/{domainParent}/{key}:
get:
summary: Queries a list of TextRecord items.
operationId: MycelResolverTextRecord
responses:
'200':
description: A successful response.
schema:
type: object
properties:
value:
type: object
properties:
key:
type: string
value:
type: string
default:
description: An unexpected error response.
schema:
type: object
properties:
code:
type: integer
format: int32
message:
type: string
details:
type: array
items:
type: object
properties:
'@type':
type: string
additionalProperties: {}
parameters:
- name: domainName
in: path
required: true
type: string
- name: domainParent
in: path
required: true
type: string
- name: key
in: path
required: true
type: string
tags:
- Query
/mycel-domain/mycel/resolver/wallet_record/{domainName}/{domainParent}/{walletRecordType}:
get:
summary: Queries a list of QueryWalletRecord items.
Expand Down Expand Up @@ -81661,6 +81711,8 @@ definitions:
signatures required by gogoproto.
mycel.registry.MsgUpdateDnsRecordResponse:
type: object
mycel.registry.MsgUpdateTextRecordResponse:
type: object
mycel.registry.MsgUpdateWalletRecordResponse:
type: object
mycel.registry.MsgWithdrawRegistrationFeeResponse:
Expand Down Expand Up @@ -82506,13 +82558,6 @@ definitions:
- SRV
- TXT
default: NO_RECORD_TYPE
mycel.registry.Metadata:
type: object
properties:
key:
type: string
value:
type: string
mycel.registry.NetworkName:
type: string
enum:
Expand Down Expand Up @@ -82640,13 +82685,20 @@ definitions:
title: 'Rule: CHAINNAME_ENVIRONMENT_NETWORK'
value:
type: string
metadata:
textRecord:
type: object
properties:
key:
type: string
value:
type: string
mycel.registry.TextRecord:
type: object
properties:
key:
type: string
value:
type: string
mycel.registry.WalletRecord:
type: object
properties:
Expand Down Expand Up @@ -82787,7 +82839,7 @@ definitions:
title: 'Rule: CHAINNAME_ENVIRONMENT_NETWORK'
value:
type: string
metadata:
textRecord:
type: object
properties:
key:
Expand Down Expand Up @@ -82823,6 +82875,16 @@ definitions:
description: params holds all the parameters of this module.
type: object
description: QueryParamsResponse is response type for the Query/Params RPC method.
mycel.resolver.QueryTextRecordResponse:
type: object
properties:
value:
type: object
properties:
key:
type: string
value:
type: string
mycel.resolver.QueryWalletRecordResponse:
type: object
properties:
Expand Down
4 changes: 2 additions & 2 deletions proto/mycel/registry/second_level_domain.proto
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ message WalletRecord {
string value = 2;
}

message Metadata {
message TextRecord {
string key = 1;
string value = 2;
}
Expand All @@ -28,7 +28,7 @@ message Record {
oneof record {
DnsRecord dnsRecord = 1;
WalletRecord walletRecord = 2;
Metadata metadata = 3;
TextRecord textRecord = 3;
}
}

Expand Down
70 changes: 40 additions & 30 deletions proto/mycel/registry/tx.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
syntax = "proto3";

package mycel.registry;

import "cosmos/base/v1beta1/coin.proto";
Expand All @@ -9,72 +10,81 @@ option go_package = "github.com/mycel-domain/mycel/x/registry/types";

// Msg defines the Msg service.
service Msg {
rpc UpdateWalletRecord(MsgUpdateWalletRecord) returns (MsgUpdateWalletRecordResponse);
rpc UpdateDnsRecord(MsgUpdateDnsRecord) returns (MsgUpdateDnsRecordResponse);
rpc RegisterSecondLevelDomain(MsgRegisterSecondLevelDomain) returns (MsgRegisterSecondLevelDomainResponse);
rpc RegisterTopLevelDomain(MsgRegisterTopLevelDomain) returns (MsgRegisterTopLevelDomainResponse);
rpc WithdrawRegistrationFee(MsgWithdrawRegistrationFee) returns (MsgWithdrawRegistrationFeeResponse);
rpc ExtendTopLevelDomainExpirationDate(MsgExtendTopLevelDomainExpirationDate) returns (MsgExtendTopLevelDomainExpirationDateResponse);
rpc UpdateWalletRecord (MsgUpdateWalletRecord ) returns (MsgUpdateWalletRecordResponse );
rpc UpdateDnsRecord (MsgUpdateDnsRecord ) returns (MsgUpdateDnsRecordResponse );
rpc RegisterSecondLevelDomain (MsgRegisterSecondLevelDomain ) returns (MsgRegisterSecondLevelDomainResponse );
rpc RegisterTopLevelDomain (MsgRegisterTopLevelDomain ) returns (MsgRegisterTopLevelDomainResponse );
rpc WithdrawRegistrationFee (MsgWithdrawRegistrationFee ) returns (MsgWithdrawRegistrationFeeResponse );
rpc ExtendTopLevelDomainExpirationDate (MsgExtendTopLevelDomainExpirationDate) returns (MsgExtendTopLevelDomainExpirationDateResponse);
rpc UpdateTextRecord (MsgUpdateTextRecord ) returns (MsgUpdateTextRecordResponse );
}
message MsgUpdateWalletRecord {
string creator = 1;
string name = 2;
string parent = 3;
string creator = 1;
string name = 2;
string parent = 3;
string walletRecordType = 4;
string value = 5;
string value = 5;
}

message MsgUpdateWalletRecordResponse {}

message MsgUpdateDnsRecord {
string creator = 1;
string name = 2;
string parent = 3;
string creator = 1;
string name = 2;
string parent = 3;
string dnsRecordType = 4;
string value = 5;
string value = 5;
}

message MsgUpdateDnsRecordResponse {}

message MsgRegisterSecondLevelDomain {
string creator = 1;
string name = 2;
string parent = 3;
string creator = 1;
string name = 2;
string parent = 3;
uint64 registrationPeriodInYear = 4;
}

message MsgRegisterSecondLevelDomainResponse {}

message MsgRegisterTopLevelDomain {
string creator = 1;
string name = 2;
string creator = 1;
string name = 2;
uint64 registrationPeriodInYear = 3;
}

message MsgRegisterTopLevelDomainResponse {
TopLevelDomain topLevelDomain = 1;
TopLevelDomainFee fee = 2;
TopLevelDomain topLevelDomain = 1;
TopLevelDomainFee fee = 2;
}

message MsgWithdrawRegistrationFee {
string creator = 1;
string name = 2;
string name = 2;
}

message MsgWithdrawRegistrationFeeResponse {
repeated cosmos.base.v1beta1.Coin registrationFee = 7 [
(gogoproto.nullable) = false,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
];
repeated cosmos.base.v1beta1.Coin registrationFee = 7 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
}

message MsgExtendTopLevelDomainExpirationDate {
string creator = 1;
string name = 2;
string creator = 1;
string name = 2;
uint64 extensionPeriodInYear = 3;
}

message MsgExtendTopLevelDomainExpirationDateResponse {
TopLevelDomain topLevelDomain = 1;
TopLevelDomainFee fee = 2;
TopLevelDomain topLevelDomain = 1;
TopLevelDomainFee fee = 2;
}

message MsgUpdateTextRecord {
string creator = 1;
string name = 2;
string parent = 3;
string key = 4;
string value = 5;
}

message MsgUpdateTextRecordResponse {}

50 changes: 36 additions & 14 deletions proto/mycel/resolver/query.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
syntax = "proto3";

package mycel.resolver;

import "cosmos/base/query/v1beta1/pagination.proto";
Expand All @@ -11,39 +12,50 @@ option go_package = "github.com/mycel-domain/mycel/x/resolver/types";

// Query defines the gRPC querier service.
service Query {

// Parameters queries the parameters of the module.
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
rpc Params (QueryParamsRequest) returns (QueryParamsResponse) {
option (google.api.http).get = "/mycel-domain/mycel/resolver/params";

}

// Queries a list of QueryWalletRecord items.
rpc WalletRecord(QueryWalletRecordRequest) returns (QueryWalletRecordResponse) {
rpc WalletRecord (QueryWalletRecordRequest) returns (QueryWalletRecordResponse) {
option (google.api.http).get = "/mycel-domain/mycel/resolver/wallet_record/{domainName}/{domainParent}/{walletRecordType}";

}

// Queries a list of DnsRecord items.
rpc DnsRecord(QueryDnsRecordRequest) returns (QueryDnsRecordResponse) {
rpc DnsRecord (QueryDnsRecordRequest) returns (QueryDnsRecordResponse) {
option (google.api.http).get = "/mycel-domain/mycel/resolver/dns_record/{domainName}/{domainParent}/{dnsRecordType}";

}

// Queries a list of AllRecord items.
rpc AllRecords(QueryAllRecordsRequest) returns (QueryAllRecordsResponse) {
rpc AllRecords (QueryAllRecordsRequest) returns (QueryAllRecordsResponse) {
option (google.api.http).get = "/mycel-domain/mycel/resolver/all_records/{domainName}/{domainParent}";

}

// Queries a list of TextRecord items.
rpc TextRecord (QueryTextRecordRequest) returns (QueryTextRecordResponse) {
option (google.api.http).get = "/mycel-domain/mycel/resolver/text_record/{domainName}/{domainParent}/{key}";

}
}

// QueryParamsRequest is request type for the Query/Params RPC method.
message QueryParamsRequest {}

// QueryParamsResponse is response type for the Query/Params RPC method.
message QueryParamsResponse {

// params holds all the parameters of this module.
Params params = 1 [(gogoproto.nullable) = false];
}

message QueryWalletRecordRequest {
string domainName = 1;
string domainParent = 2;
string domainName = 1;
string domainParent = 2;
string walletRecordType = 3;
}

Expand All @@ -52,8 +64,8 @@ message QueryWalletRecordResponse {
}

message QueryDnsRecordRequest {
string domainName = 1;
string domainParent = 2;
string domainName = 1;
string domainParent = 2;
string dnsRecordType = 3;
}

Expand All @@ -62,10 +74,20 @@ message QueryDnsRecordResponse {
}

message QueryAllRecordsRequest {
string domainName = 1;
string domainName = 1;
string domainParent = 2;
}

message QueryAllRecordsResponse {
map<string, mycel.registry.Record> values = 1;
map <string,mycel.registry.Record> values = 1;
}

message QueryTextRecordRequest {
string domainName = 1;
string domainParent = 2;
string key = 3;
}

message QueryTextRecordResponse {
mycel.registry.TextRecord value = 1;
}
1 change: 1 addition & 0 deletions x/registry/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ func GetTxCmd() *cobra.Command {
cmd.AddCommand(CmdRegisterTopLevelDomain())
cmd.AddCommand(CmdWithdrawRegistrationFee())
cmd.AddCommand(CmdExtendTopLevelDomainExpirationDate())
cmd.AddCommand(CmdUpdateTextRecord())
// this line is used by starport scaffolding # 1

return cmd
Expand Down
Loading
Loading