paritytech / canvas Goto Github PK
View Code? Open in Web Editor NEWNode implementation for Canvas ‒ a Substrate parachain for smart contracts.
License: GNU General Public License v3.0
Node implementation for Canvas ‒ a Substrate parachain for smart contracts.
License: GNU General Public License v3.0
Using ERC-20
or ERC-721
contracts for asset management is considered un-idiomatic. We should push users to use pallet-assets
instead.
There are two ways to integrate this into our chain's workflow:
Some investigation is necessary to see the tradeoffs between the different approaches, and the technical requirements for each.
Steps to reproduce:
canvas-node
from master
ink
repositorycargo run -- --dev --execution Wasm -lruntime=debug
.contract
file2021-01-21 17:53:55.163 DEBUG tokio-runtime-worker runtime:DispatchError
2021-01-21 17:53:55.163 DEBUG tokio-runtime-worker runtime:gas instrumentation failed
2021-01-21 17:53:55.163 DEBUG tokio-runtime-worker runtime:PostInfo:
2021-01-21 17:53:55.163 DEBUG tokio-runtime-worker runtime:actual_weight=
2021-01-21 17:53:55.163 DEBUG tokio-runtime-worker runtime:max-weight
2021-01-21 17:53:55.163 DEBUG tokio-runtime-worker runtime:pays_fee=
2021-01-21 17:53:55.163 DEBUG tokio-runtime-worker runtime:Yes
Add license file (GPL 3?) and headers to all source code files.
Which tag of this canvas-node repo should I use with v3.0.0-rc3 ink smart contract?
Question
I was able to deploy an ink contract, query, transact on it etc. The issue is that i am losing the ability to interact with the smart contract around 2 hours after it is deployed. I understand that this is a persistence issue.
However i did start the node with the following command:
canvas --dev #(instead of canvas --dev --tmp)
Which i understand should keep the state.
Deploy smart contract with polkadot.js or canvas-ui
Interact with it for 2 hours and then sometime after any interaction will fail
Here is a snippit of the code i am using to deploy the contract and then interact with it, i also commented where the error occurs after two hours.
https://gist.github.com/ILoomans/e8cb55c72f8b1b274da7fc375cb5a6ba
Hope someone can help!
I am trying to run canvas-node by follow command:
cargo install canvas-node --git https://github.com/paritytech/canvas-node.git --tag v0.1.6 --force --locked
Error message:
Compiling frame-support-procedural-tools v3.0.0 (https://github.com/paritytech/substrate#4551b3c5)
thread 'rustc' panicked at 'assertion failed: self.start_pos.to_u32() + total_extra_bytes <= bpos.to_u32()', compiler/rustc_span/src/lib.rs:1511:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md
note: rustc 1.53.0-nightly (7f4afdf02 2021-04-22) running on x86_64-unknown-linux-gnu
note: compiler flags: -Z instrument-coverage -C prefer-dynamic -C embed-bitcode=no -C debug-assertions=off --crate-type proc-macro
note: some of the compiler flags provided by cargo are hidden
query stack during panic:
#0 [mir_promoted] processing `Multihash`
#1 [mir_borrowck] borrow-checking `Multihash`
end of query stack
error: could not compile `multihash-derive`
To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish..
I'm unable to install canvas-node
to contracts CI image here.
error[E0282]: type annotations needed
--> /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/sp-arithmetic-2.0.0/src/fixed_point.rs:541:9
|
541 | let accuracy = P::ACCURACY.saturated_into();
| ^^^^^^^^ consider giving `accuracy` a type
...
1595 | / implement_fixed!(
1596 | | FixedI64,
1597 | | test_fixed_i64,
1598 | | i64,
... |
1601 | | "_Fixed Point 64 bits signed, range = [-9223372036.854775808, 9223372036.854775807]_",
1602 | | );
| |__- in this macro invocation
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0282]: type annotations needed
--> /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/sp-arithmetic-2.0.0/src/fixed_point.rs:541:9
|
541 | let accuracy = P::ACCURACY.saturated_into();
| ^^^^^^^^ consider giving `accuracy` a type
...
1604 | / implement_fixed!(
1605 | | FixedI128,
1606 | | test_fixed_i128,
1607 | | i128,
... |
1611 | | [-170141183460469231731.687303715884105728, 170141183460469231731.687303715884105727]_",
1612 | | );
| |__- in this macro invocation
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0282]: type annotations needed
--> /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/sp-arithmetic-2.0.0/src/fixed_point.rs:541:9
|
541 | let accuracy = P::ACCURACY.saturated_into();
| ^^^^^^^^ consider giving `accuracy` a type
...
1614 | / implement_fixed!(
1615 | | FixedU128,
1616 | | test_fixed_u128,
1617 | | u128,
... |
1621 | | [0.000000000000000000, 340282366920938463463.374607431768211455]_",
1622 | | );
| |__- in this macro invocation
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0282`.
error: could not compile `sp-arithmetic`
To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: failed to compile `canvas-node v0.1.0 (https://github.com/paritytech/canvas-node?tag=v0.1.2#50143553)`, intermediate artifacts can be found at `/tmp/cargo-install6UH3ra`
Caused by:
build failed
error building at STEP "RUN set -eux; echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list; echo "deb http://apt.llvm.org/buster/ llvm-toolchain-buster-8 main" > /etc/apt/sources.list.d/llvm.list; echo "deb-src http://apt.llvm.org/buster/ llvm-toolchain-buster-8 main" >> /etc/apt/sources.list.d/llvm.list; apt-get -y update; apt-get remove -y --purge clang; apt-get install -y --no-install-recommends llvm-8-dev clang-8 zlib1g-dev npm yarn wabt unzip; update-alternatives --install /usr/bin/clang clang /usr/bin/clang-8 100; update-alternatives --install /usr/bin/cc cc /usr/bin/clang-8 100; rustup toolchain install nightly --target wasm32-unknown-unknown --profile minimal --component rustfmt rust-src; rustup default nightly; cargo install pwasm-utils-cli --bin wasm-prune; cargo install cargo-contract; cargo install --git https://github.com/hyperledger-labs/solang --tag m7; cargo install --git https://github.com/paritytech/canvas-node --tag v0.1.2; yarn --version; rustup show; cargo --version; solang --version; rm -rf "${CARGO_HOME}/registry" "${CARGO_HOME}/git" /root/.cache/sccache; apt-get autoremove -y; apt-get clean; rm -rf /var/lib/apt/lists/*": error while running runtime: exit status 101
We want to make sure that we have a safe and functional chainspec for deployment to Rococo. This means not using the default well-known accounts (Alice
, Bob
, etc.), adding faucet and ink-waterfall
accounts, as well as pointing to some live bootnodes.
Paragon node implementation
Install dependencies with: cargo install canvas-node --git https://github.com/paritytech/canvas-node.git --force --locked
. It fails without using --locked
.
Run canvas --dev --tmp
Get some errors in the terminal saying it is a bug and to create an issue
2021-08-14 14:07:03 Running in --dev mode, RPC CORS has been disabled.
2021-08-14 14:07:03 Canvas Node
2021-08-14 14:07:03 ✌️ version 0.1.0-42252ba-x86_64-macos
2021-08-14 14:07:03 ❤️ by Canvas, 2020-2021
2021-08-14 14:07:03 📋 Chain specification: Development
2021-08-14 14:07:03 🏷 Node name: spotted-ring-7868
2021-08-14 14:07:03 👤 Role: AUTHORITY
2021-08-14 14:07:03 💾 Database: RocksDb at /var/folders/qf/31y_8fmd0ybc168g4kqkklw40000gn/T/substrateoPNlI2/chains/dev/db
2021-08-14 14:07:03 ⛓ Native runtime: canvas-12 (canvas-0.tx1.au1)
2021-08-14 14:07:03 🔨 Initializing Genesis block/state (state: 0xc64e…6c67, header-hash: 0xf67b…7bc0)
2021-08-14 14:07:03 👴 Loading GRANDPA authority set from genesis on what appears to be first startup.
2021-08-14 14:07:03 ⏱ Loaded block-time = 6s from block 0xf67bd5d8dfbfcc3ef1d57ac5ed74f1c918a1145a36ced46f25d862eaddec7bc0
2021-08-14 14:07:03 Using default protocol ID "sup" because none is configured in the chain specs
2021-08-14 14:07:03 🏷 Local node identity is: 12D3KooWQgVboU7PT7z7FMdsw8gXYkR4SGjsoQswpWiPNp2suxez
2021-08-14 14:07:03 could not parse an IP from hosts file
====================
Version: 0.1.0-42252ba-x86_64-macos
0: backtrace::backtrace::trace
1: backtrace::capture::Backtrace::new
2: sp_panic_handler::set::{{closure}}
3: std::panicking::rust_panic_with_hook
at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/std/src/panicking.rs:626:17
4: std::panicking::begin_panic_handler::{{closure}}
at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/std/src/panicking.rs:519:13
5: std::sys_common::backtrace::__rust_end_short_backtrace
at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/std/src/sys_common/backtrace.rs:141:18
6: rust_begin_unwind
at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/std/src/panicking.rs:515:5
7: core::panicking::panic_fmt
at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/core/src/panicking.rs:92:14
8: core::result::unwrap_failed
at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/core/src/result.rs:1355:5
9: hyper_rustls::connector::HttpsConnector<hyper::client::connect::http::HttpConnector>::new
10: sc_offchain::api::http::SharedClient::new
11: sc_offchain::OffchainWorkers<Client,Block>::new
12: sc_service::builder::build_offchain_workers
13: canvas::command::run::{{closure}}::{{closure}}
14: tokio::runtime::enter::Enter::block_on
15: tokio::runtime::context::enter
16: sc_cli::runner::Runner<C>::run_node_until_exit
17: canvas::command::run
18: canvas::main
19: std::sys_common::backtrace::__rust_begin_short_backtrace
20: std::rt::lang_start::{{closure}}
21: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once
at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/core/src/ops/function.rs:259:13
std::panicking::try::do_call
at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/std/src/panicking.rs:401:40
std::panicking::try
at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/std/src/panicking.rs:365:19
std::panic::catch_unwind
at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/std/src/panic.rs:434:14
std::rt::lang_start_internal
at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/std/src/rt.rs:34:21
22: _main
Thread 'main' panicked at 'cannot access native cert store: Custom { kind: Other, error: Error { code: -25262, message: "The Trust Settings Record was corrupted." } }', /Users/alixe/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-rustls-0.21.0/src/connector.rs:46
Any suggestions to troubleshoot and fix?
Thanks
Hi, I faced an issue when I made my node public. I get 1006 WebSocket error in my app and when I check my server the node shows this error:
Accepted a new tcp connection from 127.0.0.1:43022.
Unable to build WebSocket connection WS Error <Capacity>: Unable to add another connection to the event loop.
How can I increase the limit?
The Polkadot JS UI recently added functionality for a standalone "teleport" tab for the Rococo network (this already existed in Westend for example). We should update the README to use that instead of showing the manually crafted XCM extrinsic.
Need some help to understand what needs to be changed to increase the block gas limit
set -e
echo "*** Initializing WASM build environment"
if [ -z $CI_PROJECT_NAME ] ; then
rustup update nightly
rustup update nightly-2020-10-05
rustup update stable
fi
rustup target add wasm32-unknown-unknown --toolchain nightly
rustup target add wasm32-unknown-unknown --toolchain nightly-2020-10-05
Currently canvas
runs as a solo chain, but ultimately it should be a parachain. This will involve migrating to use cumulus
, and if possible still allow it to run as a solochain for the testnet, Moonbeam appear to have achieved something along those lines.
According to @athei, there are still some outstanding issues which need to be resolved before the contracts
pallet will work on a parachain:
When installing canvas node using
cargo install canvas-node --git https://github.com/paritytech/canvas-node.git --tag v0.1.9 --force --locked
It fails with the following error:
error[E0034]: multiple applicable items in scope
--> /Users/xxx/.cargo/registry/src/github.com-1ecc6299db9ec823/prost-derive-0.7.0/src/lib.rs:109:14
|
109 | .intersperse(quote!(|));
| ^^^^^^^^^^^ multiple `intersperse` found
|
= note: candidate #1 is defined in an impl of the trait `Iterator` for the type `Map<I, F>`
= note: candidate #2 is defined in an impl of the trait `Itertools` for the type `T`
help: disambiguate the associated function for candidate #1
|
105 ~ let tags = Iterator::intersperse(field
106 + .tags()
107 + .into_iter()
108 + .map(|tag| quote!(#tag)), {
109 + let mut _s = $crate::__private::TokenStream::new();
110 + $crate::quote_each_token!(_s $($tt)*);
...
help: disambiguate the associated function for candidate #2
|
105 ~ let tags = Itertools::intersperse(field
106 + .tags()
107 + .into_iter()
108 + .map(|tag| quote!(#tag)), {
109 + let mut _s = $crate::__private::TokenStream::new();
110 + $crate::quote_each_token!(_s $($tt)*);
...
For more information about this error, try `rustc --explain E0034`.
error: could not compile `prost-derive` due to previous error
warning: build failed, waiting for other jobs to finish...
error: failed to compile `europa v0.3.2 (https://github.com/patractlabs/europa.git#f6da65d2)`, intermediate artifacts can be found at `/var/folders/qt/_kwnr6197b120zf0302c_p7r0000gn/T/cargo-installJ7sHVi`
Caused by:
build failed
It seems like the compiler is unable to distinguish the two interperse
functions that are located in different namespaces: Iterator::intersperse
and Itertools::intersperse
. Although in the prost-derive downstream package only the Itertools
lib is imported. I'm new to Rust so I'm not sure why this is happening.
There should be an option to install canvas-node
without compiling the entire project. In this blog post regarding working with ink! it's mentioned that it took him 31 minutes to compile the project. That's definitely too long if somebody just wants to write a contract and test it.
Talk to ops how they do this for Polkadot, we can probably take a similar pipeline.
A canvas-node
binary should be provided with the latest release.
Update docs/tutorials so that they mention installing the binary as the first option.
The parachain is currently no longer working.
cumulus
versionWhen trying to deploy a contract via @polkadot/api
, I get an error Cannot read property 'batch' of undefined
According to polkadot-js/api#3268, this seems to be caused by the utility module being missing from the runtime, if I understood correctly
I have the following error when deploying the Flipper contract on a local substrate node. Does anyone what is the cause and how to solve this issue?
Unable to decode storage system.account: entry 0:: createType(AccountInfo):: {"nonce":"Index","consumers":"RefCount","providers":"RefCount","sufficients":"RefCount","data":"AccountData"}:: Decoded input doesn't match input, received 0x0000000000000000000000000000000000000000000000000000000000000000…0000000000000000000000000000000000000000000000000000000000000000 (76 bytes), created 0x0000000000000000000000000000000000000000000000000000000000000000…0000000000000000000000000000000000000000000000000000000000000000 (80 bytes)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.