Я пытаюсь запустить следующий код для инициализации Javascript-агента Credo/Aries Framework в среде React Native в версии Expo ^50:
import {
Agent,
ConnectionEventTypes,
ConnectionsModule,
ConsoleLogger,
DidExchangeState,
LogLevel,
MediationRecipientModule,
MediatorPickupStrategy,
KeyDerivationMethod,
HttpOutboundTransport,
WsOutboundTransport,
InitConfig,
} from "@credo-ts/core"
import { agentDependencies } from "@credo-ts/react-native"
import { AskarModule } from "@credo-ts/askar"
import { ariesAskar } from "@hyperledger/aries-askar-react-native"
// and other irrelevant dependencies as well
const config: InitConfig = {
label: "standalone-agent-10",
walletConfig: {
id: "standalone-agent-10",
key: "00000000001000000000000000000010",
keyDerivationMethod: KeyDerivationMethod.Argon2IMod,
},
logger: new ConsoleLogger(LogLevel.trace),
// autoUpdateStorageOnStartup: true,
}
const mediatorInvitationUrl = "https://url...."
const agent = new Agent({
config,
modules: {
askar: new AskarModule({ ariesAskar }),
connections: new ConnectionsModule({ autoAcceptConnections: true }),
mediationRecipient: new MediationRecipientModule({
mediatorInvitationUrl,
mediatorPickupStrategy: MediatorPickupStrategy.Implicit,
}),
},
dependencies: agentDependencies,
})
agent.registerOutboundTransport(new WsOutboundTransport())
agent.registerOutboundTransport(new HttpOutboundTransport())
export const WelcomeScreenCredo = () => {
useEffect(() => {
agent
.initialize()
.then((_) => console.log("Agent initialized!"))
.catch((err) => console.log("Agent not initialized:", err))
}, [])
return
Hi
}
Если я удалю этот фрагмент ниже, код будет работать отлично и выйдет из системы. Агент инициализирован! как и ожидалось:
mediationRecipient: new MediationRecipientModule({
mediatorInvitationUrl,
mediatorPickupStrategy: MediatorPickupStrategy.Implicit,
}),
Но когда я сохраняю этот фрагмент, я получаю следующую ошибку при запуске пряжи Android:
INFO INFO: Creating agent with config {
"agentConfig": {
"label": "standalone-agent-10",
"walletConfig": {
"id": "standalone-agent-10",
"key": "[*****]",
"keyDerivationMethod": "ARGON2I_MOD",
"storage": {}
},
"logger": 1,
"agentDependencies": true
}
}
INFO INFO: Initializing wallet 'standalone-agent-10' {
"id": "standalone-agent-10",
"key": "[*****]",
"keyDerivationMethod": "ARGON2I_MOD",
"storage": {}
}
DEBUG DEBUG: Wallet 'standalone-agent-10' opened with handle '1'
INFO INFO: Agent storage is up to date.
DEBUG DEBUG: Starting HTTP outbound transport
DEBUG DEBUG: Starting WS outbound transport
DEBUG DEBUG: Provision mediation with invitation {
"mediatorInvitationUrl": "https://url...."
}
DEBUG DEBUG: Mediation connection does not exist, creating connection
DEBUG DEBUG: Routing created {
"endpoints": [
"didcomm:transport/queue"
],
"routingKeys": [],
"recipientKey": {
"keyType": "ed25519",
"publicKeyBase58": "----xyz----"
}
}
ERROR Something went wrong while setting up the agent! Message: TypeError: 0, _$$_REQUIRE(_dependencyMap[1], "did-resolver").parse is not a function (it is undefined)
Подробнее здесь: https://stackoverflow.com/questions/785 ... d-resolver
Ошибка Credo/AFJ: [TypeError: 0, _$$_REQUIRE(_dependentMap[1], "did-resolver").parse не является функцией (она не опреде ⇐ IOS
Программируем под IOS
1716724551
Anonymous
Я пытаюсь запустить следующий код для инициализации Javascript-агента Credo/Aries Framework в среде React Native в версии Expo ^50:
import {
Agent,
ConnectionEventTypes,
ConnectionsModule,
ConsoleLogger,
DidExchangeState,
LogLevel,
MediationRecipientModule,
MediatorPickupStrategy,
KeyDerivationMethod,
HttpOutboundTransport,
WsOutboundTransport,
InitConfig,
} from "@credo-ts/core"
import { agentDependencies } from "@credo-ts/react-native"
import { AskarModule } from "@credo-ts/askar"
import { ariesAskar } from "@hyperledger/aries-askar-react-native"
// and other irrelevant dependencies as well
const config: InitConfig = {
label: "standalone-agent-10",
walletConfig: {
id: "standalone-agent-10",
key: "00000000001000000000000000000010",
keyDerivationMethod: KeyDerivationMethod.Argon2IMod,
},
logger: new ConsoleLogger(LogLevel.trace),
// autoUpdateStorageOnStartup: true,
}
const mediatorInvitationUrl = "https://url...."
const agent = new Agent({
config,
modules: {
askar: new AskarModule({ ariesAskar }),
connections: new ConnectionsModule({ autoAcceptConnections: true }),
mediationRecipient: new MediationRecipientModule({
mediatorInvitationUrl,
mediatorPickupStrategy: MediatorPickupStrategy.Implicit,
}),
},
dependencies: agentDependencies,
})
agent.registerOutboundTransport(new WsOutboundTransport())
agent.registerOutboundTransport(new HttpOutboundTransport())
export const WelcomeScreenCredo = () => {
useEffect(() => {
agent
.initialize()
.then((_) => console.log("Agent initialized!"))
.catch((err) => console.log("Agent not initialized:", err))
}, [])
return
Hi
}
Если я удалю этот фрагмент ниже, код будет работать отлично и выйдет из системы. Агент инициализирован! как и ожидалось:
mediationRecipient: new MediationRecipientModule({
mediatorInvitationUrl,
mediatorPickupStrategy: MediatorPickupStrategy.Implicit,
}),
Но когда я сохраняю этот фрагмент, я получаю следующую ошибку при запуске пряжи Android:
INFO INFO: Creating agent with config {
"agentConfig": {
"label": "standalone-agent-10",
"walletConfig": {
"id": "standalone-agent-10",
"key": "[*****]",
"keyDerivationMethod": "ARGON2I_MOD",
"storage": {}
},
"logger": 1,
"agentDependencies": true
}
}
INFO INFO: Initializing wallet 'standalone-agent-10' {
"id": "standalone-agent-10",
"key": "[*****]",
"keyDerivationMethod": "ARGON2I_MOD",
"storage": {}
}
DEBUG DEBUG: Wallet 'standalone-agent-10' opened with handle '1'
INFO INFO: Agent storage is up to date.
DEBUG DEBUG: Starting HTTP outbound transport
DEBUG DEBUG: Starting WS outbound transport
DEBUG DEBUG: Provision mediation with invitation {
"mediatorInvitationUrl": "https://url...."
}
DEBUG DEBUG: Mediation connection does not exist, creating connection
DEBUG DEBUG: Routing created {
"endpoints": [
"didcomm:transport/queue"
],
"routingKeys": [],
"recipientKey": {
"keyType": "ed25519",
"publicKeyBase58": "----xyz----"
}
}
ERROR Something went wrong while setting up the agent! Message: TypeError: 0, _$$_REQUIRE(_dependencyMap[1], "did-resolver").parse is not a function (it is undefined)
Подробнее здесь: [url]https://stackoverflow.com/questions/78535180/credo-afj-error-typeerror-0-require-dependencymap1-did-resolver[/url]
Ответить
1 сообщение
• Страница 1 из 1
Перейти
- Кемерово-IT
- ↳ Javascript
- ↳ C#
- ↳ JAVA
- ↳ Elasticsearch aggregation
- ↳ Python
- ↳ Php
- ↳ Android
- ↳ Html
- ↳ Jquery
- ↳ C++
- ↳ IOS
- ↳ CSS
- ↳ Excel
- ↳ Linux
- ↳ Apache
- ↳ MySql
- Детский мир
- Для души
- ↳ Музыкальные инструменты даром
- ↳ Печатная продукция даром
- Внешняя красота и здоровье
- ↳ Одежда и обувь для взрослых даром
- ↳ Товары для здоровья
- ↳ Физкультура и спорт
- Техника - даром!
- ↳ Автомобилистам
- ↳ Компьютерная техника
- ↳ Плиты: газовые и электрические
- ↳ Холодильники
- ↳ Стиральные машины
- ↳ Телевизоры
- ↳ Телефоны, смартфоны, плашеты
- ↳ Швейные машинки
- ↳ Прочая электроника и техника
- ↳ Фототехника
- Ремонт и интерьер
- ↳ Стройматериалы, инструмент
- ↳ Мебель и предметы интерьера даром
- ↳ Cантехника
- Другие темы
- ↳ Разное даром
- ↳ Давай меняться!
- ↳ Отдам\возьму за копеечку
- ↳ Работа и подработка в Кемерове
- ↳ Давай с тобой поговорим...
Мобильная версия