Skip to content
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

Pass payloads from stdin #40

Open
edubart opened this issue Oct 18, 2024 · 3 comments
Open

Pass payloads from stdin #40

edubart opened this issue Oct 18, 2024 · 3 comments

Comments

@edubart
Copy link

edubart commented Oct 18, 2024

At the moment I create payload with:

cmioc encode input --binary \
    --chain-id 0 \
    --app-contract 0x0000000000000000000000000000000000000000 \
    --msg-sender 0x0000000000000000000000000000000000000001 \
    --block-number 0 \
    --block-timestamp 0 \
    --prev-randao 0 \
    --index 0 \
    --payload 0x$(echo -n "Hello advance 0!" | xxd -g0 -p) > input-0.bin

Would be nice if I could feed binary payload with --stdin-payload, so I could do something like:

echo -n "Hello advance 0!" | cmioc encode input --binary \
    --chain-id 0 \
    --app-contract 0x0000000000000000000000000000000000000000 \
    --msg-sender 0x0000000000000000000000000000000000000001 \
    --block-number 0 \
    --block-timestamp 0 \
    --prev-randao 0 \
    --index 0 \
    --stdin-payload > input-0.bin
@guidanoli
Copy link
Owner

Maybe you could even pipe encoded in binary already, because maybe not all payloads are ASCII, right?

echo -n "Hello advance 0!" | xxd -g0 -p | cmioc encode input --binary \
    --chain-id 0 \
    --app-contract 0x0000000000000000000000000000000000000000 \
    --msg-sender 0x0000000000000000000000000000000000000001 \
    --block-number 0 \
    --block-timestamp 0 \
    --prev-randao 0 \
    --index 0 \
    --stdin-payload > input-0.bin

For example:

cmioc encode input --binary \
    --chain-id 0 \
    --app-contract 0x0000000000000000000000000000000000000000 \
    --msg-sender 0x0000000000000000000000000000000000000001 \
    --block-number 0 \
    --block-timestamp 0 \
    --prev-randao 0 \
    --index 0 \
    --stdin-payload < my-binary-payload.bin > input-0.bin

@edubart
Copy link
Author

edubart commented Oct 18, 2024

Maybe you could even pipe encoded in binary already

Yeah, maybe two options --stdin-binary-payload and --stdin-hex-payload.

@guidanoli
Copy link
Owner

Nevermind, I got confused.
Let's stick with your original suggestion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants