Deploy to Ethereum Network (from Browser-Solidity)

Next, let's deploy the contract created onto the private Ethereum network.

Due to issues arising from the Browser-Solidity version, you may not be able to execute Ethereum transactions from Browser-Solidity.

If that is the case, just review this flow diagram and try out direct execution from the console in the next chapter.

Deploy Image

Deploy via Deploy node

  1. PortForwarding (tunneling) setting

    Configure PortForwarding.

  2. Unlock

    Unlock the account of the deployment user Confirm Lock-Unlock.

    (The following tutorial will be explained on the premise that the account is unlocked, so unlock if necessary.)

  3. Connection on web3

    Choose 'Environment' (the cube icon) in Browser-Solidity's right menu section and enter 'Web3 Provider Endpoint:'

    "http://localhost:8545
    

    Confirm that it is entered correctly and select 'Web 3 Provider'.
    Call

    Web3 connection

    A confirmation message as to whether to actually connect to the Ethereum node is displayed, but please connect with 'OK'.

    Address input

    If connection fails, such as when PortForwarding is not performed normally, the following error will be displayed, if so please check the PortForwarding configuration.

    Connection error

  4. Deploying

    Once the connection is completed successfully, the contract will be compiled and deployed in the Ethereum environment by clicking on 'Create' just as you did locally.

    Deployment completed

    This time, address

    0x037c897d77109a0d99186e7456ca7f52f2deae9f

    It was deployed to.
    Unlike when deploying to local JavaScriptVM, it takes a while for the above state change (state registered in block).

    Deploying

    If there is no change on the screen all the time in this state, there is a possibility that registration has failed.

    (When checking with the browser's DevelopmentMode, it often occurs that JavaScript has caused an error.)

    BrowserSolidity is still under development and depending on the Version the Create operation may fail.

    In that case, please adjust the version of BrowserSolidity or try to deploy directly from the command line shown in the following section.

Calling methods

  1. Setting values

    Set "HelloWorld" in the same way as when running in local JavaScriptVM.
    Enter "Hello World" and press 'setGreeting'.

    Hello World Input

    Wait for the transaction to be issued and enter the block.

    HelloWorldWaiting

    A transaction is created and the results are displayed.

    Transaction registration completed

  2. Read values

    If you press 'getGreeting', the value of the field will be retrieved.
    Since this process is contant, it does not involve issuing transactions, so the results are displayed immediately.

    GET Hello World

Reverse direction from address

Deployed contracts are instantiated on the BlockChain, so you can specify addresses to retrieve them.

  • Acquiring Contract

    Address input

    Press 'AtAddress' and the address of the contract you created in the dialog

    0x037c897d77109a0d99186e7456ca7f52f2deae9f

    Enter and press OK.

    Address input

    You can load deployed contracts as described below.

    Read complete!

results matching ""

    No results matching ""