question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

unexpected or undocumented truffle develop console objects persistence after restart

See original GitHub issue

Issue

Deploying TestContract on truffle develop console worked and await TestContract.at(TestContract.address) worked. Then after truffle develop console restart running: await TestContract.at(TestContract.address) again returns Error: Cannot create instance of TestContract; no code at address 0x....

I searched online if truffle develop console does not persist something but could not find information on that and also the deployed contracts ARE persisted.

await TestContract.deployed() DOES work after restart.

Also: .getPastEvents() of the contract returns events before truffle develop console restart and does not return events (empty array) after truffle develop console restart.

Is this a bug? Or is there a missing documentation about what the console persists across restarts?

Environment

Windows 10 Truffle v5.0.12 (core: 5.0.12) Solidity - 0.5.2 (solc-js) Node v10.8.0 Web3.js v1.0.0-beta.37

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
CruzMolinacommented, Apr 16, 2019

Since the json has the contract code then why does truffle only take it partially for autocomplete and .deployed() and does not also put the code on the blockchain after restart?

Interesting idea! I think the current plan is for truffle develop to be a “throw-away” chain that gets destroyed and refreshed on each restart, leaving it up to the user to migrate. However, I see how the current behavior of contract.deployed() is a bit confusing.

After looking into this a bit more, there may be a way to either have a truffle develop migration not save to the actual json artifacts (so after restarting truffle develop, the artifacts will be detected, but the develop network will not be found), or possibly have truffle develop remove the networks it added during the repl session when .exiting out. Will need to look into this more thoroughly.

0reactions
eggplantzzzcommented, Mar 11, 2020

So it looks like if we wanted to move forward on this, we would need to have a requirements gathering session to figure out what kind of behavior we actually want. Leaving this here until we can triage things.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Use Truffle Develop and the Console
Truffle Console : A basic interactive console connecting to any Ethereum client ... When you run truffle develop --log , Truffle will start...
Read more >
Truffle console doesn't work :Unexpected error: Cannot ...
Truffle tries to read compiler outputted JSON format files. Naturally .DS_Store is not a file of a such a format making truffle to...
Read more >
Solidity Documentation - Read the Docs
Solidity is an object-oriented, high-level language for implementing smart contracts. Smart contracts are programs.
Read more >
Using gretl for Principles of Econometrics, 4th Edition Version ...
correlations and any notes you may want to make. Objects are represented as icons and these objects can be saved for later use....
Read more >
Using gretl for Principles of Econometrics, 3rd Edition Version ...
gretl develops I suspect that this small reliance on R will diminish. ... either singly from the console or in batches using scripts....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found