Skip to content

Commit

Permalink
docs: update migration guide with new breaking changes (#81)
Browse files Browse the repository at this point in the history
Signed-off-by: Ariel Gentile <[email protected]>
  • Loading branch information
genaris authored Dec 9, 2022
1 parent d985eca commit 96630de
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions guides/updating/versions/0.2-to-0.3.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ For easy migration, you can simply construct `AgentOptions` by putting current I

Note that, if you are defining `indyLedgers` configuration, you should set the indyNamespace for every ledger, as explained in [Agent Config tutorial](../../tutorials/agent-config/index.md#indyledgers).

### did:key usage in protocols

In accordance with [Aries RFC 0360](https://github.com/hyperledger/aries-rfcs/tree/b3a3942ef052039e73cd23d847f42947f8287da2/features/0360-use-did-key), since 0.2.5 there is a configuration parameter called `useDidKeyInProtocols` which, when enabled, will encode keys in did:key instead of previous base58 format, unless the other party has started a protocol and is using base58.

This parameter was previously disabled by default and now it is enabled. If your agent only interacts with modern agents (e.g. AFJ 0.2.5 and newer) this will not represent any issue. Otherwise it is safer to explicitly set it to `false`. However, keep in mind that we expect this setting to be deprecated in the future, so we encourage you to update all your agents to use did:key.

### Modules extracted from the core

In this release two modules were extracted from the core and published as separate, optional packages:
Expand Down Expand Up @@ -445,6 +451,40 @@ AgentContext can be obtained from either:
<!--/tabs-->
#### Using OutboundMessageContext
If your module implements a protocol that sends messages to other agents, you will notice that Agent's `MessageSender` now receives the more generic `OutboundMessageContext` class, which replaces previous helper method `createOutboundMessage`.
You can take advantage of this new mechanism to associate a record to the context, in order to do specific actions to it when outbound message state changes (e.g. a `MessageSendingError` is thrown or `AgentMessageSentEvent` is emitted).
<!--tabs-->
#### 0.2.x
```ts
import { createOutboundMessage } from '@aries-framework/core'

const outboundMessage = createOutboundMessage(connection, message)
await this.messageSender.sendMessage(outboundMessage)
```
#### 0.3.x
```ts
import { OutboundMessageContext } from '@aries-framework/core'

const outboundMessageContext = new OutboundMessageContext(message, {
agentContext: this.agentContext,
connection,
// optional, if you want to link the message to a related record
associatedRecord: record,
})

await this.messageSender.sendMessage(outboundMessageContext)
```
<!--/tabs-->
#### Updating module structure to register in new Plugin API
Existing modules can benefit from the new Plugin API mechanism by doing the following modifications:
Expand Down

0 comments on commit 96630de

Please sign in to comment.