starknet-remix-plugin icon indicating copy to clipboard operation
starknet-remix-plugin copied to clipboard

Run plugin commands from console

Open stranger80 opened this issue 2 years ago • 22 comments

  • [ ] Allow to run plugin commands from console (instead of clicking in UI)

stranger80 avatar Oct 26 '23 11:10 stranger80

can i try this ?

makluganteng avatar Feb 15 '24 09:02 makluganteng

Sure @makluganteng

rjnrohit avatar Feb 15 '24 10:02 rjnrohit

Thanks , maybe can u elaborate more on the task if thats okey ?

makluganteng avatar Feb 15 '24 10:02 makluganteng

sure. The idea is to use scriptRunner from the terminal console to compile, deploy and interact with the cairo contracts. The terminal you see in the remix interface is the javascript console which can run various scripts.

rjnrohit avatar Feb 15 '24 10:02 rjnrohit

Hi anyway i could get help to set up this env im following the readme but getting fetch error when trying to compile cairo file on remix

makluganteng avatar Feb 16 '24 04:02 makluganteng

Sorry for the inconvenience , I have updated the Developers section in the README. Now, it should not complain these type of errors.

rjnrohit avatar Feb 16 '24 05:02 rjnrohit

for more info about this issue @makluganteng , you can see #28

rjnrohit avatar Feb 16 '24 05:02 rjnrohit

image i still got this currently

makluganteng avatar Feb 16 '24 05:02 makluganteng

Are you running rust backend in your system ? Would you paste the console outputs here if possible ?

rjnrohit avatar Feb 16 '24 05:02 rjnrohit

{"timestamp":"2024-02-16T05:41:04.167874Z","level":"TRACE","fields":{"message":"Conn::read_head"},"target":"hyper::proto::h1::conn"}
{"timestamp":"2024-02-16T05:41:04.168424Z","level":"TRACE","fields":{"message":"received 616 bytes"},"target":"hyper::proto::h1::io"}
{"timestamp":"2024-02-16T05:41:04.168778Z","level":"TRACE","fields":{"message":"Request.parse","bytes":616},"target":"hyper::proto::h1::role","span":{"name":"parse_headers"},"spans":[{"name":"parse_headers"}]}
{"timestamp":"2024-02-16T05:41:04.169205Z","level":"TRACE","fields":{"message":"Request.parse Complete(616)"},"target":"hyper::proto::h1::role","span":{"name":"parse_headers"},"spans":[{"name":"parse_headers"}]}
{"timestamp":"2024-02-16T05:41:04.169582Z","level":"DEBUG","fields":{"message":"parsed 13 headers"},"target":"hyper::proto::h1::io"}
{"timestamp":"2024-02-16T05:41:04.169680Z","level":"DEBUG","fields":{"message":"incoming body is empty"},"target":"hyper::proto::h1::conn"}
{"timestamp":"2024-02-16T05:41:04.169832Z","level":"TRACE","fields":{"message":"flushed({role=server}): State { reading: KeepAlive, writing: Init, keep_alive: Busy }"},"target":"hyper::proto::h1::conn"}
OPTIONS /save_code/1c6d0edb1d302863392ed05bca8b79aa44f6d5b5f34bbc63e0459b8a8f0621b6/hello_world/src/balance.cairo:
   >> No matching routes for OPTIONS /save_code/1c6d0edb1d302863392ed05bca8b79aa44f6d5b5f34bbc63e0459b8a8f0621b6/hello_world/src/balance.cairo.
   >> No 404 catcher registered. Using Rocket default.
   >> Response succeeded.
{"timestamp":"2024-02-16T05:41:04.171468Z","level":"TRACE","fields":{"message":"Server::encode status=204, body=Some(Unknown), req_method=Some(OPTIONS)"},"target":"hyper::proto::h1::role","span":{"name":"encode_headers"},"spans":[{"name":"encode_headers"}]}
{"timestamp":"2024-02-16T05:41:04.171766Z","level":"TRACE","fields":{"message":"server body forced to 0; method=Some(OPTIONS), status=204"},"target":"hyper::proto::h1::role","span":{"name":"encode_headers"},"spans":[{"name":"encode_headers"}]}
{"timestamp":"2024-02-16T05:41:04.171964Z","level":"TRACE","fields":{"message":"no more write body allowed, user body is_end_stream = false"},"target":"hyper::proto::h1::dispatch"}
{"timestamp":"2024-02-16T05:41:04.172216Z","level":"DEBUG","fields":{"message":"flushed 440 bytes"},"target":"hyper::proto::h1::io"}
{"timestamp":"2024-02-16T05:41:04.172339Z","level":"TRACE","fields":{"message":"flushed({role=server}): State { reading: Init, writing: Init, keep_alive: Idle }"},"target":"hyper::proto::h1::conn"}

makluganteng avatar Feb 16 '24 05:02 makluganteng

Also, could I get to see the console output from the browser ?

rjnrohit avatar Feb 16 '24 05:02 rjnrohit

Access to fetch at 'http://localhost:8000/save_code/1c6d0edb1d302863392ed05bca8b79aa44f6d5b5f34bbc63e0459b8a8f0621b6/hello_world/src/balance.cairo' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: The 'Access-Control-Allow-Origin' header has a value 'https://cairo-remix-dev.nethermind.io' that is not equal to the supplied origin. Have the server send the header with a valid value, or, if an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

makluganteng avatar Feb 16 '24 05:02 makluganteng

aaa cors problem somehow

makluganteng avatar Feb 16 '24 05:02 makluganteng

i dont think i have any extension blocking it

makluganteng avatar Feb 16 '24 05:02 makluganteng

cd api;
export VITE_URL=http://localhost:3000
cargo run;

Did you run this? How did you fire up the rust backend ?

rjnrohit avatar Feb 16 '24 05:02 rjnrohit

Aaa im missing the vite part , now its compiling

makluganteng avatar Feb 16 '24 05:02 makluganteng

All working now thank you

makluganteng avatar Feb 16 '24 05:02 makluganteng

Welcome :)

rjnrohit avatar Feb 16 '24 05:02 rjnrohit

One question as well , any recommendation on which file to look at for this ??

makluganteng avatar Feb 16 '24 05:02 makluganteng

You can start researching how to make starknet.js available in cell, right now we know: https://remix-ide.readthedocs.io/en/latest/terminal.html

rjnrohit avatar Feb 16 '24 06:02 rjnrohit

@makluganteng were you able to get started with this?

jelilat avatar Feb 27 '24 14:02 jelilat

Hey , im currently still doing the other one so i might back out on this

makluganteng avatar Feb 28 '24 08:02 makluganteng