-
Is there currently a way to do validation of cross-plugin dependencies at compile time (typescript checking) or a build time (e.g. running a tool against your agent configuration)? For instance, if there is an agent factory like this (with the export const createAgentWithProvider = (
provider: providers.JsonRpcProvider
) => {
return createAgent<IDIDManager & IKeyManager & IResolver & IDataStore>({
plugins: [
// new KeyManager({
// store: new KeyStore(dbConnection),
// kms: {
// local: new KeyManagementSystem(),
// },
// }),
new DIDManager({
store: new DIDStore(dbConnection),
defaultProvider: "did:ethr:volta",
providers: {
"did:ethr:volta": new EthrDIDProvider({
defaultKms: "local",
network: "volta",
web3Provider: provider,
}),
},
})
],
});
}; And construct the agent and execute a method like this const provider = new providers.JsonRpcProvider(
"https://volta-rpc.energyweb.org"
);
const agent = createAgentWithProvider(provider);
const identifier = await agent.didManagerCreate();
console.log(identifier); then at runtime I get this error:
Is there currently a way to check ahead of runtime that |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
That's an excellent question! At the moment, plugins can declare a schema that they provide, but they don't provide a set of requirements. I think these requirements need to be declared for the checks to be made. Feel free to post ideas here if you've got a clever way to run these checks other that what I'm suggesting. |
Beta Was this translation helpful? Give feedback.
That's an excellent question!
This is actually a feature that we planned from the beginning, but never got enough time for implementation.
So, at this point in time, the answer is no.
It might be difficult to have build time checks, at least initially, but early runtime checks should be possible with minimal changes.
At the moment, plugins can declare a schema that they provide, but they don't provide a set of requirements. I think these requirements need to be declared for the checks to be made.
Feel free to post ideas here if you've got a clever way to run these checks other that what I'm suggesting.