feat: remaining record content types to support #79
@ -27,10 +27,10 @@ message ServiceProviderRecord {
|
|||||||
|
|
||||||
message WebsiteRegistrationRecord {
|
message WebsiteRegistrationRecord {
|
||||||
string url = 1 [(gogoproto.moretags) = "json:\"url\" yaml:\"url\""];
|
string url = 1 [(gogoproto.moretags) = "json:\"url\" yaml:\"url\""];
|
||||||
map<string,string> repo_reference = 2
|
map<string,string> repo_reference = 2
|
||||||
[(gogoproto.moretags) = "json:\"repoReference\" yaml:\"repoReference\""];
|
[(gogoproto.moretags) = "json:\"repoReference\" yaml:\"repoReference\""];
|
||||||
|
|||||||
map<string,string> build_artifact_ref = 3 [(gogoproto.moretags) = "json:\"buildArtifactRef\" yaml:\"buildArtifactRef\""];
|
map<string,string> build_artifact_ref = 3 [(gogoproto.moretags) = "json:\"buildArtifactRef\" yaml:\"buildArtifactRef\""];
|
||||||
map<string,string> tls_cert_ref = 4 [(gogoproto.moretags) = "json:\"tlsCertRef\" yaml:\"tlsCertRef\""];
|
map<string,string> tls_cert_ref = 4 [(gogoproto.moretags) = "json:\"tlsCertRef\" yaml:\"tlsCertRef\""];
|
||||||
string type = 5 [(gogoproto.moretags) = "json:\"type\" yaml:\"type\""];
|
string type = 5 [(gogoproto.moretags) = "json:\"type\" yaml:\"type\""];
|
||||||
string version = 6 [(gogoproto.moretags) = "json:\"version\" yaml:\"version\""];
|
string version = 6 [(gogoproto.moretags) = "json:\"version\" yaml:\"version\""];
|
||||||
}
|
}
|
||||||
@ -44,36 +44,36 @@ message GitRepository{
|
|||||||
}
|
}
|
||||||
|
|
||||||
message Binary{
|
message Binary{
|
||||||
map<string,string> hash_reference=1;
|
map<string,string> hash_reference=1;
|
||||||
string targeted_arch=2;
|
string targeted_arch=2;
|
||||||
string runtime_version=3;
|
string runtime_version=3;
|
||||||
map<string,string> repo_reference=4;
|
map<string,string> repo_reference=4;
|
||||||
string version=5;
|
string version=5;
|
||||||
string type=6;
|
string type=6;
|
||||||
}
|
}
|
||||||
|
|
||||||
message DockerImage{
|
message DockerImage{
|
||||||
string image_id=1;
|
string image_id=1;
|
||||||
map<string,string> binary_reference=2;
|
map<string,string> binary_reference=2;
|
||||||
map<string,string> repo_reference=3;
|
map<string,string> repo_reference=3;
|
||||||
string version=4;
|
string version=4;
|
||||||
string type=5;
|
string type=5;
|
||||||
}
|
}
|
||||||
|
|
||||||
message WatcherRegistrationRecord{
|
message WatcherRegistrationRecord{
|
||||||
WatcherMetadata metadata =1;
|
WatcherMetadata metadata =1;
|
||||||
map<string,string> repo_reference=2;
|
map<string,string> repo_reference=2;
|
||||||
WASMBinary wasm=3;
|
WASMBinary wasm=3;
|
||||||
string version=4;
|
string version=4;
|
||||||
string type=5;
|
string type=5;
|
||||||
|
|
||||||
message WatcherMetadata{
|
message WatcherMetadata{
|
||||||
string version=1;
|
string version=1;
|
||||||
map<string,string> chain_reference=2;
|
map<string,string> chain_reference=2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message WASMBinary{
|
message WASMBinary{
|
||||||
map<string,string> hash_reference=1;
|
map<string,string> hash_reference=1;
|
||||||
WASMBinaryMetadata metadata=2;
|
WASMBinaryMetadata metadata=2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -84,16 +84,16 @@ message WatcherRegistrationRecord{
|
|||||||
}
|
}
|
||||||
|
|
||||||
message ResponderContract{
|
message ResponderContract{
|
||||||
map<string,string> service_provider_ref=1;
|
map<string,string> service_provider_ref=1;
|
||||||
map<string,string> auction_ref=2;
|
map<string,string> auction_ref=2;
|
||||||
map<string,string> watcher_ref=3;
|
map<string,string> watcher_ref=3;
|
||||||
string version=4;
|
string version=4;
|
||||||
string type=5;
|
string type=5;
|
||||||
}
|
}
|
||||||
|
|
||||||
message JSPackage{
|
message JSPackage{
|
||||||
map<string,string> repo_reference=1;
|
map<string,string> repo_reference=1;
|
||||||
map<string,string> js_package_ref=2;
|
map<string,string> js_package_ref=2;
|
||||||
string version=3;
|
string version=3;
|
||||||
string type=4;
|
string type=4;
|
||||||
string name =5;
|
string name =5;
|
||||||
@ -106,5 +106,5 @@ message ChainRegistrationRecord{
|
|||||||
string version=4;
|
string version=4;
|
||||||
string chain_id=5;
|
string chain_id=5;
|
||||||
string network_id=6;
|
string network_id=6;
|
||||||
map<string,string> genesis_hash=7;
|
map<string,string> genesis_hash=7;
|
||||||
}
|
}
|
@ -10,4 +10,4 @@ record:
|
|||||||
chain_id: laconic_9000-1
|
chain_id: laconic_9000-1
|
||||||
network_id: "1392"
|
network_id: "1392"
|
||||||
genesis_hash:
|
genesis_hash:
|
||||||
/: f6fbe71210275adc7c7ef585a72c065cdb85f0c8d13dea0f229fd7c22d445a26
|
/: QmP8jTG1m9GSDJLCbeWhVSVgEzCPPwXRdCRuJtQ5Tz9Kc9
|
@ -110,7 +110,7 @@ func (suite *KeeperTestSuite) TestGrpcGetRecordLists() {
|
|||||||
®istrytypes.QueryListRecordsRequest{
|
®istrytypes.QueryListRecordsRequest{
|
||||||
Attributes: []*registrytypes.QueryListRecordsRequest_KeyValueInput{
|
Attributes: []*registrytypes.QueryListRecordsRequest_KeyValueInput{
|
||||||
{
|
{
|
||||||
Key: "metadata---chain_reference---ref---",
|
Key: "metadata---chain_reference---/---",
|
||||||
Value: ®istrytypes.QueryListRecordsRequest_ValueInput{
|
Value: ®istrytypes.QueryListRecordsRequest_ValueInput{
|
||||||
Type: "string",
|
Type: "string",
|
||||||
String_: "QmP8jTG1m9GSDJLCbeWhVSVgEzCPPwXRdCRuJtQ5Tz9Kc9",
|
String_: "QmP8jTG1m9GSDJLCbeWhVSVgEzCPPwXRdCRuJtQ5Tz9Kc9",
|
||||||
|
@ -241,7 +241,7 @@ func (k Keeper) ProcessSetRecord(ctx sdk.Context, msg types.MsgSetRecord) (*type
|
|||||||
resourceSignBytes, _ := record.GetSignBytes()
|
resourceSignBytes, _ := record.GetSignBytes()
|
||||||
cid, err := record.GetCID()
|
cid, err := record.GetCID()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "Invalid record JSON")
|
return nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, fmt.Sprint("Invalid record JSON, err=", err))
|
||||||
}
|
}
|
||||||
|
|
||||||
record.ID = cid
|
record.ID = cid
|
||||||
|
2642
x/registry/types/attributes.pb.go
generated
2642
x/registry/types/attributes.pb.go
generated
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user
This was underspecified on my part, instead of a
raw_multicodec
field and araw_binary
field, all we need is ahash_reference
field. And this reference will be a CID or multihash which uses the raw mutliformat prefix and references the binary as an IPLD object.Let's rename this to
JSPackage
and add astring name=5;
fieldThis will reference a registered
GitRepository
record by CID/multihashGitRepository
also has arepo_reference
field which will contain a qualitative/non-content-hash-reference e.g. a github or gitea web url.It might be helpful to signal in the naming of the various
reference
fields which references are content-hash => content references vs one's that are not. E.g.hash_reference
vsreference
.Note:
hash_reference
to aGitRepository
IPLD objectNote:
hash_reference
to binary IPLD objectNote:
hash_reference
to aGitRepository
IPLD objectNote:
hash_reference
to aChainRegistrationRecord
IPLD objectNote:
hash_reference
to a WASM IPLD objectNote:
hash_reference
toServiceProviderRecord
IPLD objectNote:
hash_reference
toWatcherRegistrationRecord
IPLD objectNote:
hash_reference
to auction result IPLD objectNote:
hash_reference
toJSPackage
IPLD objectThere is also a npm_package_reference (CID) in this message. Should we go with renaming repo_reference with repo_hash_reference and npm_package_reference with js_package_hash_ref?
We can avoid adding
hash
to the field names and instead we should revert to using a/
sub-mapping to denote CID/link