hypercore-protocol / hyperspace Goto Github PK
View Code? Open in Web Editor NEWHypercores, batteries included.
License: MIT License
Hypercores, batteries included.
License: MIT License
In the server.js
the networker.configure()
method (required for announce) is dependent on db.listNetworkConfigurations()
(see below):
Lines 120 to 125 in 26d6d36
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.
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 #5GetBitfield
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
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 :
(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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.