@noosphere/agent-core 0.1.0-alpha.12 → 0.1.0-alpha.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +5 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +5 -2
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
package/dist/index.d.mts
CHANGED
|
@@ -2,6 +2,7 @@ import { EventEmitter } from 'events';
|
|
|
2
2
|
import { Provider, Contract } from 'ethers';
|
|
3
3
|
import { WalletManager } from '@noosphere/crypto';
|
|
4
4
|
export { KeystoreInfo, KeystoreManager, NoosphereKeystore, PaymentWalletInfo, WalletManager } from '@noosphere/crypto';
|
|
5
|
+
import { RegistryManager } from '@noosphere/registry';
|
|
5
6
|
export { RegistryConfig, ContainerMetadata as RegistryContainerMetadata, RegistryManager, VerifierMetadata as RegistryVerifierMetadata } from '@noosphere/registry';
|
|
6
7
|
|
|
7
8
|
interface Commitment {
|
|
@@ -474,6 +475,7 @@ interface NoosphereAgentOptions {
|
|
|
474
475
|
coordinatorAbi?: any[];
|
|
475
476
|
getContainer?: (containerId: string) => ContainerMetadata | undefined;
|
|
476
477
|
containers?: Map<string, ContainerMetadata>;
|
|
478
|
+
registryManager?: RegistryManager;
|
|
477
479
|
walletManager?: WalletManager;
|
|
478
480
|
paymentWallet?: string;
|
|
479
481
|
schedulerConfig?: Partial<SchedulerConfig>;
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { EventEmitter } from 'events';
|
|
|
2
2
|
import { Provider, Contract } from 'ethers';
|
|
3
3
|
import { WalletManager } from '@noosphere/crypto';
|
|
4
4
|
export { KeystoreInfo, KeystoreManager, NoosphereKeystore, PaymentWalletInfo, WalletManager } from '@noosphere/crypto';
|
|
5
|
+
import { RegistryManager } from '@noosphere/registry';
|
|
5
6
|
export { RegistryConfig, ContainerMetadata as RegistryContainerMetadata, RegistryManager, VerifierMetadata as RegistryVerifierMetadata } from '@noosphere/registry';
|
|
6
7
|
|
|
7
8
|
interface Commitment {
|
|
@@ -474,6 +475,7 @@ interface NoosphereAgentOptions {
|
|
|
474
475
|
coordinatorAbi?: any[];
|
|
475
476
|
getContainer?: (containerId: string) => ContainerMetadata | undefined;
|
|
476
477
|
containers?: Map<string, ContainerMetadata>;
|
|
478
|
+
registryManager?: RegistryManager;
|
|
477
479
|
walletManager?: WalletManager;
|
|
478
480
|
paymentWallet?: string;
|
|
479
481
|
schedulerConfig?: Partial<SchedulerConfig>;
|
package/dist/index.js
CHANGED
|
@@ -1407,7 +1407,7 @@ var NoosphereAgent = class _NoosphereAgent {
|
|
|
1407
1407
|
);
|
|
1408
1408
|
}
|
|
1409
1409
|
this.containerManager = new ContainerManager();
|
|
1410
|
-
this.registryManager = new RegistryManager({
|
|
1410
|
+
this.registryManager = options.registryManager || new RegistryManager({
|
|
1411
1411
|
autoSync: true,
|
|
1412
1412
|
// Enable automatic sync with remote registry
|
|
1413
1413
|
cacheTTL: 36e5
|
|
@@ -1517,7 +1517,10 @@ var NoosphereAgent = class _NoosphereAgent {
|
|
|
1517
1517
|
async start() {
|
|
1518
1518
|
console.log("Starting Noosphere Agent...");
|
|
1519
1519
|
console.log("\u{1F4CB} Loading container registry...");
|
|
1520
|
-
|
|
1520
|
+
const existingStats = this.registryManager.getStats();
|
|
1521
|
+
if (existingStats.totalContainers === 0) {
|
|
1522
|
+
await this.registryManager.load();
|
|
1523
|
+
}
|
|
1521
1524
|
const stats = this.registryManager.getStats();
|
|
1522
1525
|
console.log(
|
|
1523
1526
|
`\u2713 Registry loaded: ${stats.totalContainers} containers, ${stats.totalVerifiers} verifiers`
|