github.com/ebakus/go-ebakus@v1.0.5-0.20200520105415-dbccef9ec421/deploy_contract.md (about)

     1  # Deploying your Ebakus Contracts on Ebakus
     2  
     3  ## 1. Compile your contract
     4  
     5  ```
     6  solcjs --abi game.sol
     7  solcjs --bin game.sol
     8  ```
     9  
    10  ## 2. Display the compiled code on the console
    11  
    12  ```
    13  more game_sol_game.abi
    14  more game_sol_game.bin
    15  ```
    16  
    17  ## 3. We continue on our ebakus node
    18  
    19  ```$ ebakus --testnet --verbosity=2 console```
    20  
    21  You should see this:
    22  
    23  ```
    24  Welcome to the Ebakus JavaScript console!
    25  
    26  instance: Ebakus/v1.8.20-unstable/darwin-amd64/go1.11.2
    27  coinbase: 0x32f14386cea573bba82282b6f449ee77030a96e2
    28  at block: 89471 (Mon, 24 Dec 2018 00:00:38 EET)
    29   datadir: /Users/harkal/ebakus2
    30   modules: admin:1.0 debug:1.0 dpos:1.0 eth:1.0 miner:1.0 net:1.0 personal:1.0 rpc:1.0 txpool:1.0 web3:1.0
    31  
    32  >
    33  ```
    34  
    35  ## 4. Unlock you account
    36  
    37  ```
    38  > personal.unlockAccount(eth.coinbase)
    39  Unlock account 0x....
    40  Passphrase: [ENTER PASSPHRASE]
    41  ```
    42  
    43  ## 5. Setup abi and bytecode
    44  
    45  ```
    46  > var myContract = eth.contract([CONTENTS OF ABI FILE])
    47  > var bytecode = '0x[CONTENTS OF BIN FILE]'
    48  ```
    49  
    50  Replace [CONTENTS OF ABI FILE] and [CONTENTS OF BIN FILE] with the outputs of the more commands that should still be open in another terminal window.
    51  
    52  ## 6. Deploy
    53  
    54  ```
    55  > var game = myContract.new({from:eth.coinbase, data:bytecode, gas: 2000000})
    56  ```
    57  
    58  ## 7. Interact with contract
    59  
    60  ```
    61  > game.playMove('forward')
    62  ```