Skip to content
This repository has been archived by the owner on Nov 15, 2021. It is now read-only.

Document how to spin up a REPL #38

Open
frangio opened this issue Feb 26, 2020 · 3 comments
Open

Document how to spin up a REPL #38

frangio opened this issue Feb 26, 2020 · 3 comments
Labels
documentation Improvements or additions to documentation

Comments

@frangio
Copy link
Contributor

frangio commented Feb 26, 2020

Truffle users are used to truffle console. It is also possible to get a REPL connected to Test Environment. We should add this to our documentation.

$ node
> const { contract } = require('@openzeppelin/test-environment')
> const ERC20 = contract.fromArtifacts('ERC20')
@abcoathup abcoathup added the documentation Improvements or additions to documentation label Feb 28, 2020
@nventuro
Copy link
Contributor

nventuro commented Mar 2, 2020

Note that truffle console is more feature-rich than the Node REPL: it supports things like automatic awaiting of promises. But yes, it'd be nice to mention this.

@frangio
Copy link
Contributor Author

frangio commented Mar 2, 2020

Automatic awaiting of promises is a bad idea IMO. We can suggest use with --experimental-repl-await to be able to use await in the REPL.

truffle console will still have more features, sure. For example, it automatically loads all artifacts. I'd say we're catering to different users who may appreciate the minimalism.

@miohtama
Copy link

Note that you can already do this:

https://forum.openzeppelin.com/t/using-openzeppelin-sdk-from-node-typescript-prompt/2716/2

My recommendation is that add documentation guidance how to open the normal ts-node console (or node) console and import modules. Please do not add any automatic or hidden variables that pop out to the existing from nowhere - try to keep it so that the code runs same way regardless if it is a source code file or REPL prompt.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

4 participants