CLI tool to interact with the oceanprotocol's JavaScript library to privately & securely publish, consume and run compute on data.
With the Ocean CLI tool you can:
- Publish data services: downloadable files or compute-to-data.
- Edit existing assets.
- Consume data services, ordering datatokens and downloading data.
- Compute to data on public available datasets using a published algorithm.
Ocean CLI is using ocean.js Javascripti library which is part of the Ocean Protocol toolset.
If you run into problems, please open up a new issue.
- node.js (Install from here)
- A Unix based operating system (Mac or Linux)
$ git clone https://github.com/oceanprotocol/ocean-cli.git
npm install
- Set a private key(by exporting env "PRIVATE_KEY") or a mnemonic (by exporting env "MNEMONIC")
export PRIVATE_KEY="XXXX"
or
export MNEMONIC="XXXX"
- Set an RPC
export RPC='XXXX'
- Set an Ocean Node URL
export NODE_URL='XXXX'
- Optional set metadataCache URL if you want to use a custom Aquarius version instead of the default one. This will not be used if you have set an Ocean Node url.
export AQUARIUS_URL='XXXX'
- Optional set Provider URL if you want to use a custom Provider version instead of the default one. This will not be used if you have set an Ocean Node url.
export PROVIDER_URL='XXXX'
- Optional set ADDRESS_FILE if you want to use a custom set of smart contract address
export ADDRESS_FILE='path-to-address-file'
npm run build
List available commands
npm run cli h
E.g. run publish command
Make sure to update chainId from the assets from metadata
folder.
npm run cli publish metadata/simpleDownloadDataset.json
Copyright ((C)) 2023 Ocean Protocol Foundation
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.