Skip to content

Commit 2b23f0b

Browse files
committed
update the docs
1 parent 6920b38 commit 2b23f0b

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

book/src/framework/components/chipingresset/chip_ingress.md

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ It consists of 3 components:
1212
To add it to your stack use following TOML:
1313
```toml
1414
[chip_ingress]
15-
compose_file='../../components/chip_ingress_set/docker-compose.yml'
15+
# using a local docker-compose file
16+
compose_file='file://../../components/chip_ingress_set/docker-compose.yml'
17+
# using a remote file
18+
# compose_file='https://my.awesome.resource.io/docker-compose.yml'
1619
extra_docker_networks = ["my-existing-network"]
1720
```
1821

@@ -69,8 +72,7 @@ if token := os.Getenv("GITHUB_TOKEN"); token != "" {
6972

7073
protoErr := chipingressset.DefaultRegisterAndFetchProtos(ctx, client, []chipingressset.RepoConfiguration{
7174
{
72-
Owner: "smartcontractkit",
73-
Repo: "chainlink-protos",
75+
URI: "https://github.com/smartcontractkit/chainlink-protostractkit",
7476
Ref: "626c42d55bdcb36dffe0077fff58abba40acc3e5",
7577
Folders: []string{"workflows"},
7678
},
@@ -83,13 +85,21 @@ if protoErr != nil {
8385
Since `ProtoSchemaSet` has TOML tags you can also read it from a TOML file with this content:
8486
```toml
8587
[[proto_schema_set]]
86-
owner = 'smartcontractkit'
87-
repository = 'chainlink-protos'
88+
# reading from remote registry (only github.com supported)
89+
uri = 'https://github.com/smartcontractkit/chainlink-protos'
8890
ref = '626c42d55bdcb36dffe0077fff58abba40acc3e5'
8991
folders = ['workflows']
92+
subject_prefix = 'cre-'
93+
94+
[[proto_schema_set]]
95+
# reading from local folder
96+
uri = 'file://../../chainlink-protos'
97+
# ref is not supported, when reading from local folders
98+
folders = ['workflows']
99+
subject_prefix = 'cre-'
90100
```
91101

92-
using this code:
102+
And then use this Go code to register them:
93103
```go
94104
var protoSchemaSets []chipingressset.ProtoSchemaSet
95105
for _, schemaSet := range configFiles {
@@ -113,4 +123,4 @@ for _, schemaSet := range configFiles {
113123

114124
Registration logic is very simple and should handle cases of protos that import other protos as long they are all available in the `ProtoSchemaSet`s provided to the registration function. That function uses an algorithm called "topological sorting by trail", which will try to register all protos in a loop until it cannot register any more protos or it has registered all of them. That allows us to skip dependency parsing completely.
115125

116-
Since Kafka doesn't have any automatic discoverability mechanism for subject - schema relationship (it has to be provided out-of-band) code currently only knows how to correctly register protos from [chainlink-protos](https://github.com/smartcontractkit/chainlink-protos) repository.
126+
Kafka doesn't have any automatic discoverability mechanism for subject - schema relationship (it has to be provided out-of-band). Currenly, we create the subject in the following way: <subject_prefix>.<package>.<1st-message-name>. Subject prefix is optional and if it's not present, then subject is equal to: <package>.<1st-message-name>. Only the first message in the `.proto` file is ever registered.

0 commit comments

Comments
 (0)