eos icon indicating copy to clipboard operation
eos copied to clipboard

Error creating contract following instructions in Readme.md

Open mark0st opened this issue 9 years ago • 7 comments

The following step in Readme.md fails (newlines added for readability):

$ ./eosc set contract currency ../../contracts/currency/currency.wast ../../contracts/currency/currency.abi
Reading WAST...
Assembling WASM...
Publishing contract...
2060686ms thread-0   main.cpp:768                  main                 ] 
Failed with error: 10 assert_exception: Assert Exception status_code == 200: Error
: 3030002 tx_missing_sigs: signatures do not satisfy declared authorizations
Transaction declares authority '{"account":"currency","permission":"active"}', 
but does not have signatures for it.
    {"auth":{"account":"currency","permission":"active"}}
    thread-0  chain_controller.cpp:749 get_required_keys

The error in server log:

2060681ms thread-0   chain_api_plugin.cpp:58       operator()           ] 
Exception encountered while processing chain.get_required_keys:
 {"code":3030002,"name":"tx_missing_sigs","message":"signatures do not satisfy declared authorizations",
"stack":[{"context":{"level":"error","file":"chain_controller.cpp","line":749,
"method":"get_required_keys","hostname":"",
"thread_name":"thread-0","timestamp":"2017-09-08T16:34:20"},
"format":"Transaction declares authority '${auth}', 
but does not have signatures for it.","data":{"auth":{"account":"currency","permission":"active"}}}]}

Previous steps were completed successfully and resulted in behaviour described in Readme.

mark0st avatar Sep 08 '17 16:09 mark0st

Make sure you have setup a wallet that has the private key for the currency account imported and it is unlocked. Just import both keys active and owner to be sure.

nanonano7 avatar Sep 08 '17 17:09 nanonano7

@mark0st as @nanonano7 says, you should import the private keys that you have used in the steps before to create the currency account.

./eosc wallet import private key

datienzalopez avatar Sep 08 '17 19:09 datienzalopez

Thanks, that solved the issue. These instructions should be added to Readme, probably right before Upload sample contract.

mark0st avatar Sep 08 '17 19:09 mark0st

When I executed this instruction:

./eosc set contract player ../../../contracts/currency/currency.wast ../../../contracts/currency/currency.abi

I got this message:

File does not exist: ../../../contracts/currency/currency.wast
ERROR: ValidationError: wast-file=../../../contracts/currency/currency.wast

I search the whole project then find there is no file named currency.wast where is the file currency.wast?

Toormi avatar Sep 11 '17 09:09 Toormi

@Toormi I guess that you are going to the wrong path, just remove one ../

The files should be in ~/eos/build/contracts/currency/

datienzalopez avatar Sep 11 '17 13:09 datienzalopez

@datienzalopez Thanks, I solved this issue.

I missed these instructions before I build EOS:

echo "export WASM_LLVM_CONFIG=~/wasm-compiler/llvm/bin/llvm-config" >> ~/.bash_profile
echo "export LLVM_DIR=/usr/local/Cellar/llvm/4.0.1/lib/cmake/llvm" >> ~/.bash_profile
source ~/.bash_profile

So after I build EOS, there is no 'contracts' directory in ~/eos/build, and I suppose this directory is ~/eos/contracts, it's my mistake.

Toormi avatar Sep 12 '17 03:09 Toormi

Closing this issue, the original and tag-on issue seem fixed

wanderingbort avatar Sep 12 '17 22:09 wanderingbort