Closed waterlink closed 4 years ago
Hey @waterlink thanks for all of these issues! We're super excited you're using Teams. I just wanted to touch base to let you know we've seen these and started talking about them. Expect responses on each of them soon!
First, I was trying to upload all our smart contract artifacts (5 contracts, 5 ABI JSON files), and it failed. The failure was 413 error from Nginx (request is too large). The request size in the web inspector was showing about ~2.5 MB
Should be a trivial fix to up the limit! I'll give a shot in our next release (scheduled tomorrow) and see if that fixes it for you.
Then I tried to upload only single contract artifact, and that worked (1.4M one). Now, when I try to upload the next artifact, it removes all previous artifacts :(
Ya, the UX here is really non-intuitive. We have a much better design that makes the monitoring UX so much cleaner. We should be starting this work in a few weeks.
PS: Why many instances of the same contract? Because we have a factory contract that produces many instances of a main contract “class,” that are independent from each other, but have same behaviours.
Since we will keep using this factory in the future to create even more main contract instances, we would need to incrementally add artifact/address pairs to Monitoring, which means that the current behaviour of overriding of everything that was there before wouldn’t work for us…
Factory patterns have been a weak spot for our tools in general, but we're 100% aware of it, and continuously try to support it. We've been making sure Truffle Teams supports it at the data and api layers, but there are some missing pieces in the monitoring and presentation layers. Ideally we would monitor the blockchain and say "oh hey, they made a new contract of this type in this transaction, let's create an instance for it"
Question for you: what would you want the name of the instance to be in the list of contracts on the monitoring page? MyToken (1)
, MyToken (2)
or maybe timestamps? Ideally there would maybe be some sort of name/factor in the state variables or constructor that could help us label it on the UI.
@seesemichaelj
Question for you: what would you want the name of the instance to be in the list of contracts on the monitoring page?
In our scenario, we have both name
and symbol
(implements IERC20) for these contracts.
It would be great if it has shown both (if the contract implements these methods). If not both, then symbol
takes preference (as it is shorter and easy to remember, usually).
Moreover, when the instantiated contract doesn’t support either name
or symbol
(we had one like this in the past, and could introduce it again in the future), then I’m okay with MyToken (1)
and MyToken (2)
. In this scenario, the next iteration would be to manually give them a custom name/nickname from the UI.
Thanks @waterlink for answering that question. That helps out quite a bit! We'll keep those things in mind when we add support for factory patterns.
However, in the meantime, you should be able to upload all of your artifacts at once now. I've increased the limit to 100MiB. Let me know if this fixed the issue for you!
Hey @waterlink; I'm going to go ahead and close this one. Please reopen if the 413 Request is Too Large
error. Thanks!
Hi there, I have encountered another roadblock with the Monitoring feature.
First, I was trying to upload all our smart contract artifacts (5 contracts, 5 ABI JSON files), and it failed. The failure was 413 error from Nginx (request is too large). The request size in the web inspector was showing about ~2.5 MB. This adds up because 5 contracts total will be even bigger than that:
Then I tried to upload only single contract artifact, and that worked (1.4M one). Now, when I try to upload the next artifact, it removes all previous artifacts :(
Also, I had to hack around to register many contract instances of the same type (same ABI json file, but multiple contracts), for that I had to change their name to add some kind of suffix:
Instead of
"contractName": "MyToken"
I had to have two of the following:"contractName": "MyToken__staging__first"
"contractName": "MyToken__staging__second"
And I had to copy the same file multiple times (with respective change in the name).
PS: Why many instances of the same contract? Because we have a factory contract that produces many instances of a main contract “class,” that are independent from each other, but have same behaviours.
Since we will keep using this factory in the future to create even more main contract instances, we would need to incrementally add artifact/address pairs to Monitoring, which means that the current behaviour of overriding of everything that was there before wouldn’t work for us…