title: How to Deploy smart contracts to different chains in Eris (Monax)
body: <p>I have problem with Eris (Monax). I follow the tutorial of Eris
  <a href="https://monax.io/docs/tutorials/getting-started/" rel="nofollow noreferrer">https://monax.io/docs/tutorials/getting-started/</a></p>
  
  <p>All is good. I'm successful to create,  instantiate a Blockchain called simplechain, and deploy a smart contract called idi (exactly in tutorial)</p>
  
  <p>Now I want to create another chain, called simplechain3 so that 2 chains can run at the same time, and then, I want to deploy this contract idi or another contract (if I want to create the new one) this new chain simplechain3.
  I can create new simplechain3 but I cannot deploy this contract or another contract to this new chain simplechain3. It always aims at the old chain simplechain.</p>
  
  <p>Here are commands I typed:
  <em>eris chains make --account-types=Root:3,Full:2 simplechain3</em></p>
  
  <p><em>eris chains start simplechain3 --init-dir simplechain3_full_000 --ports=1428,47000,47001</em></p>
  
  <p>(I must create new ports for this chain. If not, the error will appears because the port 46657 was already occupie by the old simplechain)</p>
  
  <p>All is good, I checked it by this command
  <em>eris chains ls</em>
  Output:
  *CHAIN            ON     CONTAINER ID     DATA CONTAINER
  simplechain3     *      b4cecde58c       965309c59f
  simplechain      *      e3868c82b0       38dd9d37fa*</p>
  
  <p>With this command:
  <em>docker ps</em></p>
  
  <p>Output
  <em>CONTAINER ID        IMAGE                      COMMAND                  CREATED             STATUS              PORTS                                                                        NAMES
  b4cecde58cfb        quay.io/eris/db:0.12.0     "eris-db serve"          35 seconds ago      Up 33 seconds       0.0.0.0:1428->1337/tcp, 0.0.0.0:47000->46656/tcp, 0.0.0.0:47001->46657/tcp   simplechain3-422e5ebf-6149-46d7-963d-ddbb33104ac4
  e3868c82b07d        quay.io/eris/db:0.12.0     "eris-db serve"          19 hours ago        Up 25 minutes       0.0.0.0:1337->1337/tcp, 0.0.0.0:46656-46657->46656-46657/tcp                 simplechain-7f87110d-1323-4c97-bc70-a0ae971c4960
  18f16072cb1f        quay.io/eris/keys:0.12.0   "eris-keys server --h"   19 hours ago        Up 44 minutes       4767/tcp                                                                     keys-b46408a1-fe29-4205-ac51-878b487d8f78</em></p>
  
  <p>Then, other commands
  *chain_dir_3=$HOME/.eris/chains/simplechain3
  chain_dir_this_3=$chain_dir_3/simplechain3_full_000
  addr3=$(cat $chain_dir_3/addresses.csv | grep simplechain3_full_000 | cut -d ',' -f 1)
  eris pkgs do --chain simplechain3 --address $addr3 --file ./epm.yaml
  *</p>
  
  <p>Output with error:</p>
  
  <p><em>Performing action. This can sometimes take a wee while
  Executing Job                                 defaultAddr
  Executing Job                                 setStorageBase
  Executing Job                                 deployStorageK
  Response                                  abi=[{"constant":false,"inputs":[{"name":"x","type":"uint256"}],"name":"set","outputs":[],"type":"function"},{"constant":true,"inputs":[],"name":"get","outputs":[{"name":"retVal","type":"uint256"}],"type":"function"}]
                                            bin=606060405260978060106000396000f360606040526000357c01000000000000000000000000000000000000000000000000000000009004806360fe47b11460415780636d4ce63c14605757603f565b005b605560048080359060200190919050506078565b005b606260048050506086565b6040518082815260200191505060405180910390f35b806000600050819055505b50565b600060006000505490506094565b9056
                                           name=IdisContractsFTW
  Deploying Contract                       name=IdisContractsFTW
  <strong>Encountered error waiting for event: timed out waiting for event</strong>
                                           addr=796AA808A90DFA52D2502CFCA7803BFBBDC030CD
  Executing Job                                 setStorage
  Deprecation Warning: The use of the 'data' field to specify the name of the contract function has been deprecated. Please update your epm jobs file to utilize a combination of 'function' and 'data' fields instead. See documentation for further details.
  <strong>Encountered error waiting for event: timed out waiting for event</strong>
  Executing Job                                 queryStorage
  Deprecation Warning: The use of the 'data' field to specify the name of the contract function has been deprecated. Please update your epm jobs file to utilize a combination of 'function' and 'data' fields instead. See documentation for further details.
  <strong>Error connnecting to node (tcp://chain:46657) to query contract at (796AA808A90DFA52D2502CFCA7803BFBBDC030CD) with data (6D4CE63C)%!(EXTRA string=Account 796aa808a90dfa52d2502cfca7803bfbbdc030cd does not exist)</strong>
  Could not perform pkg action service: Could not perform pkg action: Container interactive-808a8aa8-09cb-4b9f-ae3a-b77158681c21 exited with status 1</em></p>
  
  <p>Could you help me solve this problem? How to deploy the contract to another chain? I've already tested it with another contract, it is the same.</p>
  
  <p>The content of the file epm.yaml is in the tutorial
  <a href="https://monax.io/docs/tutorials/getting-started/#step-3-2-fixup-your-epm-yaml" rel="nofollow noreferrer">https://monax.io/docs/tutorials/getting-started/#step-3-2-fixup-your-epm-yaml</a></p>
  
  <p>And the content of the contract is in the tutorial, too
  <a href="https://monax.io/docs/tutorials/getting-started/#step-3-1-make-a-contract-for-idi" rel="nofollow noreferrer">https://monax.io/docs/tutorials/getting-started/#step-3-1-make-a-contract-for-idi</a></p>
  
  <p>For the another contract, the same problems appears.</p>
  
  <p>I work in Linux Ubuntu 16.04, Eris 0.12.0, docker 1.12.3</p>
  
  <p>Thanks a lot</p>