Included is an example script app.js that sends random data to a Streamr stream. Also included is package.json for dependency management and devops infastructure code (e.g. Dockerfile).
- Make sure you have node and npm installed.
node -v
should be v8.0.0 or greater.
- Login or register to Streamr
- Grab your user API key from here
- Export the API key with
export API_KEY=<YOUR_API_KEY_FROM_ABOVE>
git clone git@github.com:streamr-dev/data-integration-hackathon.git
npm install
- Open app.js in your IDE/editor of choice
- Edit constant
STREAM_NAME
(use your imagination, stream does not have to exist yet) npm start
- If everything works, you should see
Event sent: {...}
style logging in standard output. - Go to Streams list page, find your newly created Stream, and ensure data is flowing in by looking at the Recent Events tab, e.g.,
- Create a new repository on GitHub (do not initialize with README!)
git remote set-url origin <REPOSITORY_URL>
git push
- Customize
package.json
if needed - Make sure
npm start
runs your script - Make sure all dependencies are present in
package.json
(You can test this by removing node_modules, doingnpm install
and then making surenpm start
starts without errors) - Make sure you have configured the fields of your streams in Streamr.com (use autodetect for convenience).
Dependencies:
- Install travis cli
sudo gem install travis
- Note: If it is your first run extra steps will follow to login with github credentials (Call Mikhael in case of doubt) and you will need to execute the previouse step again.
1 . Update travis_scripts/docker-build.sh
export OWNER=<your docker name>
export IMAGE_NAME=<the name of the image>
2 . Run the following command
travis init
3 . Add encrypted docker credentials to .travis.yaml
travis encrypt DOCKER_USER="<docker user>" --add -r <git_owner/git_repo>
travis encrypt DOCKER_PASS="<docker password>" --add -r <git_owner/git_repo>
4 . Commit changes to repo
5 . Activate Travis Builds at https://travis-ci.com/profile/
API key is wrong:
Error: Request to https://www.streamr.com/api/v1/streams?name=my-sweet-stream&public=false returned with error code 401: {"code":"NOT_AUTHENTICATED","message":"Not authenticated via token or cookie"}