πŸ¦„ Web app for consumers to explore, download, and publish data assets.
Clone or download
Latest commit 09210a2 Dec 14, 2018

README.md

banner

Pleuston

banner

πŸ¦„ Web app for consumers to explore, download, and publish data assets.

Docker Build Status Build Status Codacy Badge js oceanprotocol css bigchaindb

Pleuston [ˈplustΙ™n]: organisms that live in the thin surface layer existing at the air-water interface of a body of water as their habitat


πŸ²πŸ¦‘ 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. πŸ¦‘πŸ²

Main issues right now:

  • assets can only be purchased if they're hosted in Azure storage account
  • orders screen is not fully working

Table of Contents


Features

This repository houses Pleuston, the reference web app for consumers to explore, download, and publish data assets within the Ocean Protocol network.

  • Connect to all required Ocean Protocol components: Keeper & Aquarius
  • Register and publish data assets
  • Explore, buy, and download data assets

Pleuston is a single page React app, initially bootstrapped with create-react-app, but ejected from it.

Prerequisites

  • Node.js >=8
  • npm
  • Ocean Protocol components
  • MetaMask

To start development with Pleuston you first have to get all the other Ocean Protocol components up and running.

ocean-components

The simplest way is to use our main script utilizing docker-compose from the 🐳 docker-images repository, and pass the option to skip the Pleuston image in there:

git clone git@github.com:oceanprotocol/docker-images.git
cd docker-images/

./start_ocean.sh --no-pleuston --latest

This will start up all required components:

πŸ‹ aquarius

You now have a locally running Aquarius backend application exposed under http://localhost:5000.

πŸ’§ keeper-contracts

You now have a locally running RPC client with all the contracts from keeper-contracts deployed to it, exposed under http://localhost:8545.

Storage Providers

As of right now, pleuston requires asset files to be stored in Azure Cloud Storage before registering them through the UI. For more convenience we will integrate connections to various cloud storage providers.

screen shot 2018-10-18 at 12 48 53

Azure Storage

App includes an OAuth connection to your Azure account. Once authorized, assets can be chosen from a file list within pleuston.

Note: Currently, Azure Storage only allows listing containers with OAuth credentials. Listing blobs in containers and operations on blobs can't be done with OAuth credentials until that feature is out of preview. Until then, manually added credentials are required in config/cloudStorage.js

Development

After the Docker containers from the above step are up, you can start your local development version of Pleuston:

git clone git@github.com:oceanprotocol/pleuston.git
cd pleuston/

npm i
npm start

This should output a message as follows:

Compiled successfully!

You can now view @oceanprotocol/pleuston in the browser.

  Local:            http://localhost:3000/

MetaMask

Be sure to login into your MetaMask account and either select:

  • the Kovan test network, or
  • Localhost 8545

The latter will connect you to the RPC client running inside Docker.

Production build

You can inspect a full production build by creating it first, and then run a local web server on top of the build output, e.g. serve:

# create production build
npm run build

serve -s build/
# go to http://localhost:5000

Configuration

All required components to get Pleuston running are pre-configured and started with the above docker-compose command, and the web app is configured to connect to them.

If you want to change and run Pleuston against your own deployed components, head over to the config/ocean.js file and modify the respective values.

To run your application over SSL, set the scheme values in config/ocean.js to https:

module.exports = {
    nodeScheme: 'http',
    nodeHost: 'localhost',
    nodePort: 8545,

    aquariusScheme: 'http',
    aquariusHost: 'localhost',
    aquariusPort: 5000,

    brizoScheme: 'https',
    brizoHost: 'localhost',
    brizoPort: 8030,

    parityScheme: 'http',
    parityHost: 'localhost',
    parityPort: 8545,

    secretStoreScheme: 'http',
    secretStoreHost: 'localhost',
    secretStorePort: 12001,

    secretStoreThreshold: 0,
    secretStorePassword: 'unittest',
    secretStoreAddress: '0xed243adfb84a6626eba46178ccb567481c6e655d'
}

Testing

Automatic tests are setup via Travis, executing npm test.

The tests run:

  • linting checks with ESLint and Stylelint
  • basic rendering tests for components with Jest

While code coverage status will be reported in the console and on Travis, coverage information won't be uploaded to Codacy for any Pull Request from a forked repo. That is because of a security restriction in Travis.

Code style

Code linting is setup with ESLint and stylelint following eslint-config-oceanprotocol and stylelint-config-bigchaindb.

There's a npm script setup which runs only linting tests:

npm run lint

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.