This package aggregates all proto files from Cosmos and Tendermint, so that we can build 3 libs with messages and gRPC swift implemenations:
- Cosmos
- IBC
- Tendermint
./scripts/generate.sh
There are two options to use the swift proto files. Either you use the library, or you copy the files directy in your project.
dependencies: [
.package(name: "swift-cosmos-proto", url: "https://github.com/cosmosswift/swift-cosmos-proto.git", .branch( "main")),
]
After copying the .pb.swift
files into your project, you will need
to add the
SwiftProtobuf library to
your project to support the generated code. If you are using the
Swift Package Manager, you should first check what version of
protoc-gen-swift
you are currently using:
$ protoc-gen-swift --version
protoc-gen-swift 1.0.1
And then add a dependency to your Package.swift file. Adjust the
Version()
here to match the protoc-gen-swift
version you checked
above:
dependencies: [
.package(name: "SwiftProtobuf", url: "https://github.com/apple/swift-protobuf.git", from: "1.6.0"),
]
If you are using Xcode, then you should:
- Add the Swift source files generated from your protos directly to your project.
- Clone the SwiftProtobuf package.
- Add the SwiftProtobuf target from the Xcode project from that package to your project.
- import proto files from various required locations
- do a diff between old and new files
-> set up a docker container that will clone relevant repos, compare proto files
https://github.com/grpc/grpc-swift
https://github.com/grpc/grpc-swift/blob/main/docs/tls.md
https://github.com/grpc/grpc-swift/blob/main/docs/keepalive.md
https://github.com/apple/swift-protobuf/blob/main/Documentation/API.md https://github.com/apple/swift-protobuf/blob/main/Documentation/PLUGIN.md