You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> **Starkbiter** is a framework for orchestrating event based agentic simulations on top of Starknet Devnet sandbox.
17
19
18
20
Starkbiter provides a Full JSON-RPC Starknet Node capabilities with additional methods to control block production, contract and account deployments and declaration. It integrates deeply with starknet-devnet and starknet-rs types crates allowing for seamless integration for all the tooling that depends on those. Thus, it also provides additional layer of well known contract bindings generated by [cainome](https://github.com/cartridge-gg/cainome).
@@ -22,6 +24,7 @@ The primary use of Starkbiter is to probe the mechanism security of smart contra
22
24
---
23
25
24
26
The Starkbiter workspace has five crates:
27
+
25
28
-`starkbiter`: The bin that exposes a command line interface for contract bindings.
26
29
-`starkbiter-core`: A lib containing the core logic for the Starkbiter framework, including the `StarkbiterMiddleware` discussed before, and the `Environment`, our sandbox.
27
30
-`starkbiter-engine`: A lib that provides abstractions for building simulations, agents, and behaviors.
@@ -34,9 +37,9 @@ The Starkbiter workspace has five crates:
34
37
-[x] core docs
35
38
-[x] main readme
36
39
-[ ] docs docs
37
-
-[x] getting started
38
-
-[ ] usage
39
-
-[x] index
40
+
-[x] getting started
41
+
-[ ] usage
42
+
-[x] index
40
43
-[ ] benchmarks
41
44
-[x] python bindings
42
45
-[x] more test cases
@@ -57,11 +60,12 @@ The Starkbiter workspace has five crates:
57
60
-[ ] Add API to preload state and save it to file. (like EKUBO core contract storage)
58
61
-[ ] Test approach to set local nonce before adding transaction to bypass validation (less remote calls)
59
62
60
-
61
63
## Book
64
+
62
65
TODO: Does not exist yet
63
66
64
67
## Motivation
68
+
65
69
Starkbiter was adapted from [Arbiter](https://github.com/harnesslabs/arbiter) code to allow you to work with smart contracts in a stateful sandbox and thus design agents that can be used alongside the contracts.
66
70
This gives you many capabilities.
67
71
For instance, smart contract engineers must test their contracts against various potentially adversarial environments and parameters instead of relying on static and stateless testing.
@@ -71,41 +75,55 @@ A financial engineer may want to test their strategies against thousands of mark
71
75
Likewise, the same engineer may want to develop searcher agents, solver agents, or other autonomous agents that can be run on the blockchain.
72
76
73
77
## Working with the Starkbiter Framework
78
+
74
79
To work with Starkbiter, you must have Rust installed on your machine.
75
80
You can install Rust by following the instructions [here](https://www.rust-lang.org/tools/install).
76
81
It will also be helpful to get the `cargo-generate` package, which you can install by doing:
82
+
77
83
```bash
84
+
78
85
cargo install cargo-generate
86
+
79
87
```
80
88
81
89
### Examples
90
+
82
91
We have an example that will run what we have set up in a template.
83
92
To run this, you can clone the repository and update the submodules:
From here, you can now try running the following from the clone's root directory:
100
+
90
101
```bash
91
102
cargo run --example minter
92
103
```
104
+
93
105
This command will enter the template CLI and show you the commands and flags.
94
106
95
107
To run the `ModifiedCounter.sol` example and see some logging, try:
108
+
96
109
```bash
97
110
cargo run --example minter simulate ./examples/minter/config.toml -vvvv
98
111
```
112
+
99
113
This sets the log level to `trace` so you can see what's happening internally.
100
114
101
115
### Binary
116
+
102
117
To install the Starkbiter binary, run:
118
+
103
119
```bash
104
120
cargo install starkbiter
105
121
```
122
+
106
123
This will install the Starkbiter binary on your machine. You can then run `starkbiter --help` to see that Starkbiter was correctly installed and see the help menu.
107
124
108
125
### Bindings
126
+
109
127
You can put your compiled sierra 1.0 contract jsons in the `contracts/` directory of your templated project, you'll need to run:
110
128
111
129
```bash
@@ -116,6 +134,7 @@ to generate rust bindings and you are good to go. You can use those within your
116
134
Starkbiter uses `cainome` to generate rust bindings and in turn `cainome` relies on starknet-rs account abstraction implementation. You can easily generate an account using `create_single_owner_account` method of the environment (and middleware) and pass it to create an instance of the contract you you want to execute.
117
135
118
136
### Forking
137
+
119
138
To fork a state of an Starknet network, you need to specify fork parameters upon instantiating environment. Fork is being initialised lazily, this mechanics is inherited from starknet devnet implementation.
120
139
121
140
```rust
@@ -134,6 +153,7 @@ This will instantiate environment which will upon request fetch missing bits of
134
153
## Cargo Docs
135
154
136
155
To see the Cargo docs for the Starkbiter crates, please visit the following:
0 commit comments