Open benzmuircroft opened 10 months ago
It's because hyper-nostr
package.json has dependency ?:
"hyperbee": "^2.8.0",
and the version that gets installed is further developed to use newest holepunch
"name": "hyperbee",
"version": "2.18.1",
in hyper-nostr/db.js
I logged the db
object
Collection {
name: 'events',
bee: Autodeebee {
autobase: Autobase {
_events: [Object: null prototype] {},
_eventsCount: 0,
_maxListeners: undefined,
localInput: Hypercore(
id: fr8e8y9k54y61j7pxwf7sxj1mcen16dfzim4ynzuio4n1473zscy
key: 290e8383eade81e927ad7d0bdb3d325b10297865bd57a00af3ac34296bb9bd98
discoveryKey: f3443e41888334dd1d127483043cefc88ef82fff01038b80f13fff6311f5bcae
opened: true
closed: false
snapshotted: false
sparse: true
writable: true
length: 1
fork: 0
sessions: [ 2 ]
activeRequests: [ 0 ]
peers: [ 0 ]
),
localOutput: Hypercore(
id: 1kjhxtp31yyd54wh7zuipp868nj3yey6g81c5pwwmq5o5kygkt5o
key: 9293c7c5b990003dea9cede756b4fe389390201e31e4cdb6945bb70da8065477
discoveryKey: 51286fcfc94aba30b3cb3728370efabc53c66363c505b6f16e269b7f3c831e65
opened: true
closed: false
snapshotted: false
sparse: true
writable: true
length: 2
fork: 0
sessions: [ 2 ]
activeRequests: [ 0 ]
peers: [ 0 ]
),
opened: false,
closed: false,
_closing: null,
_inputs: [Array],
_outputs: [],
_inputsByKey: Map(0) {},
_outputsByKey: Map(0) {},
_keyCompressors: Map(0) {},
_viewSessions: [Set],
_readStreams: [],
_batchId: 0,
_lock: [Function],
_eagerUpdate: true,
_sparse: true,
_loadingInputsCount: 0,
_pendingUpdates: [],
view: [Hyperbee],
_onappend: [Function (anonymous)],
_opening: [Promise],
ready: [Function (anonymous)],
[Symbol(kCapture)]: false
},
opts: { sub: true },
bee: Hyperbee {
_events: [Object: null prototype] {},
_eventsCount: 0,
_maxListeners: undefined,
opening: null,
closing: null,
opened: false,
closed: false,
feed: [LinearizedCoreSession],
core: [LinearizedCoreSession],
keyEncoding: [Object],
valueEncoding: [Object],
extension: null,
metadata: null,
lock: [Function],
sep: <Buffer 00>,
readonly: false,
prefix: <Buffer 65 76 65 6e 74 73 00>,
alwaysDuplicate: true,
_unprefixedKeyEncoding: [Object],
_sub: true,
_checkout: 0,
_view: true,
_onappendBound: null,
_ontruncateBound: null,
_watchers: null,
_entryWatchers: null,
_sessions: true,
_batches: [],
[Symbol(kCapture)]: false
}
},
docs: Autodeebee {
autobase: Autobase {
_events: [Object: null prototype] {},
_eventsCount: 0,
_maxListeners: undefined,
localInput: Hypercore(
id: fr8e8y9k54y61j7pxwf7sxj1mcen16dfzim4ynzuio4n1473zscy
key: 290e8383eade81e927ad7d0bdb3d325b10297865bd57a00af3ac34296bb9bd98
discoveryKey: f3443e41888334dd1d127483043cefc88ef82fff01038b80f13fff6311f5bcae
opened: true
closed: false
snapshotted: false
sparse: true
writable: true
length: 1
fork: 0
sessions: [ 2 ]
activeRequests: [ 0 ]
peers: [ 0 ]
),
localOutput: Hypercore(
id: 1kjhxtp31yyd54wh7zuipp868nj3yey6g81c5pwwmq5o5kygkt5o
key: 9293c7c5b990003dea9cede756b4fe389390201e31e4cdb6945bb70da8065477
discoveryKey: 51286fcfc94aba30b3cb3728370efabc53c66363c505b6f16e269b7f3c831e65
opened: true
closed: false
snapshotted: false
sparse: true
writable: true
length: 2
fork: 0
sessions: [ 2 ]
activeRequests: [ 0 ]
peers: [ 0 ]
),
opened: false,
closed: false,
_closing: null,
_inputs: [Array],
_outputs: [],
_inputsByKey: Map(0) {},
_outputsByKey: Map(0) {},
_keyCompressors: Map(0) {},
_viewSessions: [Set],
_readStreams: [],
_batchId: 0,
_lock: [Function],
_eagerUpdate: true,
_sparse: true,
_loadingInputsCount: 0,
_pendingUpdates: [],
view: [Hyperbee],
_onappend: [Function (anonymous)],
_opening: [Promise],
ready: [Function (anonymous)],
[Symbol(kCapture)]: false
},
opts: { sub: true },
bee: Hyperbee {
_events: [Object: null prototype] {},
_eventsCount: 0,
_maxListeners: undefined,
opening: null,
closing: null,
opened: false,
closed: false,
feed: [LinearizedCoreSession],
core: [LinearizedCoreSession],
keyEncoding: [Object],
valueEncoding: [Object],
extension: null,
metadata: null,
lock: [Function],
sep: <Buffer 00>,
readonly: false,
prefix: <Buffer 65 76 65 6e 74 73 00 64 6f 63 00>,
alwaysDuplicate: true,
_unprefixedKeyEncoding: [Object],
_sub: true,
_checkout: 0,
_view: true,
_onappendBound: null,
_ontruncateBound: null,
_watchers: null,
_entryWatchers: null,
_sessions: true,
_batches: [],
[Symbol(kCapture)]: false
}
},
idxs: Autodeebee {
autobase: Autobase {
_events: [Object: null prototype] {},
_eventsCount: 0,
_maxListeners: undefined,
localInput: Hypercore(
id: fr8e8y9k54y61j7pxwf7sxj1mcen16dfzim4ynzuio4n1473zscy
key: 290e8383eade81e927ad7d0bdb3d325b10297865bd57a00af3ac34296bb9bd98
discoveryKey: f3443e41888334dd1d127483043cefc88ef82fff01038b80f13fff6311f5bcae
opened: true
closed: false
snapshotted: false
sparse: true
writable: true
length: 1
fork: 0
sessions: [ 2 ]
activeRequests: [ 0 ]
peers: [ 0 ]
),
localOutput: Hypercore(
id: 1kjhxtp31yyd54wh7zuipp868nj3yey6g81c5pwwmq5o5kygkt5o
key: 9293c7c5b990003dea9cede756b4fe389390201e31e4cdb6945bb70da8065477
discoveryKey: 51286fcfc94aba30b3cb3728370efabc53c66363c505b6f16e269b7f3c831e65
opened: true
closed: false
snapshotted: false
sparse: true
writable: true
length: 2
fork: 0
sessions: [ 2 ]
activeRequests: [ 0 ]
peers: [ 0 ]
),
opened: false,
closed: false,
_closing: null,
_inputs: [Array],
_outputs: [],
_inputsByKey: Map(0) {},
_outputsByKey: Map(0) {},
_keyCompressors: Map(0) {},
_viewSessions: [Set],
_readStreams: [],
_batchId: 0,
_lock: [Function],
_eagerUpdate: true,
_sparse: true,
_loadingInputsCount: 0,
_pendingUpdates: [],
view: [Hyperbee],
_onappend: [Function (anonymous)],
_opening: [Promise],
ready: [Function (anonymous)],
[Symbol(kCapture)]: false
},
opts: { sub: true },
bee: Hyperbee {
_events: [Object: null prototype] {},
_eventsCount: 0,
_maxListeners: undefined,
opening: null,
closing: null,
opened: false,
closed: false,
feed: [LinearizedCoreSession],
core: [LinearizedCoreSession],
keyEncoding: [Object],
valueEncoding: [Object],
extension: null,
metadata: null,
lock: [Function],
sep: <Buffer 00>,
readonly: false,
prefix: <Buffer 65 76 65 6e 74 73 00 69 64 78 73 00>,
alwaysDuplicate: true,
_unprefixedKeyEncoding: [Object],
_sub: true,
_checkout: 0,
_view: true,
_onappendBound: null,
_ontruncateBound: null,
_watchers: null,
_entryWatchers: null,
_sessions: true,
_batches: [],
[Symbol(kCapture)]: false
}
},
idx: Autodeebee {
autobase: Autobase {
_events: [Object: null prototype] {},
_eventsCount: 0,
_maxListeners: undefined,
localInput: Hypercore(
id: fr8e8y9k54y61j7pxwf7sxj1mcen16dfzim4ynzuio4n1473zscy
key: 290e8383eade81e927ad7d0bdb3d325b10297865bd57a00af3ac34296bb9bd98
discoveryKey: f3443e41888334dd1d127483043cefc88ef82fff01038b80f13fff6311f5bcae
opened: true
closed: false
snapshotted: false
sparse: true
writable: true
length: 1
fork: 0
sessions: [ 2 ]
activeRequests: [ 0 ]
peers: [ 0 ]
),
localOutput: Hypercore(
id: 1kjhxtp31yyd54wh7zuipp868nj3yey6g81c5pwwmq5o5kygkt5o
key: 9293c7c5b990003dea9cede756b4fe389390201e31e4cdb6945bb70da8065477
discoveryKey: 51286fcfc94aba30b3cb3728370efabc53c66363c505b6f16e269b7f3c831e65
opened: true
closed: false
snapshotted: false
sparse: true
writable: true
length: 2
fork: 0
sessions: [ 2 ]
activeRequests: [ 0 ]
peers: [ 0 ]
),
opened: false,
closed: false,
_closing: null,
_inputs: [Array],
_outputs: [],
_inputsByKey: Map(0) {},
_outputsByKey: Map(0) {},
_keyCompressors: Map(0) {},
_viewSessions: [Set],
_readStreams: [],
_batchId: 0,
_lock: [Function],
_eagerUpdate: true,
_sparse: true,
_loadingInputsCount: 0,
_pendingUpdates: [],
view: [Hyperbee],
_onappend: [Function (anonymous)],
_opening: [Promise],
ready: [Function (anonymous)],
[Symbol(kCapture)]: false
},
opts: { sub: true },
bee: Hyperbee {
_events: [Object: null prototype] {},
_eventsCount: 0,
_maxListeners: undefined,
opening: null,
closing: null,
opened: false,
closed: false,
feed: [LinearizedCoreSession],
core: [LinearizedCoreSession],
keyEncoding: [Object],
valueEncoding: [Object],
extension: null,
metadata: null,
lock: [Function],
sep: <Buffer 00>,
readonly: false,
prefix: <Buffer 65 76 65 6e 74 73 00 69 64 78 00>,
alwaysDuplicate: true,
_unprefixedKeyEncoding: [Object],
_sub: true,
_checkout: 0,
_view: true,
_onappendBound: null,
_ontruncateBound: null,
_watchers: null,
_entryWatchers: null,
_sessions: true,
_batches: [],
[Symbol(kCapture)]: false
}
}
}
well on line 108 of hyperbee/index.js it looks for core.core.bitfield
but core._core
exists and it does not have a bitfield
TypeError: Cannot read properties of undefined (reading 'bitfield')
at TreeNode.preload (/hyperbee/index.js:108:32)
const bitfield = core.core.bitfield
at new TreeNode (/hyperbee/index.js:101:10)
this.preload()
at BlockEntry.getTreeNode (/hyperbee/index.js:297:12)
return new TreeNode(this, entry.keys, entry.children, offset)
at Batch.getRoot (/hyperbee/index.js:674:52)
return (await this.getBlock(this.version - 1)).getTreeNode(0)
at async Batch._get (/hyperbee/index.js:751:16)
let node = await this.getRoot(false) 🚨?
at async Batch.get (/hyperbee/index.js:738:14)
return await this._get(key, encoding)
at async Autodeebee.get (/hyperdeebee/autodeebee.js:65:12)
return await this.bee.get(key)
at async Collection.indexExists (/hyperdeebee/index.js:244:20)
await this.idxs.get(name)
at async Collection.createIndex (/hyperdeebee/index.js:218:20)
await this.indexExists(name)
at async createDB (/hyper-nostr/db.js:19:3)
await events.createIndex(['kind'])
I found a fork of the original hyperbeedee
that was last updated 3 weeks ago
WOW!! @Ruulul look at these new commits! https://github.com/cayasso/hyperbeedeebee/commit/53eaefe9f8cacdc4233f0ad2fb9e095076030bbe
It requires this https://www.npmjs.com/package/sub-encoder
made for hyperbee!
For the code: