ethereum / populus

The Ethereum development framework with the most cute animal pictures
http://populus.readthedocs.org/
321 stars 321 forks source link

Must have at least one provider backend configured #367

Open drandreaskrueger opened 7 years ago

drandreaskrueger commented 7 years ago

What am I doing wrong?

When I do

populus init 
populus compile
py.test 
populus deploy --chain tester Greeter --no-wait-for-sync

it's all good, but then with

populus deploy Greeter --chain CRS --no-wait-for-sync

I get a

> Found 1 contract source files
  - contracts/Greeter.sol
> Compiled 1 contracts
  - contracts/Greeter.sol:Greeter

Traceback (most recent call last):
  File "folder/env/epe-py3/bin/populus", line 11, in <module>
    sys.exit(main())
  File ".../python3.5/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File ".../python3.5/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File ".../python3.5/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File ".../python3.5/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File ".../python3.5/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File ".../python3.5/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File ".../python3.5/site-packages/populus/cli/deploy_cmd.py", line 43, in deploy_cmd
    deploy(project, logger, chain_name, wait_for_sync, contracts_to_deploy)
  File ".../python3.5/site-packages/populus/api/deploy.py", line 78, in deploy
    provider = chain.provider
  File ".../python3.5/site-packages/populus/chain/base.py", line 137, in provider
    "configured\n{0}".format(self.contract_backend_configs)
ValueError: Must have at least one provider backend configured
OrderedDict()

This is my project.json

{
  "version": "7",
  "compilation": {
    "contracts_source_dirs": [
      "./contracts"
    ],
    "import_remappings": []
  },
  "chains": {
    "CRS": {
      "eth": {
        "default_account": "0x0000000000000000000000000000000000000001"
      },
      "chain": {
        "class": "populus.chain.ExternalChain"
      },
      "web3": {
        "provider": {
          "class": "web3.providers.rpc.HTTPProvider",
          "settings": {
            "endpoint_uri": "https://127.0.0.1:8545"
          }
        }
      }
    }
  }
}

I have my own parity instance running, on port 8545, on a private chain.

What haven't I understood?

Thanks a lot!

system info

populus version
Error: No such command "version".

populus --version
Error: no such option: --version

(I have the version installed today, via pip)

uname -a 
Linux ... 4.9.0-4-amd64 #1 SMP Debian 4.9.51-1 (2017-09-28) x86_64 GNU/Linux

Cute Animal Picture

put a cute animal picture here.

cartoon-monkey-funny-monkeys.jpg

dubh3124 commented 7 years ago

Hi,

I ran into the same problem. You are missing the "contracts" key/value. This worked for me:

{
  "version":"7",
  "compilation":{
    "contracts_source_dirs": ["./contracts"],
    "import_remappings": [],
    "backend":{
      "class":"populus.compilation.backends.SolcStandardJSONBackend",
      "settings":{
         "stdin":{
            "optimizer":{
               "enabled":true,
               "runs":500
            },
            "outputSelection":{
               "*":{
                  "*":[
                     "abi",
                     "metadata",
                     "evm.bytecode",
                     "evm.deployedBytecode"
                  ]
               }
            }
         }
      }
   }
  },
  "chains": {
   "ext_chain": {
    "chain": {
      "class": "populus.chain.ExternalChain"
     },
    "web3": {
      "provider": {
        "class": "web3.providers.rpc.HTTPProvider",
        "settings": {
          "endpoint_uri": "http://127.0.0.1:8545"
        }
      }
    },
    "contracts": {
        "backends": {
          "JSONFile": {"$ref": "contracts.backends.JSONFile"},
          "ProjectContracts": {
            "$ref": "contracts.backends.ProjectContracts"
          }
        }
      }
  }
}
}
paultiplady commented 6 years ago

Ugh just burned an hour plus on this one too -- this should be in the docs somewhere. Added this: https://github.com/ethereum/populus/pull/439