feat: remaining record content types to support #79

Closed
0xmuralik wants to merge 35 commits from murali/record-attributes into main
9 changed files with 37 additions and 34 deletions
Showing only changes of commit f827ea46b8 - Show all commits

View File

@ -5,6 +5,9 @@ import "gogoproto/gogo.proto";
option go_package = "github.com/cerc-io/laconicd/x/registry/types"; option go_package = "github.com/cerc-io/laconicd/x/registry/types";
message HashReference{
string ref =1;
}
message ServiceProviderRecord { message ServiceProviderRecord {
string bond_id = 1 [(gogoproto.moretags) = "json:\"bondId\" yaml:\"bondId\""]; string bond_id = 1 [(gogoproto.moretags) = "json:\"bondId\" yaml:\"bondId\""];
@ -27,10 +30,10 @@ message ServiceProviderRecord {
message WebsiteRegistrationRecord { message WebsiteRegistrationRecord {
Review

This was underspecified on my part, instead of a raw_multicodec field and a raw_binary field, all we need is a hash_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.

This was underspecified on my part, instead of a `raw_multicodec` field and a `raw_binary` field, all we need is a `hash_reference` field. And this reference will be a CID or multihash which uses the [raw mutliformat prefix](https://github.com/multiformats/multicodec/blob/master/table.csv#L40) and references the binary as an IPLD object.
Review

Let's rename this to JSPackage and add a string name=5; field

Let's rename this to `JSPackage` and add a `string name=5;` field
Review

This will reference a registered GitRepository record by CID/multihash

GitRepository also has a repo_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 vs reference.

This will reference a registered `GitRepository` record by CID/multihash `GitRepository` also has a `repo_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` vs `reference`.
Review

Note: hash_reference to a GitRepository IPLD object

Note: `hash_reference` to a `GitRepository` IPLD object
Review

Note: hash_reference to binary IPLD object

Note: `hash_reference` to binary IPLD object
Review

Note: hash_reference to a GitRepository IPLD object

Note: `hash_reference` to a `GitRepository` IPLD object
Review

Note: hash_reference to a ChainRegistrationRecord IPLD object

Note: `hash_reference` to a `ChainRegistrationRecord` IPLD object
Review

Note: hash_reference to a WASM IPLD object

Note: `hash_reference` to a WASM IPLD object
Review

Note: hash_reference to ServiceProviderRecord IPLD object

Note: `hash_reference` to `ServiceProviderRecord` IPLD object
Review

Note: hash_reference to WatcherRegistrationRecord IPLD object

Note: `hash_reference` to `WatcherRegistrationRecord` IPLD object
Review

Note: hash_reference to auction result IPLD object

Note: `hash_reference` to auction result IPLD object
Review

Note: hash_reference to JSPackage IPLD object

Note: `hash_reference` to `JSPackage` IPLD object
0xmuralik commented 2023-01-17 05:43:47 +00:00 (Migrated from github.com)
Review

There 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?

There 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?
Review

We can avoid adding hash to the field names and instead we should revert to using a / sub-mapping to denote CID/link

We can avoid adding `hash` to the field names and instead we should revert to using a `/` sub-mapping to denote CID/link
string url = 1 [(gogoproto.moretags) = "json:\"url\" yaml:\"url\""]; string url = 1 [(gogoproto.moretags) = "json:\"url\" yaml:\"url\""];
map<string,string> repo_reference = 2 HashReference 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\""]; HashReference build_artifact_ref = 3 [(gogoproto.moretags) = "json:\"buildArtifactRef\" yaml:\"buildArtifactRef\""];
map<string,string> tls_cert_ref = 4 [(gogoproto.moretags) = "json:\"tlsCertRef\" yaml:\"tlsCertRef\""]; HashReference 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 +47,36 @@ message GitRepository{
} }
message Binary{ message Binary{
map<string,string> hash_reference=1; HashReference 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; HashReference 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; HashReference binary_reference=2;
map<string,string> repo_reference=3; HashReference 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; HashReference 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; HashReference chain_reference=2;
} }
message WASMBinary{ message WASMBinary{
map<string,string> hash_reference=1; HashReference hash_reference=1;
WASMBinaryMetadata metadata=2; WASMBinaryMetadata metadata=2;
} }
@ -84,16 +87,16 @@ message WatcherRegistrationRecord{
} }
message ResponderContract{ message ResponderContract{
map<string,string> service_provider_ref=1; HashReference service_provider_ref=1;
map<string,string> auction_ref=2; HashReference auction_ref=2;
map<string,string> watcher_ref=3; HashReference 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; HashReference repo_reference=1;
map<string,string> js_package_ref=2; HashReference js_package_ref=2;
string version=3; string version=3;
string type=4; string type=4;
string name =5; string name =5;
@ -106,5 +109,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; HashReference genesis_hash=7;
} }

View File

@ -1,9 +1,9 @@
record: record:
hash_reference: hash_reference:
/: QmP8jTG1m9GSDJLCbeWhVSVgEzCPPwXRdCRuJtQ5Tz9Kc9 ref: QmP8jTG1m9GSDJLCbeWhVSVgEzCPPwXRdCRuJtQ5Tz9Kc9
targeted_arch: x86_64 targeted_arch: x86_64
runtime_version: go 1.18 runtime_version: go 1.18
repo_reference: repo_reference:
/: QmSnuWmxptJZdLJpKRarxBMS2Ju2oANVrgbr2xWbie9b2D ref: QmSnuWmxptJZdLJpKRarxBMS2Ju2oANVrgbr2xWbie9b2D
version: 1.0.0 version: 1.0.0
type: Binary type: Binary

View File

@ -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 ref: f6fbe71210275adc7c7ef585a72c065cdb85f0c8d13dea0f229fd7c22d445a26

View File

@ -1,8 +1,8 @@
record: record:
image_id: 77af4d6b9913 image_id: 77af4d6b9913
binary_reference: binary_reference:
/: QmP8jTG1m9GSDJLCbeWhVSVgEzCPPwXRdCRuJtQ5Tz9Kc9 ref: QmP8jTG1m9GSDJLCbeWhVSVgEzCPPwXRdCRuJtQ5Tz9Kc9
repo_reference: repo_reference:
/: QmSnuWmxptJZdLJpKRarxBMS2Ju2oANVrgbr2xWbie9b2D ref: QmSnuWmxptJZdLJpKRarxBMS2Ju2oANVrgbr2xWbie9b2D
version: 1.0.0 version: 1.0.0
type: DockerImage type: DockerImage

View File

@ -2,6 +2,6 @@ record:
attr1: value1 attr1: value1
attr2: value2 attr2: value2
link1: link1:
/: QmSnuWmxptJZdLJpKRarxBMS2Ju2oANVrgbr2xWbie9b2D ref: QmSnuWmxptJZdLJpKRarxBMS2Ju2oANVrgbr2xWbie9b2D
link2: link2:
/: QmP8jTG1m9GSDJLCbeWhVSVgEzCPPwXRdCRuJtQ5Tz9Kc9 ref: QmP8jTG1m9GSDJLCbeWhVSVgEzCPPwXRdCRuJtQ5Tz9Kc9

View File

@ -1,8 +1,8 @@
record: record:
repo_reference: repo_reference:
/: QmP8jTG1m9GSDJLCbeWhVSVgEzCPPwXRdCRuJtQ5Tz9Kc9 ref: QmP8jTG1m9GSDJLCbeWhVSVgEzCPPwXRdCRuJtQ5Tz9Kc9
js_package_ref: js_package_ref:
/: QmSnuWmxptJZdLJpKRarxBMS2Ju2oANVrgbr2xWbie9b2D ref: QmSnuWmxptJZdLJpKRarxBMS2Ju2oANVrgbr2xWbie9b2D
version: 1.0.0 version: 1.0.0
type: JSPackage type: JSPackage
name: test-JSPackage name: test-JSPackage

View File

@ -1,9 +1,9 @@
record: record:
service_provider_ref: service_provider_ref:
/: QmP8jTG1m9GSDJLCbeWhVSVgEzCPPwXRdCRuJtQ5Tz9Kc9 ref: QmP8jTG1m9GSDJLCbeWhVSVgEzCPPwXRdCRuJtQ5Tz9Kc9
auction_ref: auction_ref:
/: QmSnuWmxptJZdLJpKRarxBMS2Ju2oANVrgbr2xWbie9b2D ref: QmSnuWmxptJZdLJpKRarxBMS2Ju2oANVrgbr2xWbie9b2D
watcher_ref: watcher_ref:
/: QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR ref: QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR
version: 1.0.0 version: 1.0.0
type: ResponderContract type: ResponderContract

View File

@ -2,12 +2,12 @@ record:
metadata: metadata:
version: 0.32.0 version: 0.32.0
chain_reference: chain_reference:
/: QmP8jTG1m9GSDJLCbeWhVSVgEzCPPwXRdCRuJtQ5Tz9Kc9 ref: QmP8jTG1m9GSDJLCbeWhVSVgEzCPPwXRdCRuJtQ5Tz9Kc9
repo_reference: repo_reference:
/: QmSnuWmxptJZdLJpKRarxBMS2Ju2oANVrgbr2xWbie9b2D ref: QmSnuWmxptJZdLJpKRarxBMS2Ju2oANVrgbr2xWbie9b2D
wasm: wasm:
hash_reference: hash_reference:
/: QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR ref: QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR
metadata: metadata:
compiler_version: 1.15.0 compiler_version: 1.15.0
execution_engine_version: 0.16.1 execution_engine_version: 0.16.1

View File

@ -2,9 +2,9 @@ record:
type: WebsiteRegistrationRecord type: WebsiteRegistrationRecord
url: https://cerc.io url: https://cerc.io
repo_reference: repo_reference:
/: QmSnuWmxptJZdLJpKRarxBMS2Ju2oANVrgbr2xWbie9b2D ref: QmSnuWmxptJZdLJpKRarxBMS2Ju2oANVrgbr2xWbie9b2D
build_artifact_ref: build_artifact_ref:
/: QmP8jTG1m9GSDJLCbeWhVSVgEzCPPwXRdCRuJtQ5Tz9Kc9 ref: QmP8jTG1m9GSDJLCbeWhVSVgEzCPPwXRdCRuJtQ5Tz9Kc9
tls_cert_ref: tls_cert_ref:
/: QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR ref: QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR
version: 1.0.0 version: 1.0.0