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

What is the recommended replacement of the j s option? #29055

Open
zengh-cropty opened this issue Feb 22, 2024 · 3 comments
Open

What is the recommended replacement of the j s option? #29055

zengh-cropty opened this issue Feb 22, 2024 · 3 comments
Assignees

Comments

@zengh-cropty
Copy link

We were using the js together with a --preload to run geth in a private network using docker.
The main use-case was to mine blocks only when a transaction exists
(Similar to this https://ethereum.stackexchange.com/questions/3151/how-to-make-miner-to-mine-only-when-there-are-pending-transactions and this https://github.com/niksmac/ethereum-scripts/blob/master/src/mining-only-new-txs.js)
But now that the js is deprecated how can we achieve the same?
The only option we found so far, was to run console and use --preload.
Unfortunately, this requires us to also allow tty+std_open in docker which we would like to avoid.
Is there any way to do this?

@fjl
Copy link
Contributor

fjl commented Feb 22, 2024

Sorry, but the console and --preload option is the only way to achieve this now.

@fjl fjl closed this as completed Feb 22, 2024
@holiman
Copy link
Contributor

holiman commented Feb 22, 2024

this requires us to also allow tty+std_open in docker which we would like to avoid.

Why does it require you to do that? That sounds like a bug to me. What happens if you don't ?

@holiman holiman reopened this Feb 22, 2024
@holiman holiman self-assigned this Feb 22, 2024
@s1na
Copy link
Contributor

s1na commented Feb 22, 2024

ACtually the flag we have for it is --exec console. It will execute the script and return without needing tty. However you have to write the script without callbacks. It --exec will not wait for callbacks to finish.

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

No branches or pull requests

4 participants