Git Product home page Git Product logo

origin-js's Introduction

origin-js's People

Contributors

aiham avatar ambertch avatar conejoninja avatar crazybuster avatar cuongdo avatar danielvf avatar franckc avatar jessieay avatar jordajm avatar joshfraser avatar jsulinski avatar mek32390 avatar micahalcorn avatar nick avatar ryana avatar sparrowdom avatar tomlinton avatar tyleryasaka avatar wanderingstan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

origin-js's Issues

Automatic code style formatting

Currently we have many different javascript formatting styles. To avoid chaos and arguments, we want to use a standard tool to automatically format our javascript source.

We've chosen the prettier tool.

We'll be using the NPM style (no unnecessary semicolons, 2 spaces)

  • Add prettier to dependencies
  • Put prettier config in platform package.jsons
  • Add a npm command to format our documents
  • Update contributing document
  • Format our existing javascript

Anything I'm missing @wanderingstan?

Update origin.js documentation

Updates will need to be made on the docs repo, but want to track in this release.

https://github.com/OriginProtocol/docs

Changes reflected on docs.originprotocol.com

  • Fix really outdated stuff
  • Add instructions on workings on local docs
  • Add basic Listing api use with examples
  • Explain how photos work
  • Schema details
  • IPFS Service

Think through listing contract mutability vs. immutability

Lots of tradeoffs to think through

  • When we have new purchasing contract, we want to capture the state of the listing that I am buying (at that time)
  • If the listing contract is immutable, then we just need to reference the contract
  • If the listing contract can be updated, then we need to actually snapshot the contract at that time
  • People will want to update listings - that’s definitely the way that users will want to interact
  • New price, images, metadata
  • Need to build pros and cons of both approaches

UI: Show buyer timeout information

When a Purchase is in a BUYER_PENDING stage, after 21 days it automatically moves over.

We'll need to show where this countdown is in the UI when it is active, probably on the purchase detail page and My Listings page.

Do we want to show this only to the buyer and seller?

  • Add a Purchase.get method to origin.js, which includes timeout
  • Add UI element to purchase detail
  • Add UI element to my listings

Repo structure breaks npm builds with two packages

We currently have 2 npm packages in this repo: one for the contracts and one for origin.js. .

This caused my npm build in origin.js to fail, as I hadn't yet done an npm install for the contracts. I suspect this would be a nightmare for new developers, and seems to over complicate things.

@aiham , I recall you saying it was strange to have dependencies outside the directory of the package.json. What would you think would be a better layout?

Our original idea was to mimic the layout of RequestNetwork, who do indeed have two packages. They seem to solve it by having the .js package include the smartcontract package as a dependency. This could work, but feels strange to have the contracts as an npm package.

@DanielVF : any thoughts on this?
@Gzing : You were following requestNetwork; have you heard any discussion on their side about this?

Add auto testing of origin.js

Presumably using codeship, though of course we could have discussion around other options since we haven't started using it.

@Gzing - I've added you to our team on codeship, let me know if you need anything else on that front.

  • Is it worth creating similar issues for website, demo-dapp?
  • identity-playground does have tests defined. Shall we create an issue there as well?

Create network utility functions in origin.js

Network utility to post/fetch from smart contract & IPFS

  • Always add/verify signature
  • Every IPFS blob must be signed with private ETH key
  • Optionally, do this as an extension of web3

Latest release of origin.js should be available via originprotocol.com

EDIT: Finished! URL is: https://code.originprotocol.com/origin-js/origin-v0.5.10.js

Now that we have a plain javascript origin.js (not the npm version) we should make it available from our website, which ideally just points to a IPFS blob.

So a site should be able to do something like:

<script src="https://www.originprotocol.com/code/v0.0.2/origin.js"></script>

This could in turn be a redirect to an IPFS blob:
https://gateway.originprotocol.com/ipfs/QmU85WSZMtdMaf7kuyTZpztSKQuVdVY7cXpMCeKa3y1vW5
Such an approach has the advantage that clients don't have to trust our website not to change the code. The IPFS hash will only and always point to an exact version.

This also would make for a cool demo in that one could start using origin.js in the raw browser console, loading it with only this code:

document.head.innerHTML += '<script src="https://www.originprotocol.com/code/v0.0.2/origin.js"></script>';

Currently this code lives only in our releases here:
https://github.com/OriginProtocol/platform/releases

@joshfraser What do you think?

Create Screencast(s) for installation && major milestones

It would be a nice feature/video where there is a walk-through of basic installation and usage of origin.js.

Maybe building a series of videos where each major milestone is shared in a video for both beginners and others working on other parts of origin.js to get a full summary of what is new.

Move logic out of `Listing` contract

Currently each instance of Listing contains a complete set of code for listing methods. This means higher gas costs all around. The "correct" way to do this is to split the logic (ie all the methods) into a library contract, so that the actual Listing contact contains only data, and a new ListingLibrary contract contains the logic.

@DanielVF has started work on this direction in his handling of Purchase contracts, here:
c4afd42

Once this is done, we'll want to do the same thing for all our contracts.

User identity research

Perform research on uPort, Civic, Keybase.

Come up with "glue" to support future identity integrations.

Developer onboarding: One line setup

The steps to get started with origin.js are currently long and tedious.

See: https://github.com/OriginProtocol/platform/tree/develop/packages/origin.js#local

We need a friendlier intro for new contributors, and a system that is less error-prone.

Ideas are:

  • Drop truffle develop and use ganache-cli to run local blockchain. (Using build scripts by @nick as inspiration)
  • Use env and/or command line args to switch between local chain and network chains. (E.g. Rinkeby, mainnet)
  • bash script(s) for doing npm link work

Other ideas?

@joshfraser @DanielVF @tyleryasaka

Show listing expiration

Listings expire 60 days after creation.

We'll need to show on the listing details page and the my listings page how much time is remaining. This probably doesn't need to be very prominent unless we are in the last day.

  • Add expiration information method to listings.get in origin.js
  • Hide expired (and sold) listings from search results
  • Add UI element to listing detail
  • Add UI element to my purchases

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.