From 14bc08ee99f4b87ea815d6b28dcc324ce75306b7 Mon Sep 17 00:00:00 2001 From: Stan James Date: Mon, 7 May 2018 17:08:58 -0600 Subject: [PATCH 1/5] =?UTF-8?q?Accidentally=20pushed=20a=20merge=20conflic?= =?UTF-8?q?t.=20=F0=9F=92=80=F0=9F=94=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/README.md b/README.md index 88ca4192..d3125c69 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,8 @@ ![origin_github_banner](https://user-images.githubusercontent.com/673455/37314301-f8db9a90-2618-11e8-8fee-b44f38febf38.png) -<<<<<<< HEAD -![origin_npm_version](https://img.shields.io/npm/v/origin.svg) ![origin_license](https://img.shields.io/npm/l/origin.svg) -======= ![origin_npm_version](https://img.shields.io/npm/v/origin.svg?style=flat-square&colorA=111d28&colorB=1a82ff) ![origin_license](https://img.shields.io/badge/license-MIT-6e3bea.svg?style=flat-square&colorA=111d28) ![origin_travis_banner](https://img.shields.io/travis/OriginProtocol/origin-js/master.svg?style=flat-square&colorA=111d28) ->>>>>>> develop # Origin Protocol From aa3ab24af0c30667967b2904df646ecdefc14756 Mon Sep 17 00:00:00 2001 From: Stan James Date: Mon, 14 May 2018 15:28:11 -0600 Subject: [PATCH 2/5] Big refactor of readme --- README.md | 207 ++++++++++++++++-------------------------------------- 1 file changed, 61 insertions(+), 146 deletions(-) diff --git a/README.md b/README.md index d3125c69..e6c801eb 100644 --- a/README.md +++ b/README.md @@ -12,189 +12,104 @@ Please refer to our [product brief](https://www.originprotocol.com/product-brief - [README for Javascript code](#originjs-documentation) -## Follow our progress and get involved +Documentation for origin.js is located here: http://docs.originprotocol.com/ -This repo is under active development. We welcome your participation! +### Warning +This is still an alpha version which will evolve significantly before the main net release. -1. [Join our #engineering channel on Discord](http://www.originprotocol.com/discord). +## Using origin-js in your project -2. Listen in on our weekly engineering call on Google Hangouts. It happens every week and everyone is welcome to listen in and participate. [Join us on Google Hangouts](https://meet.google.com/pws-cgyd-tqp) on Wednesdays at 9pm GMT ([Add to Calendar](https://calendar.google.com/event?action=TEMPLATE&tmeid=MHAyNHI3N2hzMjk5b3V2bjhoM2Q1ZWVzY2pfMjAxODA0MTFUMjAwMDAwWiBqb3NoQG9yaWdpbnByb3RvY29sLmNvbQ&tmsrc=josh%40originprotocol.com&scp=ALL)): +## As node package -| Pacific | Mountain | Central | Eastern | GMT | -|---------|----------|---------|---------|-----| -| Wed 1pm | Wed 2pm | Wed 3pm | Wed 4pm | Wed 9pm | +``` +npm install origin --save +``` +or +``` +yarn add origin +``` -3. Catch up on our meeting notes & weekly sprint planning docs (feel free to add comments): -- [Engineering meeting notes](https://docs.google.com/document/d/1aRcAk_rEjRgd1BppzxZJK9RXfDkbuwKKH8nPQk7FfaU/) -- [Weekly sprint doc](https://docs.google.com/document/d/1qJ3sem38ED8oRI72JkeilcvIs82oDq5IT3fHKBrhZIM) +### Plain javascript -4. Read our simple [contributing and style guide](CONTRIBUTING.md). +A browser-compatible plain javascript file `origin.js` is available in the [Releases section](https://github.com/OriginProtocol/origin-js/releases). A hosted version is at https://code.originprotocol.com/origin-js/origin-v0.5.10.js. -# What we're building +`npm build` will generate this file and save it to `dist/origin.js`. -This library is an abstraction layer for developers who want to build DApps on Origin Protocol, and is also used to build the [Origin Demo DApp](https://github.com/OriginProtocol/demo-dapp). +## Local development -The library will make it easy for sellers to do things like: +### 1. Clone this repo. +``` +git clone https://github.com/OriginProtocol/origin-js.git && cd origin-js +``` - - Create listings - - Update listings - - Delete listings - - Validate listings +If you would like to submit pull requests, you should instead fork this repo and then clone your fork. Note pull requests should always be made to the `develop` branch, which always has the latest commits. -And buyers to: +### 2. Install dependcies and link +``` +npm run install:dev +``` - - Browse listing - - Create bookings - - Update bookings - - Cancel bookings +`install:dev` is shortcut for `npm install && npm link`. Linking means that changes to `origin-js` code are immediately available to local DApps without an `npm install`. - # origin.js Documentation +### 3. Start the local blockchain and build origin-js - ## Introduction +``` +npm start +``` - 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. - - ### Warning - This is still an alpha version which will evolve significantly before the main net release. - - ## Using origin.js in your project - - ### Plain javascript - - A browser-compatible plain javascript file `origin.js` is available in the "Releases" tab, and will soon be hosted on originprotocol.com. It can be generated locally via `npm build` and will be placed in `dist/origin.js`. - - ## Install - - ### NPM - ``` - npm install @originprotocol/origin --save - ``` - - ### Yarn - ``` - yarn add @originprotocol/origin - ``` - - ### Local - -1. `git clone` your fork. Note that the latest commits will be on the `develop` - branch. So switch to that branch if you want to submit a PR or check out - recently merged code. - -1. Install:dev (shortcut for `npm install && npm link`). Linking makes this available as a local npm package for local dapp development. - ``` - npm run install:dev - ``` - -1. Start the localblockchain and create the build. Code changes will trigger a live rebuild. - ``` - npm start - ``` +Code changes will trigger a live rebuild. - In order to conduct test transactions, you can create a new wallet using the following seed phrase (Mnemonic): - - _**Be careful to back up the seed phrases and private keys for any existing wallets before creating a new one.**_ - ``` - candy maple cake sugar pudding cream honey rich smooth crumble sweet treat - ``` - -1. To develop against a working dapp and UI, see [the instructions in our demo dapp](https://github.com/OriginProtocol/demo-dapp#developing-with-a-local-chain). - - ## Import - - ``` - import Origin from '@originprotocol/origin' - - let configOptions = {} - - let { contractService, ipfsService, originService } = new Origin(configOptions) - ``` - - ## Configuration Options - - Config options are passed into the Origin constructor at instantiation. - - ``` - let configOptions = { - option: 'value' - } - let origin = new Origin(configOptions) - ``` +### 4. Use with local Demo DApp - Valid options: - - `ipfsDomain` - - `ipfsApiPort` - - `ipfsGatewayPort` - - `ipfsGatewayProtocol` - - `attestationServerUrl` +To interact with your local origin-js and local blockahin, see [the instructions in our Demo DApp](https://github.com/OriginProtocol/demo-dapp#developing-with-a-local-chain). - ## IPFS - If you are running a local IPFS daemon then set the following config options ([see config options](#configuration-options)): +## Tests - ``` - { - ipfsDomain: '127.0.0.1', - ipfsApiPort: '5001', - ipfsGatewayPort: '8080', - ipfsGatewayProtocol: 'http' - } - ``` - - Configure your local IPFS daemon with the following settings to avoid CORS errors: - - ``` - ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["localhost:*"]' - ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods '["GET", "POST", "PUT"]' - ipfs config --json API.HTTPHeaders.Access-Control-Allow-Credentials '["true"]' - ``` +### Command Line (All Tests) - ## Troubleshooting +Our full test suite can be run with: - ### Python 3 +``` +npm run test +``` - If you have Python 3 installed, you may see this error when installing dependencies: + Note: you should *not* have the server running at this time, as these tests start their own local blockchain instance. - ``` - gyp ERR! stack Error: Python executable "/Users/aiham/.pyenv/shims/python" is v3.6.4, which is not supported by gyp. - ``` + ### Command Line (Only Solidity Tests) - Resolve this by configuring npm to use Python 2 (where python2.7 is a binary accessible from your $PATH): +Our Solidity tests (which use [Truffle](http://truffleframework.com/docs/getting_started/javascript-tests)) are located at `contracts/test`. ``` - npm config set python python2.7 + npm run test:contracts ``` - ## Tests +Note: you should *not* have the server running at this time, as these tests start their own local blockchain instance. - ### Command Line (All Tests) +### Browser Tests -Our full test suite can be run with: +A subset of our tests can be run from the browser. These tests are automatically served at `http://localhost:8081` when you run `npm start`. These tests are automatically rerun when source or test code is changed. - ``` - npm run test - ``` +Run a subset of these tests using the `grep` query string parameter, for example: http://localhost:8081/?grep=IpfsService - Note: you should *not* have the server running at this time, as these tests start their own local blockchain instance. +## Troubleshooting - ### Command Line (Only Solidity Tests) +### Python 3 -Our Solidity tests (which use [Truffle](http://truffleframework.com/docs/getting_started/javascript-tests)) are located at `contracts/test`. - - ``` - npm run test:contracts - ``` - - Note: you should *not* have the server running at this time, as these tests start their own local blockchain instance. +If you have Python 3 installed, you may see this error when installing dependencies: - ### Browser Tests +``` +gyp ERR! stack Error: Python executable "/Users/aiham/.pyenv/shims/python" is v3.6.4, which is not supported by gyp. +``` - A subset of our tests can be run from the browser. These tests are automatically served at `http://localhost:8081` when you run `npm start`. These tests are automatically rerun when source or test code is changed. +Resolve this by configuring npm to use Python 2 (where python2.7 is a binary accessible from your $PATH): - Run a subset of these tests using the `grep` query string parameter, for example: http://localhost:8081/?grep=IpfsService +``` +npm config set python python2.7 +``` + +## Contributing - ## Documentation +Origin is an 100% open-source and community-driven project and we welcome contributions of all sorts. There are many ways to help, from reporting issues, contributing code, and helping us improve our community. - Needed +To get involved, please join our [Discord channel](https://discord.gg/jyxpUSe) and review our [guide to contributing](https://docs.originprotocol.com/#contributing). From c09ad1a5c3a510647fc1fa8a4d3567dffb8be90c Mon Sep 17 00:00:00 2001 From: Stan James Date: Mon, 14 May 2018 15:37:57 -0600 Subject: [PATCH 3/5] Reworked intro text of readme --- README.md | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index e6c801eb..f17ebc6b 100644 --- a/README.md +++ b/README.md @@ -4,18 +4,23 @@ ![origin_license](https://img.shields.io/badge/license-MIT-6e3bea.svg?style=flat-square&colorA=111d28) ![origin_travis_banner](https://img.shields.io/travis/OriginProtocol/origin-js/master.svg?style=flat-square&colorA=111d28) -# Origin Protocol +# origin-js -Origin Protocol is a library of javascript code and Ethereum smart contracts which allow anyone to create decentralized marketplaces, including for fractional usage. +origin-js is a library of javascript code and Ethereum smart contracts which allow anyone to create decentralized marketplaces, including for fractional usage. It is an open source projectd created by [Origin Protocol](https://www.originprotocol.com/). -Please refer to our [product brief](https://www.originprotocol.com/product-brief) and [technical whitepaper](https://www.originprotocol.com/whitepaper) for more detail. +To learn more about Origin Protocol, please read our [product brief](https://www.originprotocol.com/product-brief) and [whitepaper](https://www.originprotocol.com/whitepaper) for a high-level description of what we're building and why it matters. Our official website is [https://www.originprotocol.com](https://www.originprotocol.com). - - [README for Javascript code](#originjs-documentation) +⚠️ This is an alpha version which is not suitable for production environments. -Documentation for origin.js is located here: http://docs.originprotocol.com/ +## Documentation +[origin-js documentation](http://docs.originprotocol.com/) -### Warning -This is still an alpha version which will evolve significantly before the main net release. +## Demo + +origin-js is showcased in our Demo DApp currently running on the Rinkeby testnet. +- [Overview and step-by-step instructions](https://medium.com/originprotocol/origin-demo-dapp-is-now-live-on-testnet-835ae201c58) +- [Live Demo](http://demo.originprotocol.com) +- [Github Repo](https://github.com/OriginProtocol/demo-dapp) ## Using origin-js in your project From e4198d5158b08606b153351f31c16986a00880f8 Mon Sep 17 00:00:00 2001 From: Stan James Date: Mon, 14 May 2018 15:38:52 -0600 Subject: [PATCH 4/5] typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f17ebc6b..64531de8 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ # origin-js -origin-js is a library of javascript code and Ethereum smart contracts which allow anyone to create decentralized marketplaces, including for fractional usage. It is an open source projectd created by [Origin Protocol](https://www.originprotocol.com/). +origin-js is a library of javascript code and Ethereum smart contracts which allow anyone to create decentralized marketplaces, including for fractional usage. It is an open source project created by [Origin Protocol](https://www.originprotocol.com/). To learn more about Origin Protocol, please read our [product brief](https://www.originprotocol.com/product-brief) and [whitepaper](https://www.originprotocol.com/whitepaper) for a high-level description of what we're building and why it matters. Our official website is [https://www.originprotocol.com](https://www.originprotocol.com). From 6411c9c3431ef57b73608db8c9645c880a3b868d Mon Sep 17 00:00:00 2001 From: Stan James Date: Mon, 14 May 2018 15:43:22 -0600 Subject: [PATCH 5/5] Cleaned up raw origin.js section --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 64531de8..e53ff8c9 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,10 @@ yarn add origin ### Plain javascript -A browser-compatible plain javascript file `origin.js` is available in the [Releases section](https://github.com/OriginProtocol/origin-js/releases). A hosted version is at https://code.originprotocol.com/origin-js/origin-v0.5.10.js. +A browser-compatible plain javascript file `origin.js` is available in the [Releases section](https://github.com/OriginProtocol/origin-js/releases). A hosted version can be directly included in your html as: +```html + +``` `npm build` will generate this file and save it to `dist/origin.js`.