Skip to content

Commit

Permalink
fix: move storage to cwd to avoid permissions issues (#7)
Browse files Browse the repository at this point in the history
Signed-off-by: Bryce McMath <[email protected]>
  • Loading branch information
bryce-mcmath authored Jul 17, 2024
1 parent d08b838 commit 88f8c5d
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/dist
/node_modules
/build
/.afj

# Logs
logs
Expand Down
30 changes: 27 additions & 3 deletions src/helpers/agent.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,40 @@
import { Agent, ConsoleLogger, DidsModule, Logger, LogLevel } from '@credo-ts/core'
import { agentDependencies } from '@credo-ts/node'
import { AskarModule } from '@credo-ts/askar'
import { AnonCredsModule } from '@credo-ts/anoncreds'
import { AskarModule } from '@credo-ts/askar'
import {
Agent,
AgentDependencies,
ConsoleLogger,
DidsModule,
Logger,
LogLevel,
} from '@credo-ts/core'
import {
IndyVdrAnonCredsRegistry,
IndyVdrModule,
IndyVdrPoolConfig,
IndyVdrSovDidResolver,
} from '@credo-ts/indy-vdr'
import { NodeFileSystem } from '@credo-ts/node/build/NodeFileSystem'
import { anoncreds } from '@hyperledger/anoncreds-nodejs'
import { ariesAskar } from '@hyperledger/aries-askar-nodejs'
import { indyVdr } from '@hyperledger/indy-vdr-nodejs'
import { EventEmitter } from 'events'
import { WebSocket } from 'ws'

class CustomFileSystem extends NodeFileSystem {
public constructor() {
super({
baseDataPath: process.cwd(),
})
}
}

const agentDependencies: AgentDependencies = {
FileSystem: CustomFileSystem,
fetch,
EventEmitterClass: EventEmitter,
WebSocketClass: WebSocket,
}

export type IndyVdrProxyAgent = Agent<ReturnType<typeof getIndyVdrProxyAgentModules>>

Expand Down

0 comments on commit 88f8c5d

Please sign in to comment.