Skip to content
This repository was archived by the owner on Jan 14, 2020. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 21 additions & 18 deletions packages/origin.js/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
## Introduction

Welcome to the origin.js documentation! origin.js is a Javascript library for interacting with the Origin protocol.
Using the library you can create new listings from your applications, purchase them, or update them from your own off-chain applications.
Using the library you can create new listings from your applications, purchase them, or update them from your own off-chain applications.

More information can be found at [Origin Platform Readme](/README.md)
More information can be found at [Origin Platform Readme](/README.md).

### Warning
This is still an alpha version which will evolve significantly before the main net release.
This is still an alpha version which will evolve significantly before the main net release.


## Install
## Install

### NPM
```
Expand All @@ -24,40 +24,42 @@ yarn add @originprotocol/origin
```

### Local
For developing on `origin.js`, it is better to link the package rather than installing it. (Otherwise you would need to run `npm build` everytime you made a change to the package.)

In the directory `./packages/contracts/` run:
```
truffle compile
```
This will create the `.json` files for our solidity contracts.
This will create the `.json` files for our solidity contracts.

In the directory `./packages/origin.js` run:
Next, you will need to start your local development blockchain.

In the same directory run:
```
npm link
truffle develop
```

Now change tabs (or diectories) to the repo for your DApp (for example, the [Origin demo-dapp](https://github.com/OriginProtocol/demo-dapp)) run:
Then, you will need to deploy your contracts.

In the same directory run:
```
npm link @originprotocol/origin
migrate --reset
```
This will create a symlink, direcly linking the dapp to your local `origin.js` package.

Next, you will need to start your local development blockchain.
Finally, you will need to build the node module. For developing on `origin.js`, it is better to link the package rather than installing it. (Otherwise you would need to run `npm build` everytime you made a change to the package.)

In the directory `./packages/contracts/` run:
In the directory `./packages/origin.js` run:
```
truffle develop
npm link
```

Then in the console run:
Now change tabs (or directories) to the repo for your DApp (for example, the [Origin demo-dapp](https://github.com/OriginProtocol/demo-dapp)) and run:
```
migrate --reset
npm link @originprotocol/origin
```
This will create a symlink, direcly linking the DApp to your local `origin.js` package.

## Import


## Import
```
import { contractService, ipfsService, originService } from '@originprotocol/origin'
```
Expand Down Expand Up @@ -108,4 +110,5 @@ Tests are automatically rerun when source or test code is changed.
Run a subset of tests using the `grep` query string parameter, for example: http://localhost:8081/?grep=IpfsService

## Documentation

Needed