Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Next ChluIPFS Iteration #79

Merged
merged 35 commits into from
Jun 6, 2018
Merged

Next ChluIPFS Iteration #79

merged 35 commits into from
Jun 6, 2018

Conversation

fazo96
Copy link
Collaborator

@fazo96 fazo96 commented Apr 10, 2018

PR Content:

  • Circuit Relay (all this stuff is disabled by default for now)

    • make it possible to disable usage of rendezvous endpoints, but enable them by default
    • allow relay on all Chlu nodes, meaning they will all be able to use relays, but disable it by default
    • add option to act as relay (relay-hop) to service node binary, disabled by default
    • set up Node.js nodes to listen for incoming websocket connections, but disable by default
    • add a list of Chlu bootstrap nodes and try to connect to them on start, but don't crash on failure and disable it by default (we don't need it yet)
    • set up the EC2 service node to receive WSS connections and add it to the bootstrap node list
    • use a release of IPFS that supports circuit relay (blocked until js-ipfs is released, using master now) we'll leave this for later since circuit relay is not ready for our use case
    • test circuit relay to make sure network is stable not yet
  • IPFS API (all this stuff is disabled by default for now)

    • use a version of orbit-db that supports IPFS-API (blocked ultil orbit-db is released, using master now) leave this for later
    • add configuration options to connect to remote IPFS node, but hide it by default (doesn't work until orbit-db releases)
    • add CLI option to service node to connect to remote IPFS node
    • add configuration option and CLI option to start a go-ipfs node in the background instead of a js one when running in node.js. Maybe even enable this by default. not yet, the js and go networks are still kind of separated
    • update multinode tests to use js-ipfsd-ctl for stability, and have the test service node run on go-ipfs (leave this for last) not yet, but I managed to optimize the tests anyway by reusing ONLY the IPFS instance between tests (orbit-db and everything else still gets wiped)
  • Offline Mode

    • service node has an --offline flag that starts a rendezvous server and uses it
    • other Chlu apps on the same machine as an offline service node can detect it and turn on offline mode as well, allowing for full Chlu connectivity locally without an internet connection
  • Verify BTC transactions: The First Pass

    • bitcoin module that uses blockcypher and chlu-wallet-support-js to fetch BTC transaction info
    • pass TX hash to publishReviewRecord
      • include it in pubsub message (is this necessary? Is this whole pubsub thing necessary anymore? Need to think about this)
      • include it in orbitDb operation
    • validator for BTC transaction
      • checks OP_RETURN
      • checks amounts with RR and PoPR
      • checks addresses
    • service node: support turning on blockchain access, and fail if it's not done
    • upgrade OrbitDB index to keep track of Tx IDs. Maybe try using level for storing it
      • include required data in operations
      • keep it in the index and get it back when validating
    • tests
      • validator
      • bitcoin module
      • update multinode tests to use bitcoin module (with mocked blockcypher api)
        Events
    • use a rigid, namespaced scheme for names
      Pubsub
    • longer timeouts and less retries when submitting messages and awaiting replies

Issues remaining:

  • due to missing persistence of tx<->rr mapping, if a customer makes a review record without a tx it will fail because the service node will recognize it's not an update and will require a tx ID to approve it. However, if the customer then updates this invalid RR, the update and the old version will now be valid because there is no way to check a transaction unless the RR is being created right now fixed
  • accidentally poisoning cache: when writing RR from demo, the first time it's validated without a txId. This caches the validation result (successful) so if then it's validated before publishing, with the Tx, it will always pass due to hitting the cache (only on the customer) Fixed by disabling validation cache when storing/publishing
  • getChain CORS issue in the browser. Fixed by Misc Fixes chlu-wallet-support-js#17 and fix getChain API in the browser node-client#3
  • don't keep the whole DB Index in memory.. but how do we handle it then?

Refs:

@fazo96 fazo96 self-assigned this Apr 10, 2018
@fazo96 fazo96 changed the title [WIP] Circuit Relay and IPFS-API support Experimental Circuit Relay and IPFS-API support Apr 13, 2018
@fazo96
Copy link
Collaborator Author

fazo96 commented Apr 13, 2018

@kulpreet I updated this PR so that we can merge it now:

I left there the support for circuit relay, IPFS API, the Chlu Bootstrap Nodes etc that I added but disabled or hidden it all for now (since it does not work)

I also disabled the usage of unreleased IPFS and OrbitDB versions.

This means that we can merge this without worries and can re enable the nice stuff once it's ready, let me know how you feel about that.

Also since this PR also contains #81 either we merge that one first or we close that one and we merge this. I think it's best to only keep this one open

@fazo96 fazo96 requested a review from kulpreet April 13, 2018 12:46
This was referenced Apr 16, 2018
@fazo96 fazo96 changed the title Experimental Circuit Relay and IPFS-API support Experimental Circuit Relay and IPFS-API support, Offline mode Apr 16, 2018
@fazo96 fazo96 changed the title Experimental Circuit Relay and IPFS-API support, Offline mode Next ChluIPFS Iteration Apr 19, 2018
@fazo96 fazo96 merged commit 7455aaa into master Jun 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant