Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/abdelstark/majin-blob
Utility features to play with EIP-4844 blobs for Starknet usage.
https://github.com/abdelstark/majin-blob
blob eip-4844 ethereum protodanksharding starknet
Last synced: 2 days ago
JSON representation
Utility features to play with EIP-4844 blobs for Starknet usage.
- Host: GitHub
- URL: https://github.com/abdelstark/majin-blob
- Owner: AbdelStark
- License: mit
- Created: 2024-01-30T11:47:49.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-05-26T10:44:03.000Z (6 months ago)
- Last Synced: 2024-10-24T16:31:22.359Z (24 days ago)
- Topics: blob, eip-4844, ethereum, protodanksharding, starknet
- Language: Rust
- Homepage: https://abdelstark.github.io/majin-blob/
- Size: 4.05 MB
- Stars: 14
- Watchers: 1
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Overview
Utility features to play with EIP-4844 blobs for Starknet usage.
## Usage
### As a CLI
You can use the CLI to recover the original data from a blob file and parse it into state diffs.
#### Install the CLI
```sh
cargo install majin-blob
```#### Use the CLI
```sh
# Recover the original data from a blob file
majin-blob recover ./examples/blob/sn_blob_goerli.txt
```#### Help
```sh
majin-blob --help
```### As a library
Add the following to your `Cargo.toml`:
```toml
[dependencies]
majin-blob-core = "0.1.0"
majin-blob-types = "0.1.0"
```Then you can use the library as follows:
```rust
use majin_blob_core::blob;
use majin_blob_types::serde;fn main() {
// Read the blob data from a file
let blob_data = serde::parse_file_to_blob_data("./examples/blob/sn_blob_goerli.txt");// Recover the original data
let original_data = blob::recover(blob_data);// Parse the original data into state diffs
let state_diffs = serde::parse_state_diffs(original_data.as_slice());// Serialize the state diffs into JSON
let state_diffs_json = serde::to_json(state_diffs.as_slice());println!("{}", state_diffs_json);
}
```### Use the REST API
You can use the REST API to recover the original data from a blob file and parse it into state diffs.
#### Start the REST API
```sh
cargo run --release -p majin-blob-rest-api
```#### Recover the original data from a blob file
```sh
curl -X POST --data-binary "@./examples/blob/sn_blob_goerli.txt" http://127.0.0.1:3030/blob
```## License
This project is licensed under the [MIT license](LICENSE).
## Contributors ✨
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
Abdel @ StarkWare
💻
apoorvsadana
💻
MSG
💻
Mohit Dhattarwal
💻
Prashansa Tanwar
💻
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!