Giter Club home page Giter Club logo

hyperspace's People

Contributors

andrewosh avatar frando avatar mafintosh avatar pfrazee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hyperspace's Issues

hyperspace cores are not announced: hyperspace/server.js is not calling db.putNetworkConfiguration() anywhere

In the server.js the networker.configure() method (required for announce) is dependent on db.listNetworkConfigurations() (see below):

hyperspace/server.js

Lines 120 to 125 in 26d6d36

async _rejoin () {
if (this.noAnnounce) return
const networkConfigurations = await this.db.listNetworkConfigurations()
for (const config of networkConfigurations) {
if (!config.announce) continue
const joinProm = this.networker.configure(config.discoveryKey, {

However, no where in the server.js file the db.putNetworkConfiguration() is called, which means the db.listNetworkConfigurations() always returns empty, thus the cores are not announced.

Allow to track sparsely synced hypercores

Currently, the daemon emits an append event if new blocks are appended to a hypercore (either locally or by a remote for synced cores). However, no event is emitted when new blocks are downloaded for a sparsely synced hypercore.

I'd like to explore kappa-style apps on top of hyperspace that would index all downloaded blocks on a set of hypercores. For that to work efficiently, I think two things would be needed:

  • OnDownload method for the hypercore service that is emitted for each block downloaded with { id, seq }. Maybe this method should only be called if requested for a hypercore? So WatchDownloads({ id }), UnwatchDownloads({ id }) and OnDownload({ id, seq }). Or just emit it always, as OnAppend is at the moment. See #5
  • A way to quickly access which blocks have been downloaded for a hypercore, so maybe a GetBitfield or similar. This can be worked around by iterating and calling Has for each seq, which might be good enough. (This will be needed on each startup of the indexer client, because it cannot know if download events happened while it wasn't running). See #7

'/tmp/hyperspace.sock'

/tmp/hyperspace.sock is too broad and permissive. It limits you to one hyperspace per system instead of one per user. It should only be readable by the user who created it. Currently, it’s world-readable.

It should probably live in ~/.hyperspace/socket (where it could also act like a singleton lock) or at least /tmp/$uid/hyperspace.socket.

It seems that `yarn global add @hyperspace/cli` does not work

It seems that yarn global add @hyperspace/cli does not work :

(base) marco@marco-U36SG:~/hypercore/hypercore-protocol$ npm uninstall -g @hyperspace/cli
npm WARN deprecated [email protected]: "Please update to latest v2.3 or v2.2"
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.3.2 (node_modules/@hyperspace/cli/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.1.1 (node_modules/@hyperspace/cli/node_modules/mocha/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

removed 387 packages in 3.179s
(base) marco@marco-U36SG:~/hypercore/hypercore-protocol$ yarn global add @hyperspace/cli
yarn global v1.22.5
warning package.json: No license field
[1/4] Resolving packages...
warning @hyperspace/cli > random-words > mocha > [email protected]: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
warning @hyperspace/cli > random-words > mocha > chokidar > [email protected]: "Please update to latest v2.3 or v2.2"
warning @hyperspace/cli > username > execa > [email protected]: cross-spawn no longer requires a build toolchain, use it instead
[2/4] Fetching packages...
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "@hyperspace/[email protected]" with binaries:
      - hyp
Done in 81.66s.
(base) marco@marco-U36SG:~/hypercore/hypercore-protocol$ hyp info
bash: /home/marco/.nvm/versions/node/v14.17.0/bin/hyp: No such file or directory
(base) marco@marco-U36SG:~/hypercore/hypercore-protocol$ hyp daemon start
bash: /home/marco/.nvm/versions/node/v14.17.0/bin/hyp: No such file or directory
(base) marco@marco-U36SG:~/hypercore/hypercore-protocol$ 

While npm install -g @hyperspace/cli does actually work:

(base) marco@marco-U36SG:~/hypercore/hypercore-protocol$ npm install -g @hyperspace/cli
npm WARN deprecated [email protected]: "Please update to latest v2.3 or v2.2"
npm WARN deprecated [email protected]: cross-spawn no longer requires a build toolchain, use it instead
/home/marco/.nvm/versions/node/v14.17.0/bin/hyp -> /home/marco/.nvm/versions/node/v14.17.0/lib/node_modules/@hyperspace/cli/bin/hyp.js

> [email protected] install /home/marco/.nvm/versions/node/v14.17.0/lib/node_modules/@hyperspace/cli/node_modules/fd-lock
> node-gyp-build


> [email protected] install /home/marco/.nvm/versions/node/v14.17.0/lib/node_modules/@hyperspace/cli/node_modules/fsctl
> node-gyp-build


> [email protected] install /home/marco/.nvm/versions/node/v14.17.0/lib/node_modules/@hyperspace/cli/node_modules/sodium-native
> node-gyp-build "node preinstall.js" "node postinstall.js"


> [email protected] install /home/marco/.nvm/versions/node/v14.17.0/lib/node_modules/@hyperspace/cli/node_modules/utp-native
> node-gyp-build


> [email protected] install /home/marco/.nvm/versions/node/v14.17.0/lib/node_modules/@hyperspace/cli/node_modules/leveldown
> node-gyp-build

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.3.2 (node_modules/@hyperspace/cli/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.1.1 (node_modules/@hyperspace/cli/node_modules/mocha/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

+ @hyperspace/[email protected]
added 387 packages from 213 contributors in 98.05s
(base) marco@marco-U36SG:~/hypercore/hypercore-protocol$ hyp info
The daemon is not active. Please run:

  hyp daemon start

(base) marco@marco-U36SG:~/hypercore/hypercore-protocol$ hyp daemon start
Hyperspace daemon started
Mirroring daemon started
Daemon is running.
(base) marco@marco-U36SG:~/hypercore/hypercore-protocol$ hyp info
No hypers active.
(base) marco@marco-U36SG:~/hypercore/hypercore-protocol$ 

node : v14.17.0
O.S. : Ubuntu 20.04 Desktop

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.