From e478d1228b3198d6682224b3273ff72db7b3befe Mon Sep 17 00:00:00 2001 From: ryanchristo <12519942+ryanchristo@users.noreply.github.com> Date: Tue, 29 Mar 2022 07:30:37 -0700 Subject: [PATCH] proto format --- proto/regen/data/v1/types.proto | 199 ++++++++++++++++---------------- 1 file changed, 102 insertions(+), 97 deletions(-) diff --git a/proto/regen/data/v1/types.proto b/proto/regen/data/v1/types.proto index f116a92a81..ec989a62fa 100644 --- a/proto/regen/data/v1/types.proto +++ b/proto/regen/data/v1/types.proto @@ -8,137 +8,142 @@ option go_package = "github.com/regen-network/regen-ledger/x/data"; // ContentHash specifies a hash-based content identifier for a piece of data. message ContentHash { - // Raw specifies "raw" data which does not specify a deterministic, canonical encoding. - // Users of these hashes MUST maintain a copy of the hashed data which is preserved bit by bit. - // All other content encodings specify a deterministic, canonical encoding allowing implementations to - // choose from a variety of alternative formats for transport and encoding while maintaining the guarantee - // that the canonical hash will not change. The media type for "raw" data is defined by the MediaType enum. - Raw raw = 1; - - // Graph specifies graph data that conforms to the RDF data model. - // The canonicalization algorithm used for an RDF graph is specified by GraphCanonicalizationAlgorithm. - Graph graph = 2; - - // Raw is the content hash type used for raw data. - message Raw { - // hash represents the hash of the data based on the specified digest_algorithm. - bytes hash = 1; - - // digest_algorithm represents the hash digest algorithm. - DigestAlgorithm digest_algorithm = 2; - - // media_type represents the media type for raw data. - RawMediaType media_type = 3; - - } - - // Graph is the content hash type used for RDF graph data. - message Graph { - // hash represents the hash of the data based on the specified digest_algorithm. - bytes hash = 1; - - // digest_algorithm represents the hash digest algorithm. - DigestAlgorithm digest_algorithm = 2; - - // graph_canonicalization_algorithm represents the RDF graph canonicalization algorithm. - GraphCanonicalizationAlgorithm canonicalization_algorithm = 3; - - // merkle_tree is the merkle tree type used for the graph hash, if any. - GraphMerkleTree merkle_tree = 4; - } + // Raw specifies "raw" data which does not specify a deterministic, canonical + // encoding. Users of these hashes MUST maintain a copy of the hashed data + // which is preserved bit by bit. All other content encodings specify a + // deterministic, canonical encoding allowing implementations to choose from a + // variety of alternative formats for transport and encoding while maintaining + // the guarantee that the canonical hash will not change. The media type for + // "raw" data is defined by the MediaType enum. + Raw raw = 1; + + // Graph specifies graph data that conforms to the RDF data model. + // The canonicalization algorithm used for an RDF graph is specified by + // GraphCanonicalizationAlgorithm. + Graph graph = 2; + + // Raw is the content hash type used for raw data. + message Raw { + // hash represents the hash of the data based on the specified + // digest_algorithm. + bytes hash = 1; + + // digest_algorithm represents the hash digest algorithm. + DigestAlgorithm digest_algorithm = 2; + + // media_type represents the media type for raw data. + RawMediaType media_type = 3; + } + + // Graph is the content hash type used for RDF graph data. + message Graph { + // hash represents the hash of the data based on the specified + // digest_algorithm. + bytes hash = 1; + + // digest_algorithm represents the hash digest algorithm. + DigestAlgorithm digest_algorithm = 2; + + // graph_canonicalization_algorithm represents the RDF graph + // canonicalization algorithm. + GraphCanonicalizationAlgorithm canonicalization_algorithm = 3; + + // merkle_tree is the merkle tree type used for the graph hash, if any. + GraphMerkleTree merkle_tree = 4; + } } // DigestAlgorithm is the hash digest algorithm enum DigestAlgorithm { - // unspecified and invalid - DIGEST_ALGORITHM_UNSPECIFIED = 0; + // unspecified and invalid + DIGEST_ALGORITHM_UNSPECIFIED = 0; - // BLAKE2b-256 - DIGEST_ALGORITHM_BLAKE2B_256 = 1; + // BLAKE2b-256 + DIGEST_ALGORITHM_BLAKE2B_256 = 1; } // RawMediaType defines MIME media types to be used with a ContentHash.Raw hash. enum RawMediaType { - // RAW_MEDIA_TYPE_UNSPECIFIED can be used for raw binary data - RAW_MEDIA_TYPE_UNSPECIFIED = 0; + // RAW_MEDIA_TYPE_UNSPECIFIED can be used for raw binary data + RAW_MEDIA_TYPE_UNSPECIFIED = 0; - // basic formats + // basic formats - // plain text - RAW_MEDIA_TYPE_TEXT_PLAIN = 1; + // plain text + RAW_MEDIA_TYPE_TEXT_PLAIN = 1; - // JSON - RAW_MEDIA_TYPE_JSON = 2; + // JSON + RAW_MEDIA_TYPE_JSON = 2; - // CSV - RAW_MEDIA_TYPE_CSV = 3; + // CSV + RAW_MEDIA_TYPE_CSV = 3; - // XML - RAW_MEDIA_TYPE_XML = 4; + // XML + RAW_MEDIA_TYPE_XML = 4; - // PDF - RAW_MEDIA_TYPE_PDF = 5; + // PDF + RAW_MEDIA_TYPE_PDF = 5; - // images + // images - // TIIF - RAW_MEDIA_TYPE_TIFF = 16; + // TIIF + RAW_MEDIA_TYPE_TIFF = 16; - // JPG - RAW_MEDIA_TYPE_JPG = 17; + // JPG + RAW_MEDIA_TYPE_JPG = 17; - // PNG - RAW_MEDIA_TYPE_PNG = 18; + // PNG + RAW_MEDIA_TYPE_PNG = 18; - // SVG - RAW_MEDIA_TYPE_SVG = 19; + // SVG + RAW_MEDIA_TYPE_SVG = 19; - // WEBP - RAW_MEDIA_TYPE_WEBP = 20; + // WEBP + RAW_MEDIA_TYPE_WEBP = 20; - // AVIF - RAW_MEDIA_TYPE_AVIF = 21; + // AVIF + RAW_MEDIA_TYPE_AVIF = 21; - // GIF - RAW_MEDIA_TYPE_GIF = 22; + // GIF + RAW_MEDIA_TYPE_GIF = 22; - // APNG - RAW_MEDIA_TYPE_APNG = 23; + // APNG + RAW_MEDIA_TYPE_APNG = 23; - // audio-visual media containers + // audio-visual media containers - // MPEG - RAW_MEDIA_TYPE_MPEG = 32; + // MPEG + RAW_MEDIA_TYPE_MPEG = 32; - // MP4 - RAW_MEDIA_TYPE_MP4 = 33; + // MP4 + RAW_MEDIA_TYPE_MP4 = 33; - // WEBM - RAW_MEDIA_TYPE_WEBM = 34; + // WEBM + RAW_MEDIA_TYPE_WEBM = 34; - // OGG - RAW_MEDIA_TYPE_OGG = 35; + // OGG + RAW_MEDIA_TYPE_OGG = 35; - // geospatial raster formats - // TODO + // geospatial raster formats + // TODO - // geospatial vector formats - // TODO + // geospatial vector formats + // TODO } // GraphCanonicalizationAlgorithm is the graph canonicalization algorithm enum GraphCanonicalizationAlgorithm { - // unspecified and invalid - GRAPH_CANONICALIZATION_ALGORITHM_UNSPECIFIED = 0; + // unspecified and invalid + GRAPH_CANONICALIZATION_ALGORITHM_UNSPECIFIED = 0; - // URDNA2015 graph hashing - GRAPH_CANONICALIZATION_ALGORITHM_URDNA2015 = 1; + // URDNA2015 graph hashing + GRAPH_CANONICALIZATION_ALGORITHM_URDNA2015 = 1; } // GraphMerkleTree is the graph merkle tree type used for hashing, if any enum GraphMerkleTree { - // no merkle tree - GRAPH_MERKLE_TREE_NONE_UNSPECIFIED = 0; + // no merkle tree + GRAPH_MERKLE_TREE_NONE_UNSPECIFIED = 0; } // ContentEntry describes data referenced and possibly stored on chain @@ -155,15 +160,15 @@ message ContentEntry { // AttestorEntry is a attestor entry wrapping a attestor address and timestamp message AttestorEntry { - // attestor is the address of the attestor. - string attestor = 1; + // attestor is the address of the attestor. + string attestor = 1; - // timestamp is the Timestamp of the attestation. - google.protobuf.Timestamp timestamp = 2; + // timestamp is the Timestamp of the attestation. + google.protobuf.Timestamp timestamp = 2; } // ContentHashes contains list of content ContentHash. message ContentHashes { - // data is a list of content hashes which the resolver claims to serve. - repeated ContentHash data = 1; + // data is a list of content hashes which the resolver claims to serve. + repeated ContentHash data = 1; }