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

Implement watch command to support Dapps for contracts on user's Ganache #4

Open
john-osullivan opened this issue Sep 23, 2019 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@john-osullivan
Copy link
Contributor

john-osullivan commented Sep 23, 2019

Update

The final compromise here was to have dappbot truffle handle autoparsing deployed Truffle artifacts to create dapps with minimal user interaction. It does not, however, attempt to watch files as they build. Until we can connect to local blockchains thru a websocket API, there isn't much point in watching files as they build -- we can only interact with them once they're deployed to a public chain. However, once we can talk to local blockchains, then we have the capability of creating dapps for local contracts while they're still under development.

Therefore, this issue now corresponds to that new command which we are still blocked on.

Original Spec

This is the beginning of dappbot-cli's core unique feature. In order to act as a dev tool, this needs to fit seamlessly into the development cycle. We're going to do that by adding a dappbot watch command which expects to be run in a Truffle project and follows steps something like:

  1. Look for the build/contracts directory
  2. Go through each file in that directory
  3. Check if the build content shows that it's been deployed to a recognized network
  4. If so, automatically create a Dapp for it
  5. If that file updates to reflect a new ABI or deployed address, update the existing Dapp

This is the smaller version of our end-goal, which is creating Dapps for contracts which are still under development. The key wrinkle here is that in-progress contracts are deployed on local Truffle instances. If we created the Dapp with a web3URL pointed at localhost:8000, then it would work from the same machine but not for anybody else.

In order to make these in-dev dapps work for everybody, the web3URL would represent a connection to the developer's Ganache instance. We could do that with websockets, where dappbot watch opens a websocket session with DappBot. The dapp's web3URL would be something like api.dapp.bot/v1/public/unique-fish-name. Sending a request to it would forward a message to the corresponding session, so the dappbot-cli would be acting like a transaction executor for the user's Ganache.

@john-osullivan john-osullivan added the enhancement New feature or request label Sep 23, 2019
@john-osullivan john-osullivan self-assigned this Sep 23, 2019
@john-osullivan john-osullivan changed the title Implement interactive watch command Implement watch command to support Dapps for contracts on user's Ganache Oct 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant