diff --git a/docs/release-notes/change-log.md b/docs/release-notes/change-log.md index ab04ae518..3ebc9fa9a 100644 --- a/docs/release-notes/change-log.md +++ b/docs/release-notes/change-log.md @@ -16,9 +16,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), Example: ``` import "sf/substreams/v1/options.proto"; - optional bytes schema = 1 [ (sf.substreams.v1.options).load_from_file = true ];` - optional bytes extra_config_files = 2 [ (sf.substreams.v1.options).zip_from_folder = true ];` + + message HostedPostgresDatabase { + bytes schema = 1 [ (sf.substreams.v1.options).load_from_file = true ]; + bytes extra_config_files = 2 [ (sf.substreams.v1.options).zip_from_folder = true ]; + } ``` + * `substreams info` command now properly displays the sink configs, optionally writing the bytes fields to disk with `--dump-sinkconfig-bytes-to-disk` flag ### Removed diff --git a/manifest/sink.go b/manifest/sink.go index cbafb7812..28dc20520 100644 --- a/manifest/sink.go +++ b/manifest/sink.go @@ -19,7 +19,6 @@ import ( "github.com/jhump/protoreflect/desc" "github.com/jhump/protoreflect/dynamic" "go.uber.org/zap" - "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/types/descriptorpb" "google.golang.org/protobuf/types/known/anypb" @@ -91,15 +90,9 @@ func SinkConfigAsString(pkg *pbsubstreams.Package, dumpBytesToDisk bool) (string key: fd.GetJSONName(), } if opts := fd.GetFieldOptions(); opts != nil { - opts.ProtoReflect().Range(func(desc protoreflect.FieldDescriptor, val protoreflect.Value) bool { - if desc.TextName() != "[sf.substreams.v1.options]" { - return true - } - opts := val.Message().Interface().(*pbsubstreams.FieldOptions) - field.opts = opts - - return true - }) + if val := opts.ProtoReflect().Get(pbsubstreams.E_Options.TypeDescriptor()); val.IsValid() { + field.opts = val.Message().Interface().(*pbsubstreams.FieldOptions) + } } val, err := dynMsg.TryGetField(fd) if err != nil { @@ -139,7 +132,7 @@ func (f *fieldAndValue) String(dumpBytesToDisk bool) string { if _, err := file.Write(val); err != nil { zlog.Error("writing data to file", zap.Error(err)) } - suffix += " -> written to " + file.Name() + suffix += " -> written to " + file.Name() } return fmt.Sprintf(" - %v: (%d bytes) MD5SUM: %v %v", f.key, len(val), sum, suffix) @@ -168,13 +161,9 @@ func fieldResolver(msgDesc *desc.MessageDescriptor) func(string) (opts *pbsubstr if fd.GetFullyQualifiedJSONName() == fqdn { isBytes := fd.GetType() == descriptorpb.FieldDescriptorProto_TYPE_BYTES if opts := fd.GetFieldOptions(); opts != nil { - opts.ProtoReflect().Range(func(desc protoreflect.FieldDescriptor, val protoreflect.Value) bool { - if desc.TextName() != "[sf.substreams.v1.options]" { - return true - } + if val := opts.ProtoReflect().Get(pbsubstreams.E_Options.TypeDescriptor()); val.IsValid() { options = val.Message().Interface().(*pbsubstreams.FieldOptions) - return false - }) + } } return options, isBytes } @@ -300,7 +289,10 @@ func addFiles(w *zip.Writer, basePath string) error { if err != nil { return err } - path = strings.Replace(strings.TrimPrefix(strings.TrimPrefix(path, basePath), string(filepath.Separator)), "\\", "/", -1) + + path = strings.TrimPrefix(path, basePath) // relative path + path = strings.TrimPrefix(path, string(filepath.Separator)) // ensure we don't start with a slash + path = strings.Replace(path, "\\", "/", -1) // w.Create does not support windows-style separators if info.IsDir() { path += fmt.Sprintf("%s%c", path, os.PathSeparator) diff --git a/pb/generate.sh b/pb/generate.sh index 7152f79af..e7f587b21 100755 --- a/pb/generate.sh +++ b/pb/generate.sh @@ -48,9 +48,9 @@ function generate_system() { fi protoc -I$PROTO \ + "$PROTO/sf/substreams/options.proto" \ "$PROTO/sf/substreams/v1/modules.proto" \ "$PROTO/sf/substreams/v1/package.proto" \ - "$PROTO/sf/substreams/v1/options.proto" \ "$PROTO/sf/substreams/v1/clock.proto" \ "$PROTO/sf/substreams/rpc/v2/service.proto" \ "$PROTO/google/protobuf/any.proto" \ diff --git a/pb/last_generate.txt b/pb/last_generate.txt index 3787586f9..a20cecefc 100644 --- a/pb/last_generate.txt +++ b/pb/last_generate.txt @@ -1,2 +1,2 @@ -generate.sh - Mon 18 Sep 2023 15:04:30 EDT - stepd -streamingfast/proto revision: 2899868ddee59b2d3d398dffa99561c7a84c8c37 +generate.sh - Thu 21 Sep 2023 14:20:48 EDT - stepd +streamingfast/proto revision: d079e6342b6e1a9297b594476dedf98b0d82e0a8 diff --git a/pb/sf/substreams/options.pb.go b/pb/sf/substreams/options.pb.go new file mode 100644 index 000000000..134b1111f --- /dev/null +++ b/pb/sf/substreams/options.pb.go @@ -0,0 +1,192 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc (unknown) +// source: sf/substreams/options.proto + +package pbsubstreams + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + descriptorpb "google.golang.org/protobuf/types/descriptorpb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type FieldOptions struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // this option informs the `substreams pack` command that it should treat the corresponding manifest value as a path to a file, putting its content as bytes in this field. + // must be applied to a `bytes` or `string` field + LoadFromFile bool `protobuf:"varint,1,opt,name=load_from_file,json=loadFromFile,proto3" json:"load_from_file,omitempty"` + // this option informs the `substreams pack` command that it should treat the corresponding manifest value as a path to a folder, zipping its content and putting the zip content as bytes in this field. + // must be applied to a `bytes` field + ZipFromFolder bool `protobuf:"varint,2,opt,name=zip_from_folder,json=zipFromFolder,proto3" json:"zip_from_folder,omitempty"` +} + +func (x *FieldOptions) Reset() { + *x = FieldOptions{} + if protoimpl.UnsafeEnabled { + mi := &file_sf_substreams_options_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FieldOptions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FieldOptions) ProtoMessage() {} + +func (x *FieldOptions) ProtoReflect() protoreflect.Message { + mi := &file_sf_substreams_options_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FieldOptions.ProtoReflect.Descriptor instead. +func (*FieldOptions) Descriptor() ([]byte, []int) { + return file_sf_substreams_options_proto_rawDescGZIP(), []int{0} +} + +func (x *FieldOptions) GetLoadFromFile() bool { + if x != nil { + return x.LoadFromFile + } + return false +} + +func (x *FieldOptions) GetZipFromFolder() bool { + if x != nil { + return x.ZipFromFolder + } + return false +} + +var file_sf_substreams_options_proto_extTypes = []protoimpl.ExtensionInfo{ + { + ExtendedType: (*descriptorpb.FieldOptions)(nil), + ExtensionType: (*FieldOptions)(nil), + Field: 2200, + Name: "sf.substreams.v1.options", + Tag: "bytes,2200,opt,name=options", + Filename: "sf/substreams/options.proto", + }, +} + +// Extension fields to descriptorpb.FieldOptions. +var ( + // optional sf.substreams.v1.FieldOptions options = 2200; + E_Options = &file_sf_substreams_options_proto_extTypes[0] +) + +var File_sf_substreams_options_proto protoreflect.FileDescriptor + +var file_sf_substreams_options_proto_rawDesc = []byte{ + 0x0a, 0x1b, 0x73, 0x66, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x2f, + 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x73, + 0x66, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x1a, + 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x22, 0x5c, 0x0a, 0x0c, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x12, 0x24, 0x0a, 0x0e, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x66, 0x72, 0x6f, 0x6d, 0x5f, 0x66, + 0x69, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x6c, 0x6f, 0x61, 0x64, 0x46, + 0x72, 0x6f, 0x6d, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x26, 0x0a, 0x0f, 0x7a, 0x69, 0x70, 0x5f, 0x66, + 0x72, 0x6f, 0x6d, 0x5f, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x0d, 0x7a, 0x69, 0x70, 0x46, 0x72, 0x6f, 0x6d, 0x46, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x3a, + 0x5b, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, + 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x98, 0x11, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1e, 0x2e, 0x73, 0x66, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, + 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x88, 0x01, 0x01, 0x42, 0x46, 0x5a, 0x44, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, + 0x6d, 0x69, 0x6e, 0x67, 0x66, 0x61, 0x73, 0x74, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x74, 0x72, 0x65, + 0x61, 0x6d, 0x73, 0x2f, 0x70, 0x62, 0x2f, 0x73, 0x66, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x74, 0x72, + 0x65, 0x61, 0x6d, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x70, 0x62, 0x73, 0x75, 0x62, 0x73, 0x74, 0x72, + 0x65, 0x61, 0x6d, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_sf_substreams_options_proto_rawDescOnce sync.Once + file_sf_substreams_options_proto_rawDescData = file_sf_substreams_options_proto_rawDesc +) + +func file_sf_substreams_options_proto_rawDescGZIP() []byte { + file_sf_substreams_options_proto_rawDescOnce.Do(func() { + file_sf_substreams_options_proto_rawDescData = protoimpl.X.CompressGZIP(file_sf_substreams_options_proto_rawDescData) + }) + return file_sf_substreams_options_proto_rawDescData +} + +var file_sf_substreams_options_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_sf_substreams_options_proto_goTypes = []interface{}{ + (*FieldOptions)(nil), // 0: sf.substreams.v1.FieldOptions + (*descriptorpb.FieldOptions)(nil), // 1: google.protobuf.FieldOptions +} +var file_sf_substreams_options_proto_depIdxs = []int32{ + 1, // 0: sf.substreams.v1.options:extendee -> google.protobuf.FieldOptions + 0, // 1: sf.substreams.v1.options:type_name -> sf.substreams.v1.FieldOptions + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 1, // [1:2] is the sub-list for extension type_name + 0, // [0:1] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_sf_substreams_options_proto_init() } +func file_sf_substreams_options_proto_init() { + if File_sf_substreams_options_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_sf_substreams_options_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FieldOptions); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_sf_substreams_options_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 1, + NumServices: 0, + }, + GoTypes: file_sf_substreams_options_proto_goTypes, + DependencyIndexes: file_sf_substreams_options_proto_depIdxs, + MessageInfos: file_sf_substreams_options_proto_msgTypes, + ExtensionInfos: file_sf_substreams_options_proto_extTypes, + }.Build() + File_sf_substreams_options_proto = out.File + file_sf_substreams_options_proto_rawDesc = nil + file_sf_substreams_options_proto_goTypes = nil + file_sf_substreams_options_proto_depIdxs = nil +} diff --git a/pb/sf/substreams/v1/options.pb.go b/pb/sf/substreams/v1/options.pb.go deleted file mode 100644 index a20bb71d2..000000000 --- a/pb/sf/substreams/v1/options.pb.go +++ /dev/null @@ -1,192 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.1 -// protoc (unknown) -// source: sf/substreams/v1/options.proto - -package pbsubstreams - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - descriptorpb "google.golang.org/protobuf/types/descriptorpb" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type FieldOptions struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // this flag informs the `substreams pack` command that it should treat the corresponding manifest value as a path to a file, putting its content as bytes in this field. - // must be applied to a `bytes` or `string` field - LoadFromFile bool `protobuf:"varint,1,opt,name=load_from_file,json=loadFromFile,proto3" json:"load_from_file,omitempty"` - // this flag informs the `substreams pack` command that it should treat the corresponding manifest value as a path to a folder, zipping its content and putting the zip content as bytes in this field. - // must be applied to a `bytes` field - ZipFromFolder bool `protobuf:"varint,2,opt,name=zip_from_folder,json=zipFromFolder,proto3" json:"zip_from_folder,omitempty"` -} - -func (x *FieldOptions) Reset() { - *x = FieldOptions{} - if protoimpl.UnsafeEnabled { - mi := &file_sf_substreams_v1_options_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *FieldOptions) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FieldOptions) ProtoMessage() {} - -func (x *FieldOptions) ProtoReflect() protoreflect.Message { - mi := &file_sf_substreams_v1_options_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use FieldOptions.ProtoReflect.Descriptor instead. -func (*FieldOptions) Descriptor() ([]byte, []int) { - return file_sf_substreams_v1_options_proto_rawDescGZIP(), []int{0} -} - -func (x *FieldOptions) GetLoadFromFile() bool { - if x != nil { - return x.LoadFromFile - } - return false -} - -func (x *FieldOptions) GetZipFromFolder() bool { - if x != nil { - return x.ZipFromFolder - } - return false -} - -var file_sf_substreams_v1_options_proto_extTypes = []protoimpl.ExtensionInfo{ - { - ExtendedType: (*descriptorpb.FieldOptions)(nil), - ExtensionType: (*FieldOptions)(nil), - Field: 2200, - Name: "sf.substreams.v1.options", - Tag: "bytes,2200,opt,name=options", - Filename: "sf/substreams/v1/options.proto", - }, -} - -// Extension fields to descriptorpb.FieldOptions. -var ( - // optional sf.substreams.v1.FieldOptions options = 2200; - E_Options = &file_sf_substreams_v1_options_proto_extTypes[0] -) - -var File_sf_substreams_v1_options_proto protoreflect.FileDescriptor - -var file_sf_substreams_v1_options_proto_rawDesc = []byte{ - 0x0a, 0x1e, 0x73, 0x66, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x2f, - 0x76, 0x31, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x12, 0x10, 0x73, 0x66, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x2e, - 0x76, 0x31, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x5c, 0x0a, 0x0c, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x24, 0x0a, 0x0e, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x66, 0x72, 0x6f, - 0x6d, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x6c, 0x6f, - 0x61, 0x64, 0x46, 0x72, 0x6f, 0x6d, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x26, 0x0a, 0x0f, 0x7a, 0x69, - 0x70, 0x5f, 0x66, 0x72, 0x6f, 0x6d, 0x5f, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x0d, 0x7a, 0x69, 0x70, 0x46, 0x72, 0x6f, 0x6d, 0x46, 0x6f, 0x6c, 0x64, - 0x65, 0x72, 0x3a, 0x5b, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1d, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x98, 0x11, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x73, 0x66, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x74, 0x72, 0x65, - 0x61, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x88, 0x01, 0x01, 0x42, - 0x46, 0x5a, 0x44, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x74, - 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x66, 0x61, 0x73, 0x74, 0x2f, 0x73, 0x75, 0x62, 0x73, - 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x2f, 0x70, 0x62, 0x2f, 0x73, 0x66, 0x2f, 0x73, 0x75, 0x62, - 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x70, 0x62, 0x73, 0x75, 0x62, - 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_sf_substreams_v1_options_proto_rawDescOnce sync.Once - file_sf_substreams_v1_options_proto_rawDescData = file_sf_substreams_v1_options_proto_rawDesc -) - -func file_sf_substreams_v1_options_proto_rawDescGZIP() []byte { - file_sf_substreams_v1_options_proto_rawDescOnce.Do(func() { - file_sf_substreams_v1_options_proto_rawDescData = protoimpl.X.CompressGZIP(file_sf_substreams_v1_options_proto_rawDescData) - }) - return file_sf_substreams_v1_options_proto_rawDescData -} - -var file_sf_substreams_v1_options_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_sf_substreams_v1_options_proto_goTypes = []interface{}{ - (*FieldOptions)(nil), // 0: sf.substreams.v1.FieldOptions - (*descriptorpb.FieldOptions)(nil), // 1: google.protobuf.FieldOptions -} -var file_sf_substreams_v1_options_proto_depIdxs = []int32{ - 1, // 0: sf.substreams.v1.options:extendee -> google.protobuf.FieldOptions - 0, // 1: sf.substreams.v1.options:type_name -> sf.substreams.v1.FieldOptions - 2, // [2:2] is the sub-list for method output_type - 2, // [2:2] is the sub-list for method input_type - 1, // [1:2] is the sub-list for extension type_name - 0, // [0:1] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_sf_substreams_v1_options_proto_init() } -func file_sf_substreams_v1_options_proto_init() { - if File_sf_substreams_v1_options_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_sf_substreams_v1_options_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FieldOptions); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_sf_substreams_v1_options_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 1, - NumServices: 0, - }, - GoTypes: file_sf_substreams_v1_options_proto_goTypes, - DependencyIndexes: file_sf_substreams_v1_options_proto_depIdxs, - MessageInfos: file_sf_substreams_v1_options_proto_msgTypes, - ExtensionInfos: file_sf_substreams_v1_options_proto_extTypes, - }.Build() - File_sf_substreams_v1_options_proto = out.File - file_sf_substreams_v1_options_proto_rawDesc = nil - file_sf_substreams_v1_options_proto_goTypes = nil - file_sf_substreams_v1_options_proto_depIdxs = nil -} diff --git a/pb/system/system.pb b/pb/system/system.pb index e4d150460..d79e99da4 100644 Binary files a/pb/system/system.pb and b/pb/system/system.pb differ diff --git a/proto/sf/substreams/options.proto b/proto/sf/substreams/options.proto new file mode 100644 index 000000000..346abe8df --- /dev/null +++ b/proto/sf/substreams/options.proto @@ -0,0 +1,19 @@ +syntax = "proto3"; +package sf.substreams; + +option go_package = "github.com/streamingfast/substreams/pb/sf/substreams;pbsubstreams"; +import "google/protobuf/descriptor.proto"; + +message FieldOptions { + // this option informs the `substreams pack` command that it should treat the corresponding manifest value as a path to a file, putting its content as bytes in this field. + // must be applied to a `bytes` or `string` field + bool load_from_file = 1; + + // this option informs the `substreams pack` command that it should treat the corresponding manifest value as a path to a folder, zipping its content and putting the zip content as bytes in this field. + // must be applied to a `bytes` field + bool zip_from_folder = 2; +} + +extend google.protobuf.FieldOptions { + optional FieldOptions options = 2200; +} diff --git a/proto/sf/substreams/v1/options.proto b/proto/sf/substreams/v1/options.proto deleted file mode 100644 index 67c4aa43d..000000000 --- a/proto/sf/substreams/v1/options.proto +++ /dev/null @@ -1,19 +0,0 @@ -syntax = "proto3"; -package sf.substreams.v1; - -option go_package = "github.com/streamingfast/substreams/pb/sf/substreams/v1;pbsubstreams"; -import "google/protobuf/descriptor.proto"; - -message FieldOptions { - // this flag informs the `substreams pack` command that it should treat the corresponding manifest value as a path to a file, putting its content as bytes in this field. - // must be applied to a `bytes` or `string` field - bool load_from_file = 1; - - // this flag informs the `substreams pack` command that it should treat the corresponding manifest value as a path to a folder, zipping its content and putting the zip content as bytes in this field. - // must be applied to a `bytes` field - bool zip_from_folder = 2; -} - -extend google.protobuf.FieldOptions { - optional FieldOptions options = 2200; -}