Solidity integration with Visual Studio


Getting Started with Solidity

Yesterday we were proud to announce the integration of Solidity and the Smart Contracts that work with Ethereum blockchains into Visual Studio.  This exists as an extension that is available here.  This extension was designed to lower the bar to working with blockchains and make this a seemless process from inside the world class IDE.

The extension is free, and we have put together some steps to further help you get started using this.

 


 Prerequisites

To get started you will need to be using Visual Studio 2015  Community, Professional, or Enterprise edition.  You will also need to download the Solidity extension from the Visual Studio Marketplace.  You can download that here.  After installing the extension, you will need to restart Visual Studio.  Also, nodejs will need to be installed to allow local deployments for development.  This can be downloaded here. (download the latest LTS version)

 

visual studio extension


 Create your first Decentralized Application

After the extension has been installed, next you can create a decentralized application that will be used to author, compile and deploy smart contracts.

1.  From the File menu, click new Project.

blog_post2

 2.  In the New Project dialog box, click on Solidity under Installed Templates, and then select DecentralizedApplication.  Name the application, MyDecentralizedApp, and then click OK.

 blog_post3

3.  Next you will see a few things happened.  A README document was opened in the Visual Studio main window and the project was setup with some folder and sample files.  The README explains how to setup a local keyserver in order to deploy smart contracts to a development blockchain instance.

a. First download and install the latest version of bloc from Consensys.  To do this, open a cmd prompt, navigate to a directly where you would like to install the keyserver and run the following command:  npm install blockapps-bloc -g

blog_post4

b.  Next create the instance of bloc from the core by running the command: bloc init.  This will prompt you for some values that will be used the instance.  Enter a name of your choice, and user name, and accept the default for the apiUrl.  This is the ethereum node that will hold the actual blocks that your account/contracts will be deployed to.

blog_post5

c.  Now change to that directory and install the required node packages by running the following command: cd <appname> && npm install

blog_post6

d.  Finally you are ready to start the bloc instance by running the following command: bloc start

blog_post7

4.  Now we have a keyserver running.  This local keyserver will run on port 8000 by default.  The Visual Studio extension is configured to use this server by default, with a user named: testuser and a password: testing.  You can view and edit these changes by running the following:

a.  Right click the project in solution explorer.

blog_post8

b.  The dialog here shows the configuration values that are set by default, and can be adjusted if needed. (they will not need to be adjusted in most cases)

blog_post9

 5.  At this point we have a keyserver running locally, now we have an endpoint that we can deploy our smart contracts to (as well as create new users).  So now we can get started with development of smart contracts.

 


 

Working with Smart Contracts (authoring, compiling, deploying)

Now that the foundation is place, we can take a look at working with Smart Contracts.  By default a folder named samples will be created with some sample contracts already included.  When you are just getting started with Solidity, these are a great source of reference.

blog_post10


To get started, we can use the Payout.sol smart contract.  First, we can examine the contract in the Visual Studio code window.  When we are satisified with what we have authored, we can then compile this contract.  This compiliation will take place on the local machine.  The output from the compliation will be in the output window of Visual Studio,


Compilation

1.  Compile the smart contract

blog_post11

2.  The output for the compilation is found in the output window.  If you don't see the output window in the lower part of your screen you can open from the View -> Output menu (or Ctrl + W, O).  If there any errors with the compilation, it will be shown in the output window as well.

blog_post12


Deployment

The deployment is nearly as simple as the compilation.  The deployment will send the smart contract to your local keyserver which will communicate with the underlying blockchain.  What is actually happening is this.

1.  First, VS will use the project properties (shown earlier) to determine the bloc server to communicate with (url).

2.  Next VS will call this server, asking if the user in the project properties, exists.

a.  If it does exist, the address of the user will be returned to Visual Studio.

b.  If it doesn't exist, a new user will be created, and that address will be returned to Visual Studio.

3.  Next, VS will get the source for the contract, along with the address of the user and post this to the bloc server.

4.  Finally, your default browser will be opened to a dynamically created html page of the smart contract that was deployed.

blog_post13

5.  When the browser opens, you can enter the password for the bloc server (default is testing).

blog_post14

6.  You can then exercise the contract.  For example, you can send in a value in Ether by post 1 to the setup box.

blog_post15


Next Steps

At this point, congratulations, you have now entered the blockchain universe!  I will be posting some more tutorials to expand on this.

 

Comments (59)

  1. Andrew Keys says:

    Strong work, Cale.

  2. Jarkko says:

    After installing bloc I get following lines

    npm WARN enoent ENOENT: no such file or directory, open 'C:\WINDOWS\system32\package.json'
    npm WARN system32 No description
    npm WARN system32 No repository field.
    npm WARN system32 No README data
    npm WARN system32 No license field.

    Then I try to start bloc:

    C:\WINDOWS\system32>bloc init
    'bloc' is not recognized as an internal or external command,
    operable program or batch file.

    1. Cale T says:

      Apologies, I had a typo in step 3a, the command should be: npm install blockapps-bloc -g. The -g being install globally. Thanks!

  3. Gavin says:

    Using a clean install of Win 10 Ent and VS2015 Pro.

    After project initiated, I get this:

    Wrote: C:\bloc\bce\app\static\css\styles.css
    project initiated!
    now type `cd bce && npm install`
    thanks for registering with BlockApps!

    C:\bloc>cd bce && npm install
    npm WARN package.json keyserver@1.0.0 No description
    npm WARN package.json keyserver@1.0.0 No repository field.
    npm WARN package.json keyserver@1.0.0 No README data
    npm WARN deprecated graceful-fs@3.0.8: graceful-fs version 3 and before will fail on newer node releases. Please update to graceful-fs@^4.0.0 as soon as possible.
    npm WARN deprecated secp256k1-browserify@0.0.0: secp256k1 now inculdes browser compentents
    npm WARN optional dep failed, continuing fsevents@1.0.11
    npm WARN deprecated lodash@1.0.2: lodash@ gulp-express@0.3.5 install C:\bloc\bce\node_modules\gulp-express
    > echo "*** Please use [gulp-live-server] instead! *** "

    "*** Please use [gulp-live-server] instead! *** "
    |
    > keyserver@1.0.0 postinstall C:\bloc\bce
    > node node_modules/bower/bin/bower install

    bower EINVALID Failed to read C:\bloc\bce\bower.json

    Additional error details:
    Name must be lowercase, can contain digits, dots, dashes, "@" or spaces

    npm ERR! Windows_NT 10.0.10586
    npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
    npm ERR! node v4.4.2
    npm ERR! npm v2.15.0
    npm ERR! code ELIFECYCLE
    npm ERR! keyserver@1.0.0 postinstall: `node node_modules/bower/bin/bower install`
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the keyserver@1.0.0 postinstall script 'node node_modules/bower/bin/bower install'.
    npm ERR! This is most likely a problem with the keyserver package,
    npm ERR! not with npm itself.
    npm ERR! Tell the author that this fails on your system:
    npm ERR! node node_modules/bower/bin/bower install
    npm ERR! You can get information on how to open an issue for this project with:
    npm ERR! npm bugs keyserver
    npm ERR! Or if that isn't available, you can get their info via:
    npm ERR!
    npm ERR! npm owner ls keyserver
    npm ERR! There is likely additional logging output above.

    npm ERR! Please include the following file with any support request:
    npm ERR! C:\bloc\bce\npm-debug.log

    1. Cale T says:

      Thanks for this feedback, I am checking myself to see if anything changed to cause this error.

      1. Gavin says:

        Thanks Cale, guess you've made some changes, as the condition has changed to:

        C:\bloc\bce>npm install
        npm WARN package.json keyserver@1.0.0 No description
        npm WARN package.json keyserver@1.0.0 No repository field.
        npm WARN package.json keyserver@1.0.0 No README data
        npm WARN deprecated secp256k1-browserify@0.0.0: secp256k1 now inculdes browser compentents
        /
        > keyserver@1.0.0 postinstall C:\bloc\bce
        > node node_modules/bower/bin/bower install

        bower EINVALID Failed to read C:\bloc\bce\bower.json

        Additional error details:
        Name must be lowercase, can contain digits, dots, dashes, "@" or spaces

        npm ERR! Windows_NT 10.0.10586
        etc....

        1. Cale T says:

          Yes, the issue is after you run bloc init, then go into the directory cd , the bower.json has the application name parameter set to {{appname}}. Just change this to (no brackets or braces), and then npm install, and you should be in good shape. The core issue was caused by an update to the npm package, we will push a change to fix this asap, but you can use this as a workaround right now. Thanks!

          1. Cale T says:

            The npm package is updated now. Current version that is now 0.9.11, which I just tested and it is working fine. Just run a npm install blockapps-bloc -g to update your global package with the fix.

  4. Gavin says:

    At step 5, enter password "testing" and then click Submit, after which nothing happens i.e. password prompt remains and no error appears.

    1. Cale T says:

      I believe the html that is generated here has some issues with IE11. I have seen the same issues when using IE. Alternative to use Edge, Chrome or FF. It uses your default browser, so if you don't want to change that, just copy+paste the url to one of the other browsers and it should render and function normally.

      Much appreciate the feedback, this is really early days for these extensions, so we are working hard to improve the experience and this feedback helps!

      1. Gavin says:

        Thanks Cale, as you say, works fine in Edge, not yet in IE11.

      2. ndeth says:

        thanks for the tip to switch out browser. works great.

  5. Jonathan says:

    Awesome tutorial

  6. EBana says:

    I've tried your steps several times in Visual Studio 2015 and whenever I attempt to deploy the smart contract, I keep getting "object reference not set to an instance of an object". Any ideas?

  7. Cale T says:

    Sounds like the keyserver is not running. Can you check if its listening (default): http://localhost:8000 (step 4 in blog post). You can actually browse to this url, and you should get a response.

    1. EBana says:

      The URL is not working. I did noticed that when I typed in "bloc start" in cmd window, I didn't get a response of "bloc is listening on http:......". Do you know how I can resolve this? Not that is matters, but I am running the VS project as an administrator and it is VS 2015 Enterprise Upgrade 2. Thanks again!

      1. Cale T says:

        Ok, then the node app is not running.
        Couple things to check:

        Is there a npm-debug.log file the folder the bloc init created? If so need to resolve any issues there with creating your keyserver instance
        You can try starting with this as well: node app.js (run this from within the folder above)

        Just as an FYI, this model where you run a local server is just an interim step, we are working to remove this going forward and make this process easier. New build will be out very soon with a few other features as well.

        1. EBana says:

          Thanks, I will research the error when running node app.js:
          events.js:141
          throw er; // Unhandled 'error' event
          ^

          Error: listen EACCES 127.0.0.1:8000
          at Object.exports._errnoException (util.js:870:11)
          at exports._exceptionWithHostPort (util.js:893:20)
          at Server._listen2 (net.js:1221:19)
          at listen (net.js:1270:10)
          at net.js:1379:9
          at GetAddrInfoReqWrap.asyncCallback [as callback] (dns.js:64:16)
          at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:83:10)

          1. EBana says:

            Cale, thanks for leading me in the right direction. Running netstat, I figured out another service was already listening on port 8000 and once I changed it to a different port in the app.js and VS project properties, everything started to work!! Thanks!!

  8. John deLoach says:

    Success! Between your great explanation and the discussion, it worked fine.

    Thank you, Cale

  9. tom t says:

    I can't seem to compile any contracts that I create. I receive: "Error: Expected import directive or contract definition." Sample contracts compile fine. My contract is in the main project directory, Any ideas?

    1. Cale T says:

      Checking into this. We have another release imminent, which will add more options on the items to add to the project. One option to keep you moving would be to copy an sample contract (e.g. Payout.sol) to your folder and then modify. Not great, but will keep you moving. Incidentally, we are also enabling better file / folder support in the new build.

      Thanks.

      1. tom t says:

        Thanks. I tried moving the existing contracts, but they fail once outside the samples dir as well. And new contracts created and manually moved into the samples dir fails as well. So, I've just taken to editing the 3 provided samples, which I can compile and deploy.

  10. Biser says:

    Maybe just add after point 3.c to run "bloc genkey" before "bloc start". Everything else is perfectly explained.

    1. Cale T says:

      Will update. Thanks!

  11. Nelson N says:

    Thanks for the tutorial Cale. I've just run npm install blockapps-bloc -g at the command prompt and received the following errors:

    C:\Users\Nelson\Source>npm install blockapps-bloc -g
    npm ERR! git clone --template=C:\Users\Nelson\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git@github.com:kejace/eth-l ightwallet.git C:\Users\Nelson\AppData\Roaming\npm-cache\_git-remotes\git-github-com-kejace-eth-lightwallet-git-dca3cc7c: undefined
    npm ERR! git clone --template=C:\Users\Nelson\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git@github.com:kejace/eth-l ightwallet.git C:\Users\Nelson\AppData\Roaming\npm-cache\_git-remotes\git-github-com-kejace-eth-lightwallet-git-dca3cc7c: undefined
    npm ERR! git clone --template=C:\Users\Nelson\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git@github.com:kejace/ether eumjs-tx.git C:\Users\Nelson\AppData\Roaming\npm-cache\_git-remotes\git-github-com-kejace-ethereumjs-tx-git-05d250d0: undefined
    npm ERR! git clone --template=C:\Users\Nelson\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git@github.com:kejace/ether eumjs-tx.git C:\Users\Nelson\AppData\Roaming\npm-cache\_git-remotes\git-github-com-kejace-ethereumjs-tx-git-05d250d0: undefined
    npm ERR! git clone --template=C:\Users\Nelson\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git@github.com:kejace/ether eumjs-util.git C:\Users\Nelson\AppData\Roaming\npm-cache\_git-remotes\git-github-com-kejace-ethereumjs-util-git-d4e1f072: undefined
    npm ERR! git clone --template=C:\Users\Nelson\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git@github.com:kejace/ether eumjs-util.git C:\Users\Nelson\AppData\Roaming\npm-cache\_git-remotes\git-github-com-kejace-ethereumjs-util-git-d4e1f072: undefined
    npm ERR! Windows_NT 10.0.10586
    npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "block apps-bloc" "-g"
    npm ERR! node v4.4.5
    npm ERR! npm v2.15.5
    npm ERR! code ENOGIT

    npm ERR! not found: git
    npm ERR!
    npm ERR! Failed using git.
    npm ERR! This is most likely not a problem with npm itself.
    npm ERR! Please check if you have git installed and in your PATH.

    npm ERR! Please include the following file with any support request:
    npm ERR! C:\Users\Nelson\Source\npm-debug.log

    Any advice would be appreciated. Also, if necessary, I could email directly to you the debug log shown in the final line. Thanks

    1. Cale T says:

      Hi Nelson, We have been heads down on updates which are releasing tonight. I would ask if you can reinstall the latest blockapps-bloc (globally) and run the updated extension. Also, make sure git is in your path. You can verify this by opening a new command windows and typing git to see if you get git help. Thanks and apologies on the delay!

  12. Dharmendra Kumar says:

    when i run bloc start command in cmd prompt , it not giving any message.

    http://prntscr.com/ckkp72

    1. Cale T says:

      Try running: node app.js and you should be able to see the error that is being throw. Could be something environmental.

  13. Dharmendra Kumar says:

    How to know which ethereum address use for deploy contract?

    1. Cale T says:

      If you are using bloc its pretty easy.

      Then you can do a few things. You can hit it from bloc, just do a bloc start and then open your browser and hit http://localhost:8000/contracts

      You can then exercise it there in your browser to test it out.

  14. Compeador says:

    Hi, I followed all the instructions and bloc server is listening at localhost:8000

    But when I compile & deploy the contract I following in output window:
    Deployment to http://localhost:8000/ started!
    User used for deployment: testuser
    User: testuser created successfully
    User found: []

    Contract Payout created successfully at address invalid address or incorrect password
    Contract can be accessed here: http://localhost:8000/contracts/Payout/invalid address or incorrect password.html (default password: testing)

    and webpage launched is blank and I observe that bloc server has existed. Here is the bloc server cmd window details:

    contract as body is: undefined

    constructor arguments: undefined

    POST /users/testuser/[]/contract 200 13.353 ms - 37

    extension was matched: html

    could you help me, plz?

    1. Cale T says:

      I wonder if a glitch we had with the public strato instance (strato-dev4) caused this issue for you. Could you try this? Go into your bloc instance (the folder created by bloc init) and into the app folder. Delete the meta and users folder if they exist and retry. Apologies for the late reply. Let me know if this doesn't resolve your issue.

      1. Compeador says:

        well, I solved the problem simply moved the folder to D:\
        thank you anyway 🙂

  15. Calum Macaskill says:

    I am running. VS as administrator, host 8000 started but user check fails. User name is testuser, password testing.

    1. Cale T says:

      Can you check in the folder for your bloc (the one that gets created when you run bloc init). Check under the app folder. If there is a subdirectory for users in there, delete it. The restart bloc (bloc start), and finally run the deployment from VS.

      Hope this helps!

  16. Neil says:

    Many thanks for this tutorial. I get as far as step 5 in deployment then when I enter the password I get a page not found error. At the keyserver I see 'GET /login?password=testing 404'. Are you able to help please?

    1. Cale T says:

      Ok, lets check something. If bloc running, navigate to http://localhost:8000/users. If you see [] then no users are created, which is fine. If you see [testuser], then the test user was created. The password is testing. You can then open Visual Studio, create a new Smart Contract project type, then navigate a sample smart contract and right click/deploy smart contract. When the browser window opens use testing as password. You should be able to see in the background the user that is being used, which should be testuser.

      Let me know if this does not work for you.
      Thanks!

      1. Neil says:

        Thanks for your swift response. If I go to http://localhost:8000/users I see ["testuser"]. However when I choose Deploy Smart Contract in Visual Studio and enter the password in the resulting browser I then get the 404.

        1. Neil says:

          I started again from scratch and it's working now. The only obvious thing I did differently was to accept the default blockchain profile of strato-dev rather than selecting ethereum. Thanks again for your support.

          1. Jignesh says:

            Hi,

            I build the whole application from scratch. I am able to create user using genkey. I am also able to compile the contracts. However when I submit the contract thru VS, I get errors. My bloc start is listening properly on port 8000.
            Even http://localhost:8000/users returns file not found.Below is screen shot of error when contract is submitted. Can anybody throw some light on this. Below is the bloc log
            -----------------------------------------------------------------------------------------------------------------------------

            api is pointed to http://strato-dev4.blockapps.net with profile strato-dev

            GET /users/ - - ms - -
            body: {"password":"testing","faucet":"1"}
            hitting faucet for 383c94a569bdc8b2e43c0a4aa56a956e9e7be4ac
            wrote: app\users\testuser\383c94a569bdc8b2e43c0a4aa56a956e9e7be4ac.json
            POST /users/testuser 200 11659.636 ms - 54
            GET /users/ - - ms - -
            contract as body is: undefined
            constructor arguments: undefined
            POST /users/testuser/[]/contract 200 192.124 ms - 37
            extension was matched: html

            C:\Users\SONY VAIO\GaneshApp>

            -----------------------------------------------------------------------------------------------------------------------

          2. Cale T says:

            Hi Jignesh,
            Sincere apologies on the lag on my side responding here. Have been swamped getting some new features ready for the VS extension, lots of new features coming. On the error message you received, we initially had a hosted instance of strato running (http://strato-dev4.blockapps.net), which takes quite a bit of abuse on the internet. 🙂 To resolve the issue, you can run an instance in your azure subscription, then update your bloc configuration to use the dns/ip of the public ip on your azure hosted instance. I am trying to get a more stable instance for general public use like strato-dev4, just need a bit to get this running.

            Thanks!!
            Cale

  17. anigh says:

    Deployment to http://localhost:8000/ started!
    User used for deployment: admin

    User found: a95426ec3780d5c888052a8973fd7111cbe7d55d

    Contract Payout created successfully at address error uploading contract
    Contract can be accessed here: http://localhost:8000/contracts/Payout/error uploading contract.html (default password: testing)

    1. anigh says:

      C:\Users\titan\testapp>bloc start
      bloc is listening on http://0.0.0.0:8000

      api is pointed to http://strato-dev4.blockapps.net with profile strato-dev

      GET /users/ 200 40.650 ms - 12

      GET /users/testuser 200 9.178 ms - 44

      contract as body is: undefined

      constructor arguments: undefined

      data is: 06eb7ff7c5b47d57bf888fe512a5ed5c51f8c089

      About to upload contract

      Compile successful: contract SimpleStorage {
      uint storedData;
      function set(uint x) {
      storedData = x;
      }
      function get() returns (uint retVal) {
      return storedData;
      }
      }

      writing SimpleStorage to app\meta\SimpleStorage\SimpleStorage.json

      wrote: app\meta\SimpleStorage\SimpleStorage.json

      caught a single contract

      uploading SimpleStorage

      upload contract: SimpleStorage

      ...waiting for transaction to be mined

      ...waiting for transaction to be mined

      ...waiting for transaction to be mined

      ...waiting for transaction to be mined

      ...waiting for transaction to be mined

      ...waiting for transaction to be mined

      ...waiting for transaction to be mined

      ...waiting for transaction to be mined

      there was an error: {"errorTags":["submitTransaction","Transaction","Solidity"],
      "message":"waited 10 seconds"}

      POST /users/testuser/06eb7ff7c5b47d57bf888fe512a5ed5c51f8c089/contract 200 27471
      .400 ms - 24

      extension was matched: html

      1. Cale T says:

        Hi Anigh,

        Apologies on the lag on my side getting back to you. The backend blockchain for this that is used by default (http://strato-dev4.blockapps.net) is having some stability issues. We are looking to stand up something more stable, but the only workaround for now would be to create your own instance of Strato or use their TestDrive for 2 hours of free use. I will update the blog when the new server is ready, apologies for the trouble.

        Thanks for your patience.
        Cale

    2. Cale T says:

      Hi Anigh,

      See the other response I provided, same issue.

      Thanks
      Cale

  18. Vikas says:

    Hi

    I am getting below error
    Deployment to http://localhost:8000/ started!
    User used for deployment: testuser

    User found: 6a2a73d1dfd8b775b7d4d65d5f223ee52be62390

    Contract Payout created successfully at address error uploading contract
    Contract can be accessed here: http://localhost:8000/contracts/Payout/error uploading contract.html (default password: testing)

    1. Cale T says:

      Hi Vikas,

      Sorry on my lag getting back to you. The problem is the backend blockchain that is used by default (http://strato-dev4.blockapps.net) is having stability issues from internet abuse. We are looking to stand up something more stable, but in the interim the only option would be to stand up your own strato instance or use the free test drive for 2 hours of free access. I will update the blog when the new instance is ready. Also, we have a new version of the extension coming soon.

      Thanks!
      Cale

  19. John Horton says:

    Hi Cale,
    Thanks for the great tutorial. However I am unable to deploy Payout.sol. My command window shows the following -

    c:\visual studio 2015\Projects\MyDecentralizedApp\jhtestapp>bloc start
    bloc is listening on http://0.0.0.0:8000
    api is pointed to http://strato-dev4.blockapps.net with profile strato-dev
    GET /contracts/ 200 166.032 ms - -
    GET /static/bower_components/jquery/jquery.min.js 304 33.697 ms - -
    GET /static/bower_components/bootstrap/dist/js/bootstrap.js 304 20.559 ms - -
    GET /static/css/styles.css 304 19.748 ms - -
    GET /static/bower_components/bootstrap/dist/css/bootstrap.min.css 304 29.348 ms - -
    GET /users/ 200 52.503 ms - 2
    body: {"password":"testing","faucet":"1"}
    hitting faucet for 289c3f2ba8fc8cb07fb8d4769a6c9c0dfb3a3c1c
    wrote: app\users\testuser\289c3f2ba8fc8cb07fb8d4769a6c9c0dfb3a3c1c.json
    POST /users/testuser 200 11432.615 ms - 54
    GET /users/ 200 27.885 ms - 12
    GET /users/testuser 200 14.176 ms - 44
    contract as body is: undefined
    constructor arguments: undefined
    data is: 289c3f2ba8fc8cb07fb8d4769a6c9c0dfb3a3c1c
    About to upload contract
    Compile successful: contract Payout {
    address Victor;
    address Jim;
    address Kieren;
    mapping (address => uint) ownershipDistribution;
    function Setup() {
    Victor = 0xaabb;
    Jim = 0xccdd;
    Kieren = 0xeeff;

    ownershipDistribution[Victor] = 35;
    ownershipDistribution[Jim] = 35;
    ownershipDistribution[Kieren] = 30;
    }

    function Dividend() {
    uint bal= this.balance;
    Victor.send(bal * ownershipDistribution[Victor] / 100);
    Jim.send(bal * ownershipDistribution[Jim] / 100);
    Kieren.send(bal * ownershipDistribution[Kieren] / 100);
    }
    }

    writing Payout to app\meta\Payout\Payout.json
    wrote: app\meta\Payout\Payout.json
    caught a single contract
    uploading Payout
    upload contract: Payout
    ...waiting for transaction to be mined
    ...waiting for transaction to be mined
    ...waiting for transaction to be mined
    ...waiting for transaction to be mined
    ...waiting for transaction to be mined
    there was an error: {"errorTags":["submitTransaction","Transaction","Solidity"],"message":"waited 10 seconds"}
    POST /users/testuser/289c3f2ba8fc8cb07fb8d4769a6c9c0dfb3a3c1c/contract 200 11659.996 ms - 24
    extension was matched: html

    c:\visual studio 2015\Projects\MyDecentralizedApp\jhtestapp>

    I have tried deleting the meta and users directories but this did not solve this for me. They get created.
    localhost:8000/users shows [testuser] and localhost:8000/contracts shows 'Compiled Contract' with nothing further.

    Any ideas that might help.
    Thanks
    John

    1. Cale T says:

      Hi John,

      Apologies on my extreme lag here. The problem is the backend blockchain for this (http://strato-dev4.blockapps.net) is having some stability issues. We are looking to stand up something more stable, but the only alternative for now would be to run you own Strato instance in Azure or use TestDrive for 2 hours of free access. I will update the blog when the new public facing one is ready.

      Thanks for your patience.
      Cale

  20. sweta says:

    Getting no response on bloc start

    node app.js giving following error:

    C:\Users\user\Desktop\Blockchain\Ethereum\keyserver\testapp>node app.js
    C:\Users\user\Desktop\Blockchain\Ethereum\keyserver\testapp\node_modules\blockap
    ps-js\js\profiles.js:16
    polling.pollEveryMS = profile.pollEveryMS;
    ^

    TypeError: Cannot read property 'pollEveryMS' of undefined
    at Object.setProfile (C:\Users\user\Desktop\Blockchain\Ethereum\keyserver\te
    stapp\node_modules\blockapps-js\js\profiles.js:16:34)
    at Object. (C:\Users\user\Desktop\Blockchain\Ethereum\keyserver\t
    estapp\app.js:51:5)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)
    at run (bootstrap_node.js:394:7)
    at startup (bootstrap_node.js:149:9)
    at bootstrap_node.js:509:3

    C:\Users\user\Desktop\Blockchain\Ethereum\keyserver\testapp>

    1. Cale T says:

      Hi Sweta,

      Apologies on my extreme delay getting back to you. The problem is caused by the fact that we use (http://strato-dev4.blockapps.net) by default and this server is having some stability issues. We are looking at standing up something more stable, but in the interium the workaround would be to run your own instance of strato in Azure. There is a small cost associated, but they do offer 30 days for free or you can use the TestDrive option for 2 hours of free use. You will need to update your bloc configuration to use the new endpoint.

      We will update the blog when a new public instance if ready.

      Thanks for your patience!
      Cale

  21. Judy says:

    Hi Cale,
    I am using Win 10 and VS 2015. I have installed Solidity extension and created a Smart Contract project named "DecentralizedApp" under Solidity template. I have downloaded Node.js and installed the same. While trying to setup bloc key server running in local, I am getting few issues and unable to succeed.

    Below is the output:
    Step 3.a: npm install -g blockapps-bloc

    | `-- wrap-ansi@2.1.0
    +-- decamelize@1.2.0
    +-- os-locale@1.4.0
    | `-- lcid@1.0.0
    | `-- invert-kv@1.0.0
    +-- string-width@1.0.2
    | +-- code-point-at@1.1.0
    | `-- is-fullwidth-code-point@1.0.0
    | `-- number-is-nan@1.0.1
    +-- window-size@0.1.4
    `-- y18n@3.2.1

    C:\Users\judy>

    Step 3.b: bloc init

    I have accepted the apiurl & blockchain profile as it is.

    C:\Users\Judy>bloc init
    ? ==========================================================================
    We're constantly looking for ways to make blockapps-bloc better!
    May we anonymously report usage statistics to improve the tool over time?
    More info: https://github.com/blockapps/bloc & http://blockapps.net
    ========================================================================== No

    ____ __ __ ___
    / __ )/ /___ _____/ /__/ | ____ ____ _____
    / __ / / __ \/ ___/ //_/ /| | / __ \/ __ \/ ___/
    / /_/ / / /_/ / /__/ ,

    Step 3.c: cd testapp && npm install

    C:\Users\Judy>cd testapp && npm install
    npm WARN deprecated secp256k1-browserify@0.0.0: secp256k1 now inculdes browser compentents
    npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
    npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
    npm WARN deprecated graceful-fs@1.2.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
    npm WARN deprecated to-iso-string@0.0.2: to-iso-string has been deprecated, use @segment/to-iso-string instead.
    npm WARN deprecated jade@0.26.3: Jade has been renamed to pug, please install the latest version of pug instead of jade
    npm WARN deprecated minimatch@0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue

    +-- debug@0.8.1
    | +-- faye-websocket@0.7.3
    | +-- noptify@0.0.3
    | | `-- nopt@2.0.0
    | | `-- abbrev@1.1.0
    | `-- qs@0.6.6
    +-- gulp-nodemon@2.2.1
    | +-- colors@1.1.2
    | `-- nodemon@1.11.0
    | +-- chokidar@1.6.1
    | | +-- anymatch@1.3.0
    | | +-- async-each@1.0.1
    | | +-- glob-parent@2.0.0
    | | `-- is-binary-path@1.0.1
    | | `-- binary-extensions@1.8.0
    | +-- es6-promise@3.3.1
    | +-- ignore-by-default@1.0.1
    | +-- lodash.defaults@3.1.2
    | | `-- lodash.assign@3.2.0
    | | +-- lodash._baseassign@3.2.0
    | | `-- lodash._createassigner@3.1.1
    | | `-- lodash._bindcallback@3.0.1
    | +-- ps-tree@1.1.0
    | +-- touch@1.0.0
    | | `-- nopt@1.0.10
    | +-- undefsafe@0.0.3
    | `-- update-notifier@0.5.0
    | +-- configstore@1.4.0
    | | +-- graceful-fs@4.1.11
    | | +-- os-tmpdir@1.0.2
    | | +-- osenv@0.1.4
    | | +-- uuid@2.0.3
    | | +-- write-file-atomic@1.3.1
    | | | +-- graceful-fs@4.1.11
    | | | +-- imurmurhash@0.1.4
    | | | `-- slide@1.1.6
    | | `-- xdg-basedir@2.0.0
    | +-- is-npm@1.0.0
    | +-- latest-version@1.0.1
    | | `-- package-json@1.2.0
    | | +-- got@3.3.1
    | | | +-- infinity-agent@2.0.3
    | | | +-- is-redirect@1.0.0
    | | | +-- lowercase-keys@1.0.0
    | | | +-- nested-error-stacks@1.0.2
    | | | +-- object-assign@3.0.0
    | | | +-- prepend-http@1.0.4
    | | | +-- read-all-stream@3.1.0
    | | | | `-- readable-stream@2.2.2
    | | | | `-- isarray@1.0.0
    | | | `-- timed-out@2.0.0
    | | `-- registry-url@3.1.0
    | | `-- rc@1.1.7
    | | +-- deep-extend@0.4.1
    | | +-- minimist@1.2.0
    | | `-- strip-json-comments@2.0.1
    | +-- repeating@1.1.3
    | | `-- is-finite@1.0.2
    | | `-- number-is-nan@1.0.1
    | +-- semver-diff@2.1.0
    | | `-- semver@5.3.0
    | `-- string-length@1.0.1
    +-- js-yaml@3.8.1
    | +-- argparse@1.0.9
    | | `-- sprintf-js@1.0.3
    | `-- esprima@3.1.3
    +-- map-stream@0.0.6
    +-- marko@2.11.0
    | +-- app-module-path@1.1.0
    | +-- async-writer@1.4.5
    | +-- browser-refresh-client@1.1.4
    | +-- char-props@0.1.5
    | +-- events@1.1.1
    | +-- htmlparser2@3.9.2
    | | +-- domelementtype@1.3.0
    | | +-- domhandler@2.3.0
    | | +-- domutils@1.5.1
    | | | `-- dom-serializer@0.1.0
    | | | `-- domelementtype@1.1.3
    | | +-- entities@1.1.1
    | | `-- readable-stream@2.2.2
    | | `-- isarray@1.0.0
    | +-- jsonminify@0.2.3
    | +-- marko-async@2.2.2
    | | +-- raptor-async@1.1.3
    | | `-- raptor-dust@1.1.12
    | +-- marko-layout@2.0.2
    | +-- minimatch@0.2.14
    | | +-- lru-cache@2.7.3
    | | `-- sigmund@1.0.1
    | +-- property-handlers@1.1.1
    | +-- raptor-args@1.0.3
    | +-- raptor-json@1.1.0
    | +-- raptor-logging@1.1.2
    | | `-- raptor-stacktraces@1.0.1
    | +-- raptor-modules@1.3.2
    | | `-- app-root-dir@1.0.2
    | +-- raptor-polyfill@1.0.2
    | +-- raptor-promises@1.0.3
    | | `-- q@1.4.1
    | +-- raptor-regexp@1.0.1
    | +-- raptor-strings@1.0.2
    | +-- raptor-util@1.1.1
    | +-- resolve-from@1.0.1
    | +-- sax@0.6.1
    | `-- try-require@1.2.1
    +-- mkdirp@0.5.1
    | `-- minimist@0.0.8
    +-- mocha@2.5.3
    | +-- commander@2.3.0
    | +-- debug@2.2.0
    | | `-- ms@0.7.1
    | +-- diff@1.4.0
    | +-- escape-string-regexp@1.0.2
    | +-- glob@3.2.11
    | | `-- minimatch@0.3.0
    | +-- growl@1.9.2
    | +-- jade@0.26.3
    | | +-- commander@0.6.1
    | | `-- mkdirp@0.3.0
    | +-- supports-color@1.2.0
    | `-- to-iso-string@0.0.2
    +-- mocha-steps@1.0.2
    +-- morgan@1.8.1
    | `-- basic-auth@1.1.0
    +-- readdirp@2.1.0
    | +-- graceful-fs@4.1.11
    | +-- minimatch@3.0.3
    | | `-- brace-expansion@1.1.6
    | | +-- balanced-match@0.4.2
    | | `-- concat-map@0.0.1
    | +-- readable-stream@2.2.2
    | | +-- buffer-shims@1.0.0
    | | +-- core-util-is@1.0.2
    | | +-- isarray@1.0.0
    | | +-- process-nextick-args@1.0.7
    | | +-- string_decoder@0.10.31
    | | `-- util-deprecate@1.0.2
    | `-- set-immediate-shim@1.0.1
    +-- request-promise@2.0.1
    | +-- bluebird@2.11.0
    | `-- lodash@4.17.4
    +-- rimraf@2.6.0
    | `-- glob@7.1.1
    | `-- fs.realpath@1.0.0
    +-- socket.io@1.7.3
    | +-- debug@2.3.3
    | +-- engine.io@1.8.3
    | | +-- base64id@1.0.0
    | | +-- debug@2.3.3
    | | +-- engine.io-parser@1.3.2
    | | | +-- after@0.8.2
    | | | +-- arraybuffer.slice@0.0.6
    | | | +-- base64-arraybuffer@0.1.5
    | | | +-- blob@0.0.4
    | | | `-- wtf-8@1.0.0
    | | `-- ws@1.1.2
    | | +-- options@0.0.6
    | | `-- ultron@1.0.2
    | +-- has-binary@0.1.7
    | | `-- isarray@0.0.1
    | +-- object-assign@4.1.0
    | +-- socket.io-adapter@0.5.0
    | | `-- debug@2.3.3
    | +-- socket.io-client@1.7.3
    | | +-- backo2@1.0.2
    | | +-- component-bind@1.0.0
    | | +-- component-emitter@1.2.1
    | | +-- debug@2.3.3
    | | +-- engine.io-client@1.8.3
    | | | +-- component-emitter@1.2.1
    | | | +-- component-inherit@0.0.3
    | | | +-- debug@2.3.3
    | | | +-- has-cors@1.1.0
    | | | +-- parsejson@0.0.3
    | | | +-- parseqs@0.0.5
    | | | +-- xmlhttprequest-ssl@1.5.3
    | | | `-- yeast@0.1.2
    | | +-- indexof@0.0.1
    | | +-- object-component@0.0.3
    | | +-- parseuri@0.0.5
    | | | `-- better-assert@1.0.2
    | | | `-- callsite@1.0.0
    | | `-- to-array@0.1.4
    | `-- socket.io-parser@2.3.1
    | +-- component-emitter@1.1.2
    | +-- debug@2.2.0
    | | `-- ms@0.7.1
    | `-- json3@3.3.2
    +-- tiny-lr@0.2.1
    | +-- body-parser@1.14.2
    | | +-- bytes@2.2.0
    | | +-- http-errors@1.3.1
    | | +-- iconv-lite@0.4.13
    | | +-- qs@5.2.0
    | | `-- raw-body@2.1.7
    | | `-- bytes@2.4.0
    | +-- debug@2.2.0
    | | `-- ms@0.7.1
    | +-- faye-websocket@0.10.0
    | | `-- websocket-driver@0.6.5
    | | `-- websocket-extensions@0.1.1
    | +-- livereload-js@2.2.2
    | `-- qs@5.1.0
    +-- traverse@0.6.6
    +-- underscore@1.8.3
    `-- vinyl-fs@2.4.4
    +-- duplexify@3.5.0
    | +-- end-of-stream@1.0.0
    | | `-- once@1.3.3
    | +-- readable-stream@2.2.2
    | | `-- isarray@1.0.0
    | `-- stream-shift@1.0.0
    +-- glob-stream@5.3.5
    | +-- glob@5.0.15
    | +-- glob-parent@3.1.0
    | | +-- is-glob@3.1.0
    | | | `-- is-extglob@2.1.1
    | | `-- path-dirname@1.0.2
    | +-- micromatch@2.3.11
    | | +-- arr-diff@2.0.0
    | | | `-- arr-flatten@1.0.1
    | | +-- array-unique@0.2.1
    | | +-- braces@1.8.5
    | | | +-- expand-range@1.8.2
    | | | | `-- fill-range@2.2.3
    | | | | +-- is-number@2.1.0
    | | | | +-- isobject@2.1.0
    | | | | | `-- isarray@1.0.0
    | | | | +-- randomatic@1.1.6
    | | | | `-- repeat-string@1.6.1
    | | | +-- preserve@0.2.0
    | | | `-- repeat-element@1.1.2
    | | +-- expand-brackets@0.1.5
    | | | `-- is-posix-bracket@0.1.1
    | | +-- extglob@0.3.2
    | | +-- filename-regex@2.0.0
    | | +-- is-extglob@1.0.0
    | | +-- kind-of@3.1.0
    | | +-- normalize-path@2.0.1
    | | +-- object.omit@2.0.1
    | | | +-- for-own@0.1.4
    | | | | `-- for-in@0.1.6
    | | | `-- is-extendable@0.1.1
    | | +-- parse-glob@3.0.4
    | | | +-- glob-base@0.3.0
    | | | `-- is-dotfile@1.0.2
    | | `-- regex-cache@0.4.3
    | | +-- is-equal-shallow@0.1.3
    | | `-- is-primitive@2.0.0
    | +-- ordered-read-streams@0.3.0
    | | `-- is-stream@1.1.0
    | +-- through2@0.6.5
    | | `-- readable-stream@1.0.34
    | | `-- isarray@0.0.1
    | +-- to-absolute-glob@0.1.1
    | | `-- extend-shallow@2.0.1
    | `-- unique-stream@2.2.1
    | `-- json-stable-stringify@1.0.1
    | `-- jsonify@0.0.0
    +-- graceful-fs@4.1.11
    +-- gulp-sourcemaps@1.6.0
    | +-- convert-source-map@1.4.0
    | +-- graceful-fs@4.1.11
    | +-- strip-bom@2.0.0
    | `-- vinyl@1.2.0
    +-- is-valid-glob@0.3.0
    +-- lazystream@1.0.0
    | `-- readable-stream@2.2.2
    | `-- isarray@1.0.0
    +-- lodash.isequal@4.5.0
    +-- merge-stream@1.0.1
    | `-- readable-stream@2.2.2
    | `-- isarray@1.0.0
    +-- readable-stream@2.2.2
    | `-- isarray@1.0.0
    +-- strip-bom@2.0.0
    | `-- is-utf8@0.2.1
    +-- strip-bom-stream@1.0.0
    | +-- first-chunk-stream@1.0.0
    | `-- strip-bom@2.0.0
    +-- through2@2.0.3
    | +-- readable-stream@2.2.2
    | | `-- isarray@1.0.0
    | `-- xtend@4.0.1
    +-- through2-filter@2.0.0
    +-- vali-date@1.0.0
    `-- vinyl@1.2.0
    +-- clone@1.0.2
    `-- clone-stats@0.0.1

    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\chokidar\node_modules\fsevents):
    npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.1: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
    npm WARN testapp@1.0.0 No description
    npm WARN testapp@1.0.0 No repository field.

    C:\Users\Judy\testapp>

    Step 3.d: bloc genkey
    When it prompts for password, I gave testing and I could see the below "...waiting for transaction to be mined". I killed the batch by pressing ctrl+c.
    C:\Users\Judy\testapp>bloc genkey
    prompt: Enter a high entropy password. You will need this to sign transactions.:
    wrote app\users\admin\8f4d6216c8797151db87c4ccc4e7459500c286c7.json
    ...waiting for transaction to be mined
    ...waiting for transaction to be mined
    ...waiting for transaction to be mined
    ...waiting for transaction to be mined
    ...waiting for transaction to be mined
    Unhandled rejection Error: faucet: waited 10 seconds
    at Object.ensureErrorObject (C:\Users\Judy\AppData\Roaming\npm\node_modules\blockapps-bloc\node_modules\bluebird\js\main\util.js:261:20)
    at Promise._rejectCallback (C:\Users\Judy\AppData\Roaming\npm\node_modules\blockapps-bloc\node_modules\bluebird\js\main\promise.js:472:22)
    at Promise._settlePromiseFromHandler (C:\Users\Judy\AppData\Roaming\npm\node_modules\blockapps-bloc\node_modules\bluebird\js\main\promise.js:516:17)
    at Promise._settlePromiseAt (C:\Users\Judy\AppData\Roaming\npm\node_modules\blockapps-bloc\node_modules\bluebird\js\main\promise.js:584:18)
    at Promise._settlePromises (C:\Users\Judy\AppData\Roaming\npm\node_modules\blockapps-bloc\node_modules\bluebird\js\main\promise.js:700:14)
    at Async._drainQueue (C:\Users\Judy\AppData\Roaming\npm\node_modules\blockapps-bloc\node_modules\bluebird\js\main\async.js:123:16)
    at Async._drainQueues (C:\Users\Judy\AppData\Roaming\npm\node_modules\blockapps-bloc\node_modules\bluebird\js\main\async.js:133:10)
    at Immediate.Async.drainQueues (C:\Users\Judy\AppData\Roaming\npm\node_modules\blockapps-bloc\node_modules\bluebird\js\main\async.js:15:14)
    at runCallback (timers.js:649:20)
    at tryOnImmediate (timers.js:622:5)
    at processImmediate [as _immediateCallback] (timers.js:594:5)

    ...waiting for transaction to be mined
    ...waiting for transaction to be mined
    ...waiting for transaction to be mined
    ...waiting for transaction to be mined
    ...waiting for transaction to be mined
    ...waiting for transaction to be mined
    ...waiting for transaction to be mined
    ...waiting for transaction to be mined
    ...waiting for transaction to be mined
    ...waiting for transaction to be mined
    ...waiting for transaction to be mined
    ...waiting for transaction to be mined
    ...waiting for transaction to be mined
    ^CTerminate batch job (Y/N)? y

    C:\Users\Judy\testapp>

    Step 3.e: bloc start

    ^CTerminate batch job (Y/N)? y

    C:\Users\Judy\testapp>bloc start

    C:\Users\Judy\testapp>

    When I run the above command, nothing is happening.

    I tried running node app.js and below is the response.

    C:\Users\Judy\testapp>node app.js
    events.js:160
    throw er; // Unhandled 'error' event
    ^

    Error: listen EACCES 0.0.0.0:8000
    at Object.exports._errnoException (util.js:1022:11)
    at exports._exceptionWithHostPort (util.js:1045:20)
    at Server._listen2 (net.js:1246:19)
    at listen (net.js:1295:10)
    at net.js:1405:9
    at _combinedTickCallback (internal/process/next_tick.js:77:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)
    at Module.runMain (module.js:606:11)
    at run (bootstrap_node.js:394:7)
    at startup (bootstrap_node.js:149:9)
    at bootstrap_node.js:509:3

    C:\Users\Judy\testapp>

    Can you please let me know if I am missing anything?

    1. Cale T says:

      Hi Judy,

      Really sorry about the delay on my response here, we are quite busy with building some new features for this extension. The problem you are seeing is because the backend blockchain (http://strato-dev4.blockapps.net) is having some substantial stability issues because of internet abuse 🙁 We are looking at building some more stable here, but in the interium the only alternative would be to create your own instance of Strato in your Azure sub. There is a cost here, but they give you 30 days for free or you can use the testdrive for 2 hours of free use. After you have one of these created, simply update your bloc configuration to use this new endpoint.

      Thanks
      Cale

    2. Cale T says:

      Hi Judy,

      Sorry for the lag in my response. The issue is caused by stability issues with (http://strato-dev4.blockapps.net). We are looking to build something more stable here, but this is not ready yet. The alternative would be to create a new instance of Strato in Azure. There is a small cost here, but they do offer the first 30 days for free, you just pay for the VM or you can us TestDrive for 2 hours of free use. I will update the blog when we have a new public instance for use.

      Thanks for you patience!
      Cale

    3. Cale T says:

      Hi Judy,

      As mentioned in a few other posts, there are some stability issues with strato-dev4, causing this issue.

      Thanks
      Cale

  22. Gary Hsu says:

    Hi Cal,
    First of all, thank you for this great tutorial! I follow every step and there is an issue when I deploy contract in VS:

    Contract Payout created successfully at address {"errorTags":["HTTPQuery","extabi","Solidity"],"message":"connect ECONNREFUSED 40.86.90.171:80"}

    I realized that this IP address is apiURL "http://strato-dev3.blockapps.net". Is this endpoint still valid or you have a new instance for us to try?

    1. Cale T says:

      Hi Gary,

      Sorry for the extreme lag on my part, been a bit busy here. The endpoint that is used by default (http://strato-dev4.blockapps.net) is taking some internet abuse and is not stable, hence the errors you are seeing. We are working on building an alternative to avoid these issues, but in the interium, the workaround would be to spin up your own instance of strato in Azure. There is a cost there, but they give the first 30 days for free or you can use the TestDrive for 2 hours of a free instance. We will update the blog when we have a more stable public endpoint.

      Thanks for your patience!
      Cale

  23. LeonM says:

    I'm running into an error on the Deployment step.

    Visual Studio Output Window:
    Deployment to http://localhost:8000/ started!
    User used for deployment: testuser
    User: testuser created successfully
    User found: efb43acb79386e720abc98a4be6f5c07c3b62cca
    Contract Payout created successfully at address error uploading contract
    Contract can be accessed here: http://localhost:8000/contracts/Payout/error uploading contract.html (default password: testing)

    Output from Command Prompt Window where bloc was started:
    bloc is listening on http://0.0.0.0:8000
    api is pointed to http://strato-dev4.blockapps.net with profile strato-dev
    GET /users/ 200 27.625 ms - 2
    body: {"password":"testing","faucet":"1"}
    hitting faucet for efb43acb79386e720abc98a4be6f5c07c3b62cca
    wrote: app\users\testuser\efb43acb79386e720abc98a4be6f5c07c3b62cca.json
    POST /users/testuser 200 10786.470 ms - 54
    GET /users/ 200 8.126 ms - 12
    GET /users/testuser 200 6.132 ms - 44
    contract as body is: undefined
    constructor arguments: undefined
    data is: efb43acb79386e720abc98a4be6f5c07c3b62cca
    About to upload contract
    compile failed with error message: Solidity: solc: HTTPQuery: connect ETIMEDOUT
    13.90.102.43:80
    caught a single contract
    POST /users/testuser/efb43acb79386e720abc98a4be6f5c07c3b62cca/contract 200 21115.328 ms - 24
    extension was matched: html

    1. Cale T says:

      Hi LeonM,

      Apologies on the lag, we have been heads down working on a new version of this extension with some new features. To your question, the issue is the backend blockchain instance (http://strato-dev4.blockapps.net) is having some stability issues, caused by some internet abuse. 🙂 To workaround, you can create an instance of Strato in Azure (or use the TestDrive in Azure for 2 hours of use for free). You will then need to update you bloc properties to use the new endpoint. We are looking to make a more robust instance in the public space to avoid these issues.

      Thanks for your patience!
      Cale

  24. titan says:

    Hi,when I compile & deploy the contract following in output window:

    Deployment to http://localhost:8000/ started!
    User used for deployment: testuser

    User found: 2118dff8d6976d0f49ab3da413477af4282c0054

    Contract Payout created successfully at address error uploading contract
    Contract can be accessed here: http://localhost:8000/contracts/Payout/error uploading contract.html (default password: testing)

    webpage launched is blank, Here is the bloc server cmd window details:

    E:\bAtt>bloc start
    bloc is listening on http://0.0.0.0:8000

    api is pointed to http://strato-dev4.blockapps.net with profile strato-dev

    GET /users/ 200 35.175 ms - 2

    body: {"password":"testing","faucet":"1"}

    hitting faucet for 2118dff8d6976d0f49ab3da413477af4282c0054

    wrote: app\users\testuser\2118dff8d6976d0f49ab3da413477af4282c0054.json

    POST /users/testuser 200 24492.390 ms - 54
    GET /users/ 200 25.801 ms - 12
    GET /users/testuser 200 6.637 ms - 44
    contract as body is: undefined
    constructor arguments: undefined

    data is: 2118dff8d6976d0f49ab3da413477af4282c0054

    About to upload contract

    Compile successful: contract Payout {
    address Victor;
    address Jim;
    address Kieren;

    mapping (address => uint) ownershipDistribution;

    function Setup() {
    Victor = 0xaabb;
    Jim = 0xccdd;
    Kieren = 0xeeff;

    ownershipDistribution[Victor] = 35;
    ownershipDistribution[Jim] = 35;
    ownershipDistribution[Kieren] = 30;
    }

    function Dividend() {
    uint bal= this.balance;
    Victor.send(bal * ownershipDistribution[Victor] / 100);
    Jim.send(bal * ownershipDistribution[Jim] / 100);
    Kieren.send(bal * ownershipDistribution[Kieren] / 100);
    }
    }

    writing Payout to app\meta\Payout\Payout.json
    wrote: app\meta\Payout\Payout.json
    caught a single contract
    uploading Payout
    upload contract: Payout

    ...waiting for transaction to be mined

    ...waiting for transaction to be mined

    ...waiting for transaction to be mined

    ...waiting for transaction to be mined

    ...waiting for transaction to be mined

    there was an error: {"errorTags":["submitTransaction","Transaction","Solidity"],
    "message":"waited 10 seconds"}

    POST /users/testuser/2118dff8d6976d0f49ab3da413477af4282c0054/contract 200 16629
    .388 ms - 24
    extension was matched: html

    could you help me?Thanks

    1. Cale T says:

      Hi Titan,

      Apologies on the darkness on my part, we have been heads down, working on a new version of this extension with some cool new features. On the question you asked, the issue is that the backend strato instance that is used by default (http://strato-dev4.blockapps.net), has been taking some heavy abuse on the public internet, so it is not very stable at the moment. To workaround, you can spin up and instance in Azure (and there is a test drive, which is free for 2 hours of us). Then update your project to use the new instance, update your bloc configuration to use the Azure instance that was created. We are looking to create something new in public form to make this more stable.

      Thanks
      Cale

Skip to main content