0

I am making my way through the ink! "First Contract" tutorial: https://docs.substrate.io/tutorials/v3/ink-workshop/pt1/

When trying to download the precompiled node:

cargo install contracts-node --git https://github.com/paritytech/substrate-contracts-node.git --tag <latest-tag> --force --locked

I get the following errors:

error[E0046]: not all trait items implemented, missing: `MaxCodeLen`, `RelaxedMaxCodeLen`
     --> /Users/keeganquigley/.cargo/git/checkouts/substrate-contracts-node-cf7c16677784d274/254342f/runtime/src/lib.rs:302:1
      |
  302 | impl pallet_contracts::Config for Runtime {
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `MaxCodeLen`, `RelaxedMaxCodeLen` in implementation
      |
      = help: implement the missing item: `type MaxCodeLen = Type;`
      = help: implement the missing item: `type RelaxedMaxCodeLen = Type;`

  error[E0609]: no field `code_len` on type `Limits`
     --> /Users/keeganquigley/.cargo/git/checkouts/substrate-contracts-node-cf7c16677784d274/254342f/runtime/src/lib.rs:297:19
      |
  297 |         schedule.limits.code_len = 256 * 1024;
      |                         ^^^^^^^^ unknown field
      |
      = note: available fields are: `event_topics`, `stack_height`, `globals`, `parameters`, `memory_pages` ... and 5 others

Regardless of what release I use. substrate-node-template compiles fine and I can run a local node - any ideas on what I am missing here? Thanks!

1 Answer 1

0

I believe that this is a bug in cargo install --git <URL> --locked which ignores the --locked part and updates the substrate dependencies. You can workaround this by cloning the substrate-contracts-node and running the following command there:

git checkout <LATEST_TAG>
cargo install --path ./node/ --locked

For release v0.15.1`:

git clone https://github.com/paritytech/substrate-contracts-node.git
cd substrate-contracts-node
git checkout v0.15.1
cargo install --path ./node/ --locked
1
  • Thanks all, that worked! Got it up and running.
    – Keegan
    May 24 at 18:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.