cargo-contract icon indicating copy to clipboard operation
cargo-contract copied to clipboard

Instantiating with code-hash returns an Error

Open fbielejec opened this issue 3 years ago • 2 comments

cargo-contract version

HEAD of master

ink version

3.2.0

pallet contracts version

v0.9.23

Bug manifests when creating an instance from an existing on-chain code-hash. Instantitate-with-code uploads and creates a contract instance.

Can be reproduced with the steps outlined here (but it will affect every contract): https://github.com/fbielejec/emit_event

fbielejec avatar Jun 22 '22 13:06 fbielejec

The "Node metadata is not fully compatible" means that the instantiate call is not compatible with the version of pallet_contracts you are using. Can you let me know which commit hash of pallet_contracts you are using?

ascjones avatar Jun 23 '22 12:06 ascjones

We are running on a fork of substrate, although all the changes are in the networking layer (they do not touch runtime). It is based on the head of the polkadot-v0.9.23 branch, and that would be the corresponding pallet_contracts version.

As for reproducing you should be able to use our (public) docker image:

aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/p6e8q1z1

... and a quick one-node compose setup, e.g.:

version: '3'
services:

  smartnode:
    image: public.ecr.aws/p6e8q1z1/aleph-node:latest
    container_name: smartnode
    network_mode: host
    environment:
      - ALLOW_PRIVATE_IPV4=true
      - BASE_PATH=/data/$NODE_ID
      - CHAIN=/data/chainspec.smartnet.json
      - CUSTOM_ARGS=-lruntime::contracts=debug
      - DISCOVER_LOCAL=true
      - NAME=Smartnode
      - NODE_KEY_PATH=/data/$NODE_ID/p2p_secret
      - PORT=30333
      - PURGE_BEFORE_START=true
      - RPC_PORT=9933
      - RUST_LOG=info
      - UNIT_CREATION_DELAY=50
      - WS_PORT=9943
      - BOOT_NODES=/ip4/127.0.0.1/tcp/30333/p2p/$BOOTNODE_PEER_ID
      - PUBLIC_ADDR=/ip4/127.0.0.1/tcp/30333
    volumes:
      - ./data/:/data/

chainspec.smartnet.json.zip

Alternatively you could point the tool to the public endpoint of our testnet: wss://ws.test.azero.dev.

fbielejec avatar Jun 24 '22 09:06 fbielejec