Contract not showing after being created in strato dashboard


#1

I am able to successfully upload contract on strato dashboard but contract does not shows up anywhere even the transactions doesn’t show any records of it being uploaded.

I have tried stopping all docker containers using: docker stop $(docker ps -a -q)

Then I restarted the instance: ./strato_run [server_name]

Everything looks good on dashboard page but don’t understand why it’s not showing the contracts after accepting it.

How do I fix this issue?


#2

Suchit,

Try querying http://servername/bloc/v2.1/contracts/:contractName and see if it shows you the contracts.

Its possible that the contract is not getting uploaded and the SMD is not giving you correct feedback.


#3

I’m seeing this behaviour both locally and also on the demo server, http://stratodev.blockapps.net

When trying to post a simple contract taken from the solidity documentation

contract SimpleStorage {
    uint storedData;

    function set(uint x) {
        storedData = x;
    }

    function get() constant returns (uint) {
        return storedData;
    }
}

The endpoint http://stratodev.blockapps.net/bloc/v2.1/users/ContractUpload/ef006efa551f3e05562b811e9924fc3a3e8e2455/contract is returing a status of 404, with a message “Could not find global contract metadataId

Please can you advise what the issue is here as this is not isolated to my local installation - it’s a bit of an impediment in testing out the functionality properly.

Regards


#4

@evs it looks like it should be /contracts versus /users in the URL there.

http://stratodev.blockapps.net/bloc/v2.1/contracts reports two contract instances


#5

Not sure where you are seeing that, but I might be missing something.

Looking at the browser console the POST is being made to the contracts collection on the users endpoint

The documentation for the endpoint is here http://stratodev.blockapps.net/docs/?url=/bloc/v2.1/swagger.json

Even trying this out in Swagger is causing the same error


#6

I was able to deploy another SimpleStorage instance from the docs which you can see at http://stratodev.blockapps.net/dashboard/#/contracts … I even used your username and password @evs. Maybe the escape characters in the body are the issue.


#7

@kjameslubin Yes I can see that. Strange. When I upload a simple .sol file on http://stratodev.blockapps.net/, it’s sent with the escape chars. Can you attach a .sol that you have verified that works and then I can go from there?

CLearly I’m doing something wrong

curl -X POST “http://stratodev.blockapps.net/bloc/v2.1/users/ContractUpload/ef006efa551f3e05562b811e9924fc3a3e8e2455/contract” -H “accept: application/json;charset=utf-8” -H “content-type: application/json;charset=utf-8” -d “{ “value”: “1000000”, “password”: “ContractUpload”, “contract”: “SimpleStorage2”, “src”: “contract SimpleStorage2 { uint storedData; function set(uint x) { storedData = x; } function get() constant returns (uint) { return storedData; } }”}”

This throws a 500 error for me


#8

Your file works as written. Discourse does not want me to put a .sol here… Which browser are you using?


#9

Chrome

This throws a 500 error for me in Swagger

Perhaps it is my browser :face_with_raised_eyebrow:


#10

Try making the value “0” - it could just be bad initial model data.


#11

Yes, that worked.

So why doesn’t this work using the UI - The exact same contract in a .sol and it returns the exception “Could not find global contract metadataId

It appears as though the UI sends the parameter {… contract: “temp” …} which is a mismatch to the actual contract name defined in the .sol I can recreate the issue in Swagger if they are mismatched

Not much I can do about that really :frowning:


#12

And then there was light…so the issue turned out to be the filename mismatching the defined contract within.

Once I corrected I was able to upload a contract.

Many thanks for helping me get there in the end


#13

I was able to reproduce this more or less at the same instant you were.

Ok, we’ve added two issues to the backlog - one for the value default, one for the filename.
Happy Programming @evs!


#14

@kjameslubin Cheers!


#15

Apologies to revamp this again, but I would like to suggest the software supports the following scenario

As a user I would like to see error messages about contracts shown in the UI so I can remedy the problem

Scenario: Failed to parse contract upload
Given I have opened the Create New Contract dialogue window
And I have entered some valid account credentials
When I choose a .sol file
And an exception is returned from the strato-api/eth/v1.2/extabi endpoint
Then I am shown some form of error message to help diagnose the issue

After yesterday’s issues, I’ve tried to get a contract working that I’ve manually played with using Remix Solidity IDE and MetaMask. Solidity compiles this without any issues, but STRATO complains that block is a reserved word.

Can you point me in the direction where this might be documented - is it Strato specific? What else is?

The contract is here https://github.com/blakeberg/parking-dapp/blob/master/contracts/ParkingPlaces.sol

Cheers