1
0
mirror of https://github.com/oceanprotocol-archive/squid-js.git synced 2024-02-02 15:31:51 +01:00
🦑 JavaScript client library for Ocean Protocol
Go to file
2018-11-16 15:15:45 +01:00
.github added github templates + CODEOWNERS 2018-09-14 10:51:03 +02:00
src adapt changes to ddo condition structure 2018-11-16 15:15:45 +01:00
test fixed re-decode of json response from aquarius 2018-11-16 11:35:28 +01:00
.bumpversion.cfg v0.1.18 2018-11-16 14:27:45 +01:00
.gitignore added doc script 2018-10-10 11:46:02 +02:00
.npmignore added doc script 2018-10-10 11:46:02 +02:00
.travis.yml Removed variable condition 2018-11-07 10:16:15 +01:00
bumpversion.sh added bumpversion 2018-11-06 11:46:40 +01:00
LICENSE Initial commit 2018-08-20 15:42:24 +02:00
package-lock.json v0.1.18 2018-11-16 14:27:45 +01:00
package.json v0.1.18 2018-11-16 14:27:45 +01:00
README.md update readme 2018-11-09 11:20:47 +01:00
SQUID_INTERFACE.md removed old squid interface, added refence to the right place 2018-10-10 12:10:01 +02:00
tsconfig.json exclude test, we have separate file for it 2018-10-11 14:24:22 +02:00
tslint.json new linter styles 2018-10-02 10:06:26 +02:00

banner

squid-js

🦑 JavaScript client library for Ocean Protocol oceanprotocol.com

npm Travis (.com) GitHub contributors Codacy Badge js oceanprotocol Greenkeeper badge


🐲🦑 THERE BE DRAGONS AND SQUIDS. This is in alpha state and you can expect running into problems. If you run into them, please open up a new issue. 🦑🐲


Table of Contents


Get started

Start by adding the package to your dependencies:

npm i @oceanprotocol/squid --save

The package exposes Ocean and Logger which you can import in your code like this:

// ES6
import { Ocean, Logger } from '@oceanprotocol/squid'

// ES2015
const { Ocean, Logger } = require('@oceanprotocol/squid')

You can then connect to a running Keeper & Aquarius instance, e.g.:

const ocean = await new Ocean({
    nodeUri: "http://localhost:8545",
    aquariusUri: "http://localhost:5000",
    brizoUri: "https://localhost:8030",
    parityUri: "http://localhost:9545",
    secretStoreUri: "https://secret-store.dev-ocean.com",
    threshold: 2,
    password: "unittest",
    address: "0xed243adfb84a6626eba46178ccb567481c6e655d",
})

Development

To start development you need to:

npm i
npm start

This will start a watcher for changes of the code.

Production build

npm run build

npm releases

For a new patch release, execute on the machine where you're logged into your npm account:

npm run release

In case you have 2FA setup on npm.js, pass a code as One Time Password:

npm run release --otp <yourcode>

Command is powered by release-it package, defined in the package.json.

That's what the command does without any user interaction:

  • create release commit by updating version in package.json
  • create tag for that release commit
  • push commit & tag
  • create a new release on GitHub, with change log auto-generated from commit messages
  • publish to npm as a new release

If you want to create a minor or major release, use these commands:

npm run release-minor
npm run release-major

License

Copyright 2018 Ocean Protocol Foundation Ltd.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.