Skip to main content

Managing Link Definitions

The binding between an actor and a capability provider is called a link definition. A link definition is made up of the actor, the provider, the contract being satisfied, and the provider's link name. Link definitions in Cosmonic appear as lines connecting elements, and you can query their metadata using the cosmo CLI.

Cosmonic makes configuring capability providers and linking them to actors easy, but there are still a few things to keep in mind. In the Cosmonic application, on the logic view, simply drag from the outlet within the actor corresponding to the contract you want to satisfy to the inlet on the capability provider to which you want to connect.

The contract is just a unique string that identifies the abstraction being used. For example, in many of our demos and samples, we make extensive use of the wasmcloud:keyvalue and wasmcloud:httpserver contracts.

Add Link Definition Dialog
Add Link Definition Dialog

The application makes it easy to add multiple link configuration values. There are two things that you need to keep in mind when specifying the values for a link definition:

  • The names and specifications of required and optional values are specific to the provider being linked.
  • Link values should never assume the presence of anything on localhost or even within a local network

For example, when configuring the values to link an actor to a PostgresQL provider, the URI that you provide pointing to the database cannot be relative to localhost, nor can it be any of the non-routable IP address ranges like 192.168.x.x. Providers are deployed on semi-transient hosts, and so we can never make assumptions about the local resources for those providers. Instead, we need to provide absolute paths and URIs. For more information on how to configure each of our first party providers, take a look at our providers under the capabilities list.