There is a CLI: agent-rs/icx-asset at main · dfinity/agent-rs · GitHub
Excellent! Thank you
I want to add a npm package making this simple in JS, too
That would also be excellent
That’s what I was going to do but I probably won’t now
Can it be used locally? Do you know how that would be done? I passed it a local canister id and I get this error:
thread 'main' panicked at 'Could not create HTTP client.: reqwest::Error { kind: Builder, source: "Unknown TLS backend passed to `use_preconfigured_tls`" }', /home/lastmjs/.cargo/registry/src/github.com-1ecc6299db9ec823/ic-agent-0.10.0/src/agent/http_transport.rs:62:18
If you’ve got the time and motivation to write it up, I’m happy to see if we could get you set up with a grant for it!
I think I’m running into this issue: chore: update cargo dependencies by ericswanson-dfinity · Pull Request #285 · dfinity/agent-rs · GitHub
Ah thanks for the offer, I should really get back to the TypeScript, Python CDKs and Sudograph. I’m taking a slight detour for this: https://twitter.com/dominic_w/status/1467144071449915395
Checks a lot of boxes for me, Demergence has issues with streaming, easy to pick up too
I got it to work by installing the main branch
I’ve been doing that with a little zsh script, but it sounds like you’re up and running!
Offer is still there? I would be interested to give it a go if I have some help
Thanks I could definitely use some help.
I have a rough idea on where to start by calling the asset canister actor methods, but I have few questions:
1-What is the order of calling these methods or the order of the process? create_batch, commit_batch etc…
2- how do you authorize the actor from within the script? ‘dfx deploy’ do that automatically but I am not sure how to do that manually
I found how to authorize with your private key in here
That was really helpful
For those running into the same issue (I got it from using ic-repl
), just make sure to update the Cargo.toml of the binary you’re trying to build like this:
-ic-agent = "0.9.0"
+ic-agent = { git = "https://github.com/dfinity/agent-rs" }
I tested it and it works great for local development. Can this be used to upload assets to a canister deployed on mainnet too?
Yes it can:
icx-asset --pem identity.pem --replica https://ic0.app upload n6au6-3aaaa-aaaae-qaaxa-cai index.html