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

Commit

Permalink
Merge pull request #117 from mycel-domain/feat/foxy-tld-registration-…
Browse files Browse the repository at this point in the history
…control

Add TLD registration control
  • Loading branch information
foxytanuki authored Dec 26, 2023
2 parents 6607248 + 12ed63e commit 9043572
Show file tree
Hide file tree
Showing 31 changed files with 1,387 additions and 235 deletions.
50 changes: 50 additions & 0 deletions docs/static/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50443,6 +50443,12 @@ paths:
custom method

signatures required by gogoproto.
registrationPolicy:
type: string
enum:
- PRIVATE
- PUBLIC
default: PRIVATE
pagination:
type: object
properties:
Expand Down Expand Up @@ -50687,6 +50693,12 @@ paths:
custom method

signatures required by gogoproto.
registrationPolicy:
type: string
enum:
- PRIVATE
- PUBLIC
default: PRIVATE
default:
description: An unexpected error response.
schema:
Expand Down Expand Up @@ -81472,6 +81484,12 @@ definitions:
method

signatures required by gogoproto.
registrationPolicy:
type: string
enum:
- PRIVATE
- PUBLIC
default: PRIVATE
fee:
type: object
properties:
Expand Down Expand Up @@ -81657,6 +81675,12 @@ definitions:
method

signatures required by gogoproto.
registrationPolicy:
type: string
enum:
- PRIVATE
- PUBLIC
default: PRIVATE
fee:
type: object
properties:
Expand Down Expand Up @@ -81713,6 +81737,8 @@ definitions:
type: object
mycel.registry.MsgUpdateTextRecordResponse:
type: object
mycel.registry.MsgUpdateTopLevelDomainRegistrationPolicyResponse:
type: object
mycel.registry.MsgUpdateWalletRecordResponse:
type: object
mycel.registry.MsgWithdrawRegistrationFeeResponse:
Expand Down Expand Up @@ -81968,6 +81994,12 @@ definitions:
method

signatures required by gogoproto.
registrationPolicy:
type: string
enum:
- PRIVATE
- PUBLIC
default: PRIVATE
pagination:
type: object
properties:
Expand Down Expand Up @@ -82182,6 +82214,12 @@ definitions:
method

signatures required by gogoproto.
registrationPolicy:
type: string
enum:
- PRIVATE
- PUBLIC
default: PRIVATE
mycel.registry.QueryParamsResponse:
type: object
properties:
Expand All @@ -82201,6 +82239,12 @@ definitions:
properties:
role:
type: string
mycel.registry.RegistrationPolicyType:
type: string
enum:
- PRIVATE
- PUBLIC
default: PRIVATE
mycel.registry.SecondLevelDomainResponse:
type: object
properties:
Expand Down Expand Up @@ -82482,6 +82526,12 @@ definitions:

NOTE: The amount field is an Int which implements the custom method
signatures required by gogoproto.
registrationPolicy:
type: string
enum:
- PRIVATE
- PUBLIC
default: PRIVATE
mycel.registry.TopLevelDomainFee:
type: object
properties:
Expand Down
133 changes: 69 additions & 64 deletions proto/mycel/registry/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -16,143 +16,148 @@ option go_package = "github.com/mycel-domain/mycel/x/registry/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/registry/params";

}

// Queries a list of TopLevelDomain items.
rpc TopLevelDomain (QueryGetTopLevelDomainRequest) returns (QueryGetTopLevelDomainResponse) {
option (google.api.http).get = "/mycel-domain/mycel/registry/top_level_domain/{name}";

rpc TopLevelDomain(QueryGetTopLevelDomainRequest)
returns (QueryGetTopLevelDomainResponse) {
option (google.api.http).get =
"/mycel-domain/mycel/registry/top_level_domain/{name}";
}
rpc TopLevelDomainAll (QueryAllTopLevelDomainRequest) returns (QueryAllTopLevelDomainResponse) {
option (google.api.http).get = "/mycel-domain/mycel/registry/top_level_domain";

rpc TopLevelDomainAll(QueryAllTopLevelDomainRequest)
returns (QueryAllTopLevelDomainResponse) {
option (google.api.http).get =
"/mycel-domain/mycel/registry/top_level_domain";
}

// Queries a list of SecondLevelDomain items.
rpc SecondLevelDomain (QueryGetSecondLevelDomainRequest) returns (QueryGetSecondLevelDomainResponse) {
option (google.api.http).get = "/mycel/registry/second_level_domain/{name}/{parent}";

rpc SecondLevelDomain(QueryGetSecondLevelDomainRequest)
returns (QueryGetSecondLevelDomainResponse) {
option (google.api.http).get =
"/mycel/registry/second_level_domain/{name}/{parent}";
}
rpc SecondLevelDomainAll (QueryAllSecondLevelDomainRequest) returns (QueryAllSecondLevelDomainResponse) {
rpc SecondLevelDomainAll(QueryAllSecondLevelDomainRequest)
returns (QueryAllSecondLevelDomainResponse) {
option (google.api.http).get = "/mycel/registry/second_level_domain";

}

// Queries a list of DomainOwnership items.
rpc DomainOwnership (QueryGetDomainOwnershipRequest) returns (QueryGetDomainOwnershipResponse) {
option (google.api.http).get = "/mycel-domain/mycel/registry/domain_ownership/{owner}";

rpc DomainOwnership(QueryGetDomainOwnershipRequest)
returns (QueryGetDomainOwnershipResponse) {
option (google.api.http).get =
"/mycel-domain/mycel/registry/domain_ownership/{owner}";
}
rpc DomainOwnershipAll (QueryAllDomainOwnershipRequest) returns (QueryAllDomainOwnershipResponse) {
option (google.api.http).get = "/mycel-domain/mycel/registry/domain_ownership";

rpc DomainOwnershipAll(QueryAllDomainOwnershipRequest)
returns (QueryAllDomainOwnershipResponse) {
option (google.api.http).get =
"/mycel-domain/mycel/registry/domain_ownership";
}

// Queries a list of DomainRegistrationFee items.
rpc DomainRegistrationFee (QueryDomainRegistrationFeeRequest) returns (QueryDomainRegistrationFeeResponse) {
option (google.api.http).get = "/mycel-domain/mycel/registry/domain_registration_fee/{name}/{parent}";

rpc DomainRegistrationFee(QueryDomainRegistrationFeeRequest)
returns (QueryDomainRegistrationFeeResponse) {
option (google.api.http).get =
"/mycel-domain/mycel/registry/domain_registration_fee/{name}/{parent}/{registerer}";
}

// Queries a list of Role items.
rpc Role (QueryRoleRequest) returns (QueryRoleResponse) {
option (google.api.http).get = "/mycel-domain/mycel/registry/role/{domainName}/{address}";

rpc Role(QueryRoleRequest) returns (QueryRoleResponse) {
option (google.api.http).get =
"/mycel-domain/mycel/registry/role/{domainName}/{address}";
}
}
// 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];
Params params = 1 [ (gogoproto.nullable) = false ];
}

message QueryGetTopLevelDomainRequest {
string name = 1;
}
message QueryGetTopLevelDomainRequest { string name = 1; }

message QueryGetTopLevelDomainResponse {
TopLevelDomain topLevelDomain = 1 [(gogoproto.nullable) = false];
TopLevelDomain topLevelDomain = 1 [ (gogoproto.nullable) = false ];
}

message QueryAllTopLevelDomainRequest {
cosmos.base.query.v1beta1.PageRequest pagination = 1;
}

message QueryAllTopLevelDomainResponse {
repeated TopLevelDomain topLevelDomain = 1 [(gogoproto.nullable) = false];
cosmos.base.query.v1beta1.PageResponse pagination = 2;
repeated TopLevelDomain topLevelDomain = 1 [ (gogoproto.nullable) = false ];
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}

message QueryGetSecondLevelDomainRequest {
string name = 1;
string name = 1;
string parent = 2;
}

message SecondLevelDomainResponse {
string name = 1;
string parent = 2;
google.protobuf.Timestamp expirationDate = 3 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
string name = 1;
string parent = 2;
google.protobuf.Timestamp expirationDate = 3
[ (gogoproto.stdtime) = true, (gogoproto.nullable) = false ];
}

message QueryGetSecondLevelDomainResponse {
SecondLevelDomainResponse secondLevelDomain = 1 [(gogoproto.nullable) = false];
SecondLevelDomainResponse secondLevelDomain = 1
[ (gogoproto.nullable) = false ];
}

message QueryAllSecondLevelDomainRequest {
cosmos.base.query.v1beta1.PageRequest pagination = 1;
}

message QueryAllSecondLevelDomainResponse {
repeated SecondLevelDomainResponse secondLevelDomain = 1 [(gogoproto.nullable) = false];
cosmos.base.query.v1beta1.PageResponse pagination = 2;
repeated SecondLevelDomainResponse secondLevelDomain = 1
[ (gogoproto.nullable) = false ];
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}

message QueryGetDomainOwnershipRequest {
string owner = 1;
}
message QueryGetDomainOwnershipRequest { string owner = 1; }

message QueryGetDomainOwnershipResponse {
DomainOwnership domainOwnership = 1 [(gogoproto.nullable) = false];
DomainOwnership domainOwnership = 1 [ (gogoproto.nullable) = false ];
}

message QueryAllDomainOwnershipRequest {
cosmos.base.query.v1beta1.PageRequest pagination = 1;
}

message QueryAllDomainOwnershipResponse {
repeated DomainOwnership domainOwnership = 1 [(gogoproto.nullable) = false];
cosmos.base.query.v1beta1.PageResponse pagination = 2;
repeated DomainOwnership domainOwnership = 1 [ (gogoproto.nullable) = false ];
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}

message QueryDomainRegistrationFeeRequest {
string name = 1;
string parent = 2;
string name = 1;
string parent = 2;
uint64 registrationPeriodInYear = 3;
string registerer = 4;
}

message QueryDomainRegistrationFeeResponse {
bool isRegistrable = 1;
repeated cosmos.base.v1beta1.Coin fee = 2 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
uint64 registrationPeriodInYear = 3;
uint64 maxSubDomainRegistrations = 4;
string errorMessage = 5;
bool isRegistrable = 1;
repeated cosmos.base.v1beta1.Coin fee = 2 [
(gogoproto.nullable) = false,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
];
uint64 registrationPeriodInYear = 3;
uint64 maxSubDomainRegistrations = 4;
string errorMessage = 5;
}

message QueryRoleRequest {
string domainName = 1;
string address = 2;
}

message QueryRoleResponse {
string role = 1;
string address = 2;
}

message QueryRoleResponse { string role = 1; }
6 changes: 6 additions & 0 deletions proto/mycel/registry/subdomain_config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ import "mycel/registry/access_control.proto";

option go_package = "github.com/mycel-domain/mycel/x/registry/types";

enum RegistrationPolicyType {
PRIVATE = 0;
PUBLIC = 1;
}

message SubdomainRegistrationFees {
repeated FeeByLength feeByLength = 1;
repeated FeeByName feeByName = 2;
Expand All @@ -30,4 +35,5 @@ message SubdomainConfig {
bool isRegistrable = 3;
DomainRole registrableRole = 4;
bool customExpirationDate = 5;
RegistrationPolicyType registrationPolicy = 6;
}
6 changes: 2 additions & 4 deletions proto/mycel/registry/top_level_domain.proto
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ option go_package = "github.com/mycel-domain/mycel/x/registry/types";

message TopLevelDomain {
string name = 1;
google.protobuf.Timestamp expirationDate = 2 [
(gogoproto.stdtime) = true,
(gogoproto.nullable) = false
];
google.protobuf.Timestamp expirationDate = 2
[ (gogoproto.stdtime) = true, (gogoproto.nullable) = false ];
SubdomainConfig subdomainConfig = 3;
uint64 subdomainCount = 4;
repeated AccessControl accessControl = 5;
Expand Down
23 changes: 16 additions & 7 deletions proto/mycel/registry/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ 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 UpdateTextRecord (MsgUpdateTextRecord ) returns (MsgUpdateTextRecordResponse );
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 );
rpc UpdateTopLevelDomainRegistrationPolicy (MsgUpdateTopLevelDomainRegistrationPolicy) returns (MsgUpdateTopLevelDomainRegistrationPolicyResponse);
}
message MsgUpdateWalletRecord {
string creator = 1;
Expand Down Expand Up @@ -88,3 +89,11 @@ message MsgUpdateTextRecord {

message MsgUpdateTextRecordResponse {}

message MsgUpdateTopLevelDomainRegistrationPolicy {
string creator = 1;
string name = 2;
string registrationPolicy = 3;
}

message MsgUpdateTopLevelDomainRegistrationPolicyResponse {}

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(CmdWithdrawRegistrationFee())
cmd.AddCommand(CmdExtendTopLevelDomainExpirationDate())
cmd.AddCommand(CmdUpdateTextRecord())
cmd.AddCommand(CmdUpdateTopLevelDomainRegistrationPolicy())
// this line is used by starport scaffolding # 1

return cmd
Expand Down
Loading

0 comments on commit 9043572

Please sign in to comment.