-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: compile, deploy and interact contracts on starknet-devnet-rs
using starkli
#23
Conversation
691add1
to
f8f79f8
Compare
f8f79f8
to
ad0745f
Compare
5c4d207
to
57741fd
Compare
57741fd
to
1666125
Compare
starknet-devnet-rs
starknet-devnet-rs
using starkli
Thanks for the detailed documentation! Actually, we can also put the documentation on Notion, if it makes it easier to write and keep updated. Sorry for not being clear earlier. For proper documentation, we can do it a bit later once the projects are properly setup. We will also try to automate the steps in the future using Nix and Rust, so that there are less manual steps to take. |
Ah. I still like to keep this at |
The other $ docker network create starknet-network
$ docker run --rm --network starknet-network --name starknet.devnet shardlabs/starknet-devnet-rs --seed=0 --accounts=3 --state-archive-capacity=full
$ docker run --rm --network starknet-network denoland/deno eval -q '
import { RpcProvider } from "npm:starknet";
console.log(await new RpcProvider({ nodeUrl: "http://starknet.devnet:5050" }).getBlockNumber());
'
0 This may be useful if we are writing CI automation scripts. |
I think we don't need to worry about automation and formatting for now. The use of starkli is a starting point. Since it is written in Rust and is using starknet-rs, it will be quite easy to use the library underneath to directly implement the automation and integration tests in Hermes SDK. The current documentation is more for our own reference, so that we can get things working manually while the automation is implemented.
No problem to keep it on GitHub only, fee free to use the best approach you see fit. |
docs/README.md
Outdated
starkli call <CONTRACT_ADDRESS> get # prints 0x811 | ||
``` | ||
|
||
### Passing complex-typed inputs to the contract |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So it looks like we cannot really rely on starkli to interact with more complex contracts. I will work on the Hermes client so that we can use that instead to interact with the contracts we written.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, looks like that. I added more instructions to transfer funds for ERC20 contracts. They work - but requires value serialization.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The type information is stored in the compiled .contract_class.json
and it can be fetched from a starknet
node.
The way I see, starkli
should do something like grpcurl
to (de)serialize the input and output values dynamically. grpcurl
uses reflection to parse/format from/to JSON string to/from proto encoding.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a tool exactly for this --- cainome
It's like protoc
with tonic
.
$ cargo install --features=build-binary --git https://github.com/cartridge-gg/cainome
$ mkdir codegen
$ cainome --output-dir gen --contract-name erc20 --execution-version v3 --contract-address 0x49D36570D4E46F48E99674BD3
FCC84644DDD6B96F7C741B1562B82F9E004DC7 --rpc-url http://127.0.0.1:5050 --rust
a1bdea9
to
12872a2
Compare
12872a2
to
c87514e
Compare
1f4c76a
to
3f89a6a
Compare
I think that the document is a good position now. We can merge it. Let me know if it is better to break the README into multiple markdowns. |
Awesome, looks great! Let's merge it and move on to other work. Remember that this is mainly internal documentation for us to get started with the development more quickly. So we don't need to be too comprehensive. |
Closes #1
Closes #4
Rendered