Skip to content

Commit

Permalink
fix: enable pubsub (#828)
Browse files Browse the repository at this point in the history
Adds option for pubsub
  • Loading branch information
achingbrain committed Apr 19, 2024
1 parent 12399c3 commit d6543a6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/kubo/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export type KuboInitOptions = KuboEd25519Init | KuboRSAInit
export interface KuboStartOptions {
offline?: boolean
ipnsPubsub?: boolean
pubsub?: boolean
repoAutoMigrate?: boolean

/**
Expand Down
4 changes: 4 additions & 0 deletions src/kubo/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ export function buildStartArgs (options: KuboStartOptions): string[] {
args.push('--offline')
}

if (options.pubsub === true) {
args.push('---enable-pubsub-experiment')
}

if (options.ipnsPubsub === true) {
args.push('--enable-namesys-pubsub')
}
Expand Down
6 changes: 6 additions & 0 deletions test/kubo/utils.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@ describe('utils', function () {
}).join(' ')).to.include('--offline')
})

it('ipns pubsub', () => {
expect(buildStartArgs({
pubsub: true
}).join(' ')).to.include('--enable-pubsub-experiment')
})

it('ipns pubsub', () => {
expect(buildStartArgs({
ipnsPubsub: true
Expand Down

0 comments on commit d6543a6

Please sign in to comment.