How can I query contract info with the latest polkadot-js and substrate contracts node? - substrate

I've been unable to query my existing contract recently due to Unable to create Enum via index 128, in Alive, Tombstone when using api.query.contracts.contractInfoOf. I get this error both on the command line and in the polkadot-js apps explorer.
These are the steps I took:
Deploy a contract with a salt
Retrieve the contract deployedAddress
Use contractInfoOf
const contractInfo = await api.query.contracts.contractInfoOf(deployedAddress);
I've tried downgrading ink! to 3.0-rc5, 3.0-rc4, 3.0-rc3 and then compiling but it doesn't seem to make any difference. Whenever my contract is built it references rc6 at the top:
{"metadataVersion":"0.1.0","source":{"hash":"0x...","language":"ink! 3.0.0-rc6","compiler":"rustc 1.58.0-nightly",
Which suggests its ignoring my .toml and using rc6 to compile the contract.
I changed my cargo-contract version to 0.14 but that causes polkadot-js to fail at reading the contract abi.
I've tried using the substrate-contracts-node using the latest commit from master and also using the v0.1.0 release. Same error in both cases.
> rustup info
stable-x86_64-unknown-linux-gnu (default)
rustc 1.56.1 (59eed8a2a 2021-11-01)
There are more details in an issue on polkadot-js.
Any pointers on how to get a working setup would be very helpful!

The problem here was substrate-contracts-node using an old version of the metadata.
I was able to check out the repo before the metadata merge was reverted and build locally (cargo build).
So checkout 8d91b8e to get the node to work with versions 7.7.1 and 6.6.1 of polkadot-js packages.
> git checkout 8d91b8e578065a7c06433cbd41ac059bf478a0bd
> cargo build
> ./target/debug/substrate-contracts-node --dev --tmp --version
substrate-contracts-node 0.1.0-8d91b8e-x86_64-linux-gnu

Related

Access denied when building esp-idf-sys for Rust project for ESP32 on Windows 10

I'm attempting to set up this Rust template project to get started doing Rust development for ESP32: https://github.com/esp-rs/esp-idf-template
I've installed the Rustup esp toolchain, as described here: https://github.com/esp-rs/rust-build
At the Generate the Project step, I chose these parameters:
Configure project to use Dev Containers = false
ESP-IDF native build version = v4.4
Rust toolchain = esp
STD Support = true
MCU = esp32
At the Build step, I get this output (second run displayed, first run compiles a long list of dependencies before this point):
C:\Users\Me\boop\doop>cargo build
Compiling esp-idf-sys v0.31.6
error: failed to run custom build command for `esp-idf-sys v0.31.6`
Caused by:
process didn't exit successfully: `C:\Users\Me\boop\doop\target\debug\build\esp-idf-sys-cafd80a349bfdbb2\build-script-build` (exit code: 1)
--- stdout
cargo:rerun-if-env-changed=IDF_PATH
cargo:rerun-if-env-changed=ESP_IDF_TOOLS_INSTALL_DIR
cargo:rerun-if-env-changed=ESP_IDF_VERSION
cargo:rerun-if-env-changed=ESP_IDF_REPOSITORY
cargo:rerun-if-env-changed=ESP_IDF_SDKCONFIG_DEFAULTS
cargo:rerun-if-env-changed=ESP_IDF_SDKCONFIG
cargo:rerun-if-env-changed=MCU
IDF_PYTHON_ENV_PATH=C:\Users\Me\boop\doop\.embuild\espressif\python_env\idf4.4_py3.10_env
PATH=C:\Users\Me\boop\doop\.embuild\espressif\tools\esp32ulp-elf\2.28.51-esp-20191205\esp32ulp-elf-binutils\bin;C:\Users\Me\boop\doop\.embuild\espressif\tools\cmake\3.23.1\bin;C:\Users\Me\boop\doop\.embuild\espressif\tools\ninja\1.10.2\;C:\Users\Me\boop\doop\.embuild\espressif\python_env\idf4.4_py3.10_env\Scripts;C:\Users\Me\boop\doop\.embuild\espressif\esp-idf\release-v4.4\tools;%PATH%
Current system platform: win64
Skipping xtensa-esp32-elf#esp-2021r2-patch3-8.4.0 (already installed)
Skipping cmake#3.23.1 (already installed)
Skipping ninja#1.10.2 (already installed)
Skipping esp32ulp-elf#2.28.51-esp-20191205 (already installed)
IDF_PYTHON_ENV_PATH=C:\Users\Me\boop\doop\.embuild\espressif\python_env\idf4.4_py3.10_env
PATH=C:\Users\Me\boop\doop\.embuild\espressif\tools\esp32ulp-elf\2.28.51-esp-20191205\esp32ulp-elf-binutils\bin;C:\Users\Me\boop\doop\.embuild\espressif\tools\cmake\3.23.1\bin;C:\Users\Me\boop\doop\.embuild\espressif\tools\ninja\1.10.2\;C:\Users\Me\boop\doop\.embuild\espressif\python_env\idf4.4_py3.10_env\Scripts;C:\Users\Me\boop\doop\.embuild\espressif\esp-idf\release-v4.4\tools;%PATH%
--- stderr
Using managed esp-idf repository: EspIdfRemote { repo_url: None, git_ref: Branch("release/v4.4") }
fatal: No names found, cannot describe anything.
Using esp-idf v4.4.1 at 'C:\Users\Me\boop\doop\.embuild\espressif\esp-idf\release-v4.4'
fatal: No names found, cannot describe anything.
Error: Access is denied. (os error 5)
I get the same error when I choose ESP-IDF native build version = v4.3.2, although without the fatal: No names found, cannot describe anything. messages.
I get an identical error when attempting to build this Rust ESP32 demo project: https://github.com/ivmarkov/rust-esp32-std-demo
This was run as Administrator.
In my search for a solution, I found this: Why os.rename sometimes returns error access is denied python Per the top answer, I disabled "Show frequently used folders in Quick access" in File explorer, but unfortunately the build error has not changed.
What access is being denied, and what could be causing the denial, even when run as Administrator?
Secondarily, what is the cause and meaning of the fatal: No names found, cannot describe anything. messages?
I've been working through the same issue today.
It is caused by a change in the embuild dependency: https://github.com/esp-rs/embuild/commit/d8f8da228f1e1e6c105074d96617a8601092f633
Trying to write permission data to an open file causes the 'os error 5
I've submitted a PR to the project: https://github.com/esp-rs/embuild/pull/56
Now merged, cargo update and you should be good!

Bitbake tries to fetch sources from unavailable URL and they fail

I'm currently trying to set up an environment for Yocto project for my personal study.
I was clueless about where to start Yocto so I bought the book Embedded Linux Projects Using Yocto Project Cookbook but it keeps failing to build the environment.
I've run only simple commands. I ran source oe-init-build-env <dir name> to make a directory and ran bitbake core-image-minimal.
But bitbake command keeps giving me errors like this. This is the log.
WARNING: Host distribution "Ubuntu-18.04" has not been validated with this version of the build system; you may possibly experience unexpected failures. It is recommended that you use a tested distribution.
Parsing recipes: 100%
|#################################################################################| Time: 00:00:25Parsing of 891 .bb files complete (0 cached, 891 parsed). 1287 targets, 61 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies
Build Configuration:
BB_VERSION = "1.24.0"
BUILD_SYS = "x86_64-linux"
NATIVELSBSTRING = "Ubuntu-18.04"
TARGET_SYS = "arm-poky-linux-gnueabi"
MACHINE = "qemuarm"
DISTRO = "poky"
DISTRO_VERSION = "1.7.3"
TUNE_FEATURES = "arm armv5 thumb dsp"
TARGET_FPU = "soft"
meta
meta-yocto
meta-yocto-bsp = "dizzy:58863ad092c9a279e305c841dbb4353de2ecfae8"
NOTE: Preparing runqueue
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
WARNING: Failed to fetch URL http://www.zlib.net/zlib-1.2.8.tar.xz, attempting MIRRORS if available
WARNING: Failed to fetch URL http://www.multiprecision.org/mpc/download/mpc-1.0.2.tar.gz, attempting MIRRORS if available
WARNING: Failed to fetch URL ftp://ftp.gmplib.org/pub/gmp-6.0.0/gmp-6.0.0a.tar.bz2, attempting MIRRORS if available
WARNING: Failed to fetch URL http://ymorin.is-a-geek.org/download/kconfig-frontends/kconfig-frontends-3.12.0.0.tar.xz, attempting MIRRORS if available
WARNING: Failed to fetch URL http://download.gna.org/cryptodev-linux/cryptodev-linux-1.6.tar.gz, attempting MIRRORS if available
WARNING: Checksum failure encountered with download of http://www.bzip.org/1.0.6/bzip2-1.0.6.tar.gz - will attempt other sources if available
WARNING: Renaming /opt/yocto/poky/qemuarm/downloads/bzip2-1.0.6.tar.gz to /opt/yocto/poky/qemuarm/downloads/bzip2-1.0.6.tar.gz_bad-checksum_2ae3e6c958d83d2855a37f13fe29fd95
WARNING: Failed to fetch URL http://gnome-build-stage-1.googlecode.com/files/uuid-1.6.2.tar.gz, attempting MIRRORS if available
WARNING: Checksum failure encountered with download of http://rpm5.org/files/popt/popt-1.16.tar.gz - will attempt other sources if available
WARNING: Renaming /opt/yocto/poky/qemuarm/downloads/popt-1.16.tar.gz to /opt/yocto/poky/qemuarm/downloads/popt-1.16.tar.gz_bad-checksum_9e09d0bf772649c5ba385c48ba2d3547
WARNING: Failed to fetch URL http://zlib.net/pigz/pigz-2.3.1.tar.gz, attempting MIRRORS if available
WARNING: Checksum failure encountered with download of http://www.rpm5.org/files/rpm/rpm-5.4/rpm-5.4.14-0.20131024.src.rpm;extract=rpm-5.4.14.tar.gz - will attempt other sources if available
WARNING: Renaming /opt/yocto/poky/qemuarm/downloads/rpm-5.4.14-0.20131024.src.rpm to /opt/yocto/poky/qemuarm/downloads/rpm-5.4.14-0.20131024.src.rpm_bad-checksum_6a8d9bc6a7e0162d7ff72fefc9e841e5
WARNING: Failed to fetch URL http://downloads.sourceforge.net/expat/expat-2.1.0.tar.gz, attempting MIRRORS if available
WARNING: Failed to fetch URL ftp://invisible-island.net/byacc/byacc-20140422.tgz, attempting MIRRORS if available
WARNING: Failed to fetch URL http://pkg-shadow.alioth.debian.org/releases/shadow-4.2.1.tar.xz, attempting MIRRORS if available
I checked the URLs in the log and it turned out they are all 404 pages. And most importantly, it terminates by showing this message.
ERROR: Error executing a python function in /opt/yocto/poky/meta/recipes-devtools/gcc/gcc-source_4.9.bb:
The stack trace of python calls that resulted in this exception/failure was:
File: 'do_preconfigure', lineno: 12, function: <module>
0008: cmd = d.expand("sed -i 's/BUILD_INFO=info/BUILD_INFO=/' /opt/yocto/poky/qemuarm/tmp/work-shared/gcc-4.9.1-r0/gcc-4.9.1/gcc/configure")
0009: subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
0010:
0011:
*** 0012:do_preconfigure(d)
0013:
File: 'do_preconfigure', lineno: 5, function: do_preconfigure
0001:
0002:def do_preconfigure(d):
0003: import subprocess
0004: cmd = d.expand('PATH=/opt/yocto/poky/scripts:/opt/yocto/poky/qemuarm/tmp/sysroots/x86_64-linux/usr/bin/arm-poky-linux-gnueabi:/opt/yocto/poky/qemuarm/tmp/sysroots/qemuarm/usr/bin/crossscripts:/opt/yocto/poky/qemuarm/tmp/sysroots/x86_64-linux/usr/sbin:/opt/yocto/poky/qemuarm/tmp/sysroots/x86_64-linux/usr/bin:/opt/yocto/poky/qemuarm/tmp/sysroots/x86_64-linux/sbin:/opt/yocto/poky/qemuarm/tmp/sysroots/x86_64-linux/bin:/opt/yocto/poky/scripts:/opt/yocto/poky/bitbake/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/mnt/c/Program Files/WindowsApps/CanonicalGroupLimited.Ubuntu18.04onWindows_1804.2020.824.0_x64__79rhkp1fndgsc:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/:/mnt/c/WINDOWS/System32/OpenSSH/:/mnt/c/Users/kimth/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/kimth/AppData/Local/Programs/MiKTeX 2.9/miktex/bin/x64/:/mnt/c/Users/kimth/AppData/Roaming/TinyTeX/bin/win32:/snap/bin cd /opt/yocto/poky/qemuarm/tmp/work-shared/gcc-4.9.1-r0/gcc-4.9.1 && gnu-configize')
*** 0005: subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
0006: # See 0044-gengtypes.patch, we need to regenerate this file
0007: bb.utils.remove(d.expand("/opt/yocto/poky/qemuarm/tmp/work-shared/gcc-4.9.1-r0/gcc-4.9.1/gcc/gengtype-lex.c"))
0008: cmd = d.expand("sed -i 's/BUILD_INFO=info/BUILD_INFO=/' /opt/yocto/poky/qemuarm/tmp/work-shared/gcc-4.9.1-r0/gcc-4.9.1/gcc/configure")
0009: subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
File: '/usr/lib/python2.7/subprocess.py', lineno: 223, function: check_output
0219: if retcode:
0220: cmd = kwargs.get("args")
0221: if cmd is None:
0222: cmd = popenargs[0]
*** 0223: raise CalledProcessError(retcode, cmd, output=output)
0224: return output
0225:
0226:
0227:def list2cmdline(seq):
Exception: CalledProcessError: Command 'PATH=/opt/yocto/poky/scripts:/opt/yocto/poky/qemuarm/tmp/sysroots/x86_64-linux/usr/bin/arm-poky-linux-gnueabi:/opt/yocto/poky/qemuarm/tmp/sysroots/qemuarm/usr/bin/crossscripts:/opt/yocto/poky/qemuarm/tmp/sysroots/x86_64-linux/usr/sbin:/opt/yocto/poky/qemuarm/tmp/sysroots/x86_64-linux/usr/bin:/opt/yocto/poky/qemuarm/tmp/sysroots/x86_64-linux/sbin:/opt/yocto/poky/qemuarm/tmp/sysroots/x86_64-linux/bin:/opt/yocto/poky/scripts:/opt/yocto/poky/bitbake/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/mnt/c/Program Files/WindowsApps/CanonicalGroupLimited.Ubuntu18.04onWindows_1804.2020.824.0_x64__79rhkp1fndgsc:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/:/mnt/c/WINDOWS/System32/OpenSSH/:/mnt/c/Users/kimth/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/kimth/AppData/Local/Programs/MiKTeX 2.9/miktex/bin/x64/:/mnt/c/Users/kimth/AppData/Roaming/TinyTeX/bin/win32:/snap/bin cd /opt/yocto/poky/qemuarm
I feel like I need to modify conf files to fetch available URLs but I'm new to Yocto and Bitbake so I'm very lost now. I would appreciate if anyone could tell me where to find solutions. Thank you and stay safe everyone.
You seem to use quite an old yocto version 1.7.3 while there is already 3.3 released. This means also you try to build recipes for some packages that are also old and hence some URLs might be unavailable. Might it be an option for you to use a newer version?
If this is no option for you, one thing to try would be setting MIRROR (see [1]) to a mirror [2] where those packages are still available. But this approach I would not prefer.
[1] https://www.yoctoproject.org/docs/1.7/bitbake-user-manual/bitbake-user-manual.html#var-MIRRORS
[2] could be: http://downloads.yoctoproject.org/mirror/sources/
1.7.3 is a very old release of the project, originally released in 2015 with a last point release in 2016. The fetcher warnings you see aren't the problem, they're warnings but it will fall back to the project mirrors. If it hadn't fallen back correctly, it would have shown errors as well as the warnings. The bigger problem is in fact this:
WARNING: Host distribution "Ubuntu-18.04" has not been validated with this version of the build system; you may possibly experience unexpected failures. It is recommended that you use a tested distribution.
Since Ubuntu 18.04 is three years newer than the project release you're using, there is no way it would be compatible with that release. You need to use a host OS from the era of the release, so Ubuntu 16.04 may work better. This is because the host OS provides gcc used to build the cross tools and the newer gcc versions don't tend to work with 100% of old code without tweaks.
So in short, use an older distro if you want to try and get that to build.

Go broken import

I'm trying to interact with helm via the go SDK and I'm getting the following error when I try to build my code:
../../../go/pkg/mod/github.com/deislabs/oras#v0.11.1/pkg/oras/push.go:52:31: not enough arguments in call to remotes.PushContent
have (context.Context, remotes.Pusher, v1.Descriptor, "github.com/containerd/containerd/content".Store, nil, func(images.Handler) images.Handler)
want (context.Context, remotes.Pusher, v1.Descriptor, "github.com/containerd/containerd/content".Store, *semaphore.Weighted, platforms.MatchComparer, func(images.Handler) images.Handler)
I've traced it down to package helm.sh/helm/v3/pkg/action :
$ go get helm.sh/helm/v3/pkg/action
# github.com/deislabs/oras/pkg/oras
../../../go/pkg/mod/github.com/deislabs/oras#v0.11.1/pkg/oras/push.go:52:31: not enough arguments in call to remotes.PushContent
have (context.Context, remotes.Pusher, v1.Descriptor, "github.com/containerd/containerd/content".Store, nil, func(images.Handler) images.Handler)
want (context.Context, remotes.Pusher, v1.Descriptor, "github.com/containerd/containerd/content".Store, *semaphore.Weighted, platforms.MatchComparer, func(images.Handler) images.Handler)
I suspect that this is related to this change: https://github.com/helm/helm/commit/663c5698878c959805de053116581d15673e1ce3
How do I fix this? I've tried using older versions of the helm package to no avail.
The signature for github.com/containerd/containerd/remotes.PushContent was changed incompatibly in commit f8c2f0, which was released in v1.5.0. (The containerd Go API appears to be unstable, despite its apparently-semantic version v1.5.5; see containerd#3554.)
The short-term fix is to go get -d github.com/containerd/containerd#v1.4 to downgrade to the latest v1.4.* until your dependencies are compatible with the latest release.
The longer-term fix appears to be helm commit 663c56, which migrates to a different oras library whose latest release is compatible with the containerd v1.5 API. As far as I can tell that commit has not yet been included in a helm release, but you may be able to try it out using go get -d helm.sh/helm/v3/pkg/action#main; see https://golang.org/doc/modules/managing-dependencies#repo_identifier.

Hipster stack (Yeoman + Maven + Spring) Error

When I tried to generate with yo jhipster on Windows 7 32 bits machine, I got the below error:
bower json3#~3.2.5 progress received 3.7MB of 4.9MB
downloaded, 75% libjpeg-62.dll: downloading [===================]
100% 0.0s
? pre-build test failed, compiling from source...
d:\Self_jhipster\node_modules\grunt-contrib-imagemin\node_modules\jpegtran-bin\
lib\check.js:19
throw new Error('building is not supported on ' + process.platform);
^ Error: building is not supported on win32
at d:\Self_jhipster\node_modules\grunt-contrib-imagemin\node_modules\jpegtran-bin\lib\check.js:19:10
How to solve this error?
I'm the author of http://jhipster.github.io/ which is the generator your are referring to.
I have found your problem, it is indeed a bug in jpegtran-bin. I have updated all the dependencies in Grunt.js, and it should now work fine on Windows.
This will be commited in the next release (0.2.1), which should be out in a few hours.
You can also submit a bug at https://github.com/jhipster/generator-jhipster/issues
After google with more correct keywords, the solution from https://github.com/gruntjs/grunt-contrib-imagemin/issues/109 works for me.
In application's package.json, add "jpegtran-bin": "0.2.0" before
the reference for imagemin,
Remove node_module folder locally.
Run npm install again.

Using hgsubversion on Windows

I'm trying to use hgsubversion plugin for mercurial from Windows. Pull from SVN repositpry works on Windows. But when I'm trying to push to the repository, I get the following message:
pushing to svn+ssh://user#server.com/home/user/.repo/test.svn/
abort: command unavailable for Subversion repositories
It seems this happens because hgsubversion is using SWIG bindings instead of subvertpy( on Linux everything works fine with subvertpy)
D:\test\>hg version --svn
hgsubversion: 88f3cda47def
Subversion: 1.6.13
bindings: SWIG
But I didn't find any easy way to install it(now I'm trying to compile it myself, but there are some problems). Maybe I missed something. Bzr is using subvertpy, maybe it is possible to extract it? Any suggestions?
Does anyone using hgsubversion from Windows?
P.S To compile the library i tried this hint: https://bitbucket.org/tortoisehg/thg-winbuild/issue/14/request-add-subvertpy-to-the-default
UPD: solved initial problem with fail on push. The largefiles(which is distributed with mercurial >= 2.0) extension breaks hgsubversion. Just disabled it and got hgsubversion working.
Well, I had slightly different results
hgsubversion: 6c4d15d8cfbd
Subversion: 1.6.13
bindings: SWIG
on my test-repo with commit-auth
Test 1, inside TortoiseHG
Cloned from root http://mayorat.ursinecorner.ru:8088/svn/Hello/
Tip is revision from trunk, edit file, commit OK
On push I got long waiting (really long) on "Searching for changes" stage (without any requests from server)
"Stop operation" show me error message "Basic authentification rejected by server"
Test 2, CLI-mode
Cloned only trunk http://mayorat.ursinecorner.ru:8088/svn/Hello/trunk/
>hg push --stupid
pushing to http://mayorat.ursinecorner.ru:8088/svn/Hello/trunk/
searching for changes
Auth realm: <http://mayorat.ursinecorner.ru:8088> VisualSVN Server
Password for Badger:
Auth realm: <http://mayorat.ursinecorner.ru:8088> VisualSVN Server
Username: lazybadger
Password for lazybadger:
[r32] lazybadger: Cleanups
pulled 1 revisions
saved backup bundle to ...
Can say nothing about first password request, second and third are obvious and correct. 32 revision exist and visible to everybody
Sidenote: my changes doesn't broke linear history of SVN

Resources