dojoengine / dojo

Dojo is a toolchain for building provable games and autonomous worlds with Cairo
https://dojoengine.org
Apache License 2.0
400 stars 159 forks source link

Expose devnet endpoints #1586

Open notV4l opened 6 months ago

notV4l commented 6 months ago

Is your feature request related to a problem? Please describe. To support argentX & braavos, katana should expose some http endpoints.

Describe the solution you'd like support /predeployed_accounts (GET) support /account_balance (GET) support /fee_token (GET) support /mint (POST)

Additional context Im not sure which of those methods are required/used. After testing some, /predeployed_accounts is called, but those accounts are not used Seems both argentX & braavos deploy there own accounts and fund it using /mint

the way tis handled in starknet-devnet-rs https://github.com/0xSpaceShard/starknet-devnet-rs/blob/e3c69015fa19f261487ea094caee2c72cdc3a64b/crates/starknet-devnet-server/src/server.rs#L44-L47

glihm commented 2 months ago

That may actually be a good first issue, as the necessary implementations and types are here, and this should be placed under the dev RPC namespace of Katana: https://github.com/dojoengine/dojo/blob/main/crates/katana/rpc/rpc-api/src/dev.rs.

PedroRosalba commented 2 months ago

@notV4l @glihm Can I work on this task?

fabrobles92 commented 1 month ago

Hello @glihm I would like to work on this issue :D

glihm commented 1 month ago

Sorry guys for the delay on this one. @PedroRosalba if you're still around, please let's know. If not, @fabrobles92 will be assigned to you. 👍

glihm commented 1 month ago

@fabrobles92, all yours!

fabrobles92 commented 1 month ago

@glihm I am looking into this now and want to make sure I understand correctly what is needed here.

I have to add the following methods to the trait DevApi here: predeployed_accounts account_balance fee_token mint

Note. I am seeing that under crates/katana/rpc/rpc-api/src/katana.rs we already have a trait method called predeployed_accounts

Note 2. You mention that the necessary implementations and types are already in the code, I am trying to find them without luck, would you point me where are those?

Or I need to create a new endpoint somewhere with those routes?

glihm commented 2 weeks ago

Sorry @fabrobles92 I just totally missed that. Could we catch up during the week?

That's perfect under Dev api. 👍 @kariy do you confirm or should we do an other namespace for those RPC calls?

glihm commented 11 hours ago

Any update on that @fabrobles92?