Ocean CLI
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.
📚 Prerequisites
- node.js (Install from here)
- A Unix based operating system (Mac or Linux)
🏗 Installation & Usage
Clone and install
$ git clone https://github.com/oceanprotocol/ocean-cli.git
npm install
Set up environment variables
- 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'
- Optional set metadataCache URL if you want to use a custom Aquarius version instead of the default one.
export AQUARIUS_URL='XXXX'
- Optional set Provider URL if you want to use a custom Provider version instead of the default one.
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'
Build the TypeScript code
npm run build
Use
List available commands
npm run cli h
E.g. run publish command
npm run cli publish metadata/simpleDownloadDataset.json
🏛 License
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.