new cleos set contract params don't seem to behave as documented
$ ./cleos set contract --help
Create or update the contract on an account
Usage: ./cleos set contract [OPTIONS] account contract-dir [wast-file] [abi-file]
Positionals:
account TEXT The account to publish a contract for
contract-dir TEXT The the path containing the .wast and .abi
wast-file TEXT The file containing the contract WAST or WASM relative to contract-dir
abi-file TEXT The ABI for the contract relative to contract-dir
I would have expected this to work..
$ ls ~/eos/build/contracts/eosio.bios
CMakeFiles Makefile eosio.bios.abi eosio.bios.bc eosio.bios.s eosio.bios.wast.hpp
CTestTestfile.cmake cmake_install.cmake eosio.bios.abi.hpp eosio.bios.cpp.bc eosio.bios.wast
$ ./cleos set contract eosio ~/eos/build/contracts/eosio.bios eosio.bios.wast eosio.bios.abi
Reading WAST...
Assembling WASM...
1941681ms thread-0 main.cpp:1186 main ] Failed with error: Assert Exception (10)
!"error parsing wast": Error parsing WebAssembly text file:
:1:1: expected '('
^
same error here on Mac / master using the "currency" contract I'm trying to follow the tutorial steps: https://github.com/EOSIO/eos#singlenode
I also tried by using eosiocpp to generate the .wast file from the source code in /contracts/currency but it throws exactly the same error.
$ cleos set contract currency currency.wast currency.abi
Reading WAST...
Assembling WASM...
2370762ms thread-0 main.cpp:1186 main ] Failed with error: Assert Exception (10)
!"error parsing wast": Error parsing WebAssembly text file:
:1:1: expected '('
{
^
cleos set contract currency ./currency -p currency ./currency is a contract directory.
that worked like a charm! thanks!
when I typed that commands, error has occured like
File is actually a directory: ../../contracts/currency ERROR: ValidationError: wast-file=../../contracts/currency Create or update the contract on an account Usage: cleos set contract [OPTIONS] account wast-file [abi-file]
I'm using mac and the branch is f6f8c66505cb6469e0c2e6027a03f72f1c9fd1a9.
Furthermore, if the filenames of the ABI and WAST don't match their parent directory's name, cleos won't find them.
Repro:
- mkdir /cleosIssue
- put myContract.wast and myContract.abi into /cleosIssue
- cleos set contract foo /cleosIssue myContract.wast myContract.abi Expected: Cleos would find the wast and abi just fine Actual: Cleos cannot find them, the only resolution is to rename /cleosIssue to /myContract (which is fine in practice, but the -h message implies that this is not supposed to be necessary)
Seems like for the wast file and abi file, it's relative path to current dir instead of contract dir, because the following works:
./cleos set contract eosio ~/eos/build/contracts/eosio.bios ~/eos/build/contracts/eosio.bios /eosio.bios.wast ~/eos/build/contracts/eosio.bios /eosio.bios.abi