Skip to content

how to sync bee #46

@shikhars371

Description

@shikhars371

hi here is my backend.js

const { Client } = require('hyperspace')
const HyperBee = require('hyperbee')
const { kvPairs : dictionaryPairs } = require('websters-english-dictionary')

start()

async function start() {
const { corestore, replicate } = new Client()
const store = corestore()

const core = store.get({ name: 'dictionary' })

const db = new HyperBee(core, { keyEncoding: 'utf-8', valueEncoding: 'utf-8' })

const batch = db.batch()
for (const { key, value } of dictionaryPairs()) {
await batch.put(key, value)
}

await batch.flush()

//print bee key
console.log(' bee ', db.feed.key.toString('hex'))

// Now announce on hyp
await replicate(core)
}

when i am running this code its giving me a console a key on console :

ba118da4eb768dde70d6c1e016ff5b26f3e97ef91ff097c9f21d7c4f8c4699e1
I am seeding the above key as : hyp seed ba118da4eb768dde70d6c1e016ff5b26f3e97ef91ff097c9f21d7c4f8c4699e1

now on second server i am doing :: hyp sync ba118da4eb768dde70d6c1e016ff5b26f3e97ef91ff097c9f21d7c4f8c4699e1 ------ above line giving me error:
root@tower6:~# hyp sync ba118da4eb768dde70d6c1e016ff5b26f3e97ef91ff097c9f21d7c4f8c4699e1
Error: The hyper:// was expected to be a hyperdrive, got hyperbee

please help me how to seed and sync bee

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions