Skip to content

Problem 6: the upvote seems not replicated to the second machine #6

@raphael10-collab

Description

@raphael10-collab

(PC):

(base) raphy@pc:~/hypercore/p2p-multiwriter-with-autobase/solutions/06$ hrepl hypernews.js 
Autobase setup. Pass this to run this same setup in another instance:

hrepl hypernews.js -n 97526323adf7b9c4 -w 97526323adf7b9c40f72daa280646051d539b757e4b03cf5a3e8b3c5f8defac0 -i 68919658e1f6ffb83c013145fcd21c8323f636203cf427e16934e1a24a5d700c

To use another storage directory use --storage ./another
To disable swarming add --no-swarm

API: hypernews (object)
> await hypernews.post('hello world')
> await hypernews.post('sup earth')
> await hypernews.upvote('ef72c47db2a417b486c04a1b823eec2f95f2e3d373395b3bbdf80cbaf0a8aed5')
> .log hypernews.all()
try { for await (const data of hypernews.all()) console.log(data) } catch { console.log(hypernews.all()) }
{
  hash: 'b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9',
  votes: 0,
  data: 'hello world'
}
{
  hash: 'ef72c47db2a417b486c04a1b823eec2f95f2e3d373395b3bbdf80cbaf0a8aed5',
  votes: 1,
  data: 'sup earth'
}

(laptop):

(base) marco@marco-U36SG:~/hypercore/p2p-multiwriter-with-autobase/solutions/06$ hrepl hypernews.js -n 97526323adf7b9c4 -w 97526323adf7b9c40f72daa280646051d539b757e4b03cf5a3e8b3c5f8defac0 -i 68919658e1f6ffb83c013145fcd21c8323f636203cf427e16934e1a24a5d700c
Autobase setup. Pass this to run this same setup in another instance:

hrepl hypernews.js -n 97526323adf7b9c4 -w 625eded7547fcb00ada55031c09343614cb01569d1b1e5484d971d5c35be37f0 -w 97526323adf7b9c40f72daa280646051d539b757e4b03cf5a3e8b3c5f8defac0 -i adeb6b3e1b220495cc13b684af5880660250f48a1065881a1812a9b52c5861e2 -i 68919658e1f6ffb83c013145fcd21c8323f636203cf427e16934e1a24a5d700c

To use another storage directory use --storage ./another
To disable swarming add --no-swarm

API: hypernews (object)
> .log hypernews.all()
try { for await (const data of hypernews.all()) console.log(data) } catch { console.log(hypernews.all()) }
{
  hash: 'b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9',
  votes: 0,
  data: 'hello world'
}
{
  hash: 'ef72c47db2a417b486c04a1b823eec2f95f2e3d373395b3bbdf80cbaf0a8aed5',
  votes: 0,
  data: 'sup earth'
}
> 

It seems that the upvote is not replicated to the second machine

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