Interactive Javascript Session

Contracts Interaction in Development

The development environment will automatically spawn a REPL Javascript interative session on startup. The new session allows you to interact synchronously with your deployed contracts and the web3 instance. It also allows you access to a set of handy global variables.

In order to print the list of available global variables and commands just type .help in the interactive shell.

A nice feature of the Parasol session is that it automatically resolves Promises synchronously. This makes life easier when interacting with contracts and web3.

For example, in the default Parasol installation, if you run this:

contracts['Token.sol:Token'].methods.name().call()

Notice that you don't need to type await prefix before the Promise call. It is automatically appended.

The session will return the token name 'Token' instead of a Promise.

Live Contracts Interaction

You can interact with contracts that were previously deployed in networks and registered at the addressbook.json file. Simply run:

parasol interact [network]

If [network] is not provided, it will be set to mainnet by default.