streamr-dev / cli-tools Goto Github PK
View Code? Open in Web Editor NEWCommand line tool for interacting with Streamr
Home Page: https://streamr.network
License: GNU Affero General Public License v3.0
Command line tool for interacting with Streamr
Home Page: https://streamr.network
License: GNU Affero General Public License v3.0
For consistency with terminology elsewhere, use subscribe
instead of listen
Like in npm or git we have
git status
git ci
git push
We could have, e.g.,
streamr publish
streamr subscribe
streamr create-stream
streamr get-stream
Add support for --partitionKey
in publish
command.
Crashes on
echo '{"message": "test"}' | publish-to-stream-dev c4iXIHoVSHGadSDBvsLWsw tester1-api-key
because it interprets echo's last new line as unparseable JSON.
Needs something of the likes of
if (!data.trim()) {
return done()
}
Found by @timoxley
Positional arguments are easier to quickly implement but named arguments would provide more flexibility for the user. Use, e.g., https://www.npmjs.com/package/command-line-args
Add new command for requesting a resend. Pipes messages line-by-line to stdout until resend is completed or there is no resend.
Usage: streamr-resend <streamId> [apiKey]
request resend of stream, prints JSON messages to stdout line-by-line
Options:
--last <n> request last N messages
--from <fromTs> request messages starting from given unix epoch
--to <toTs> request messages until given unix epoch
-V, --version output the version number
--dev use pre-defined development environment
--stg use pre-defined staging environment
--wsUrl <wsUrl> alternative websocket url to use
--httpUrl <httpUrl> alternative http url to use
-h, --help output usage information
Implement an interactive session mode, where you can send commands to the broker as you wish, and see the (raw) responses of the broker as well.
See https://keepachangelog.com/en/1.0.0/ and example here
If a command-line argument or option requires an integer and user provides something else, quit program with a user-friendly error message instead of trying to push to server.
E.g. streamr-listen-to-stream
or streamr-publish-to-stream
.
Source of idea @timoxley
E.g.,
writable.once('finish', () => {
client.disconnect() // or .ensureDisconnected() once streamr-client 2.x is published
})
Thanks again @timoxley for idea.
Rename NPM package to streamr-cli-tools
for consistency with rest of open source packages such as streamr-client
, streamr-broker
, and streamr-network
.
Pass publisherId
and msgChainId
to resend commands resend from
and resend range
via options.
streamr listen streamId streamApiKey
or streamr publish streamId streamApiKey
Will listen or publish to stream
Program exits with error
Response {
size: 0,
timeout: 0,
[Symbol(Body internals)]: { body: [PassThrough], disturbed: true, error: null },
[Symbol(Response internals)]:
{ url: 'https://www.streamr.com/api/v1/users/me',
status: 401,
statusText: 'Unauthorized',
headers: [Headers],
counter: 0 } },
body:
'{"code":"NOT_AUTHENTICATED","message":"Not authenticated via token or cookie"}' }
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.