-
Notifications
You must be signed in to change notification settings - Fork 47
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
[Feature Request] Add command to mine a block #183
Comments
You have full access to the You can generate a new block using |
That definitely helps! Though I'd still love the noob-friendly convenience of a I'm hoping that nigiri + Sparrow (or other bitcoin software of choice) can be an easy way to encourage less technical people to feel free to experiment via regtest (e.g. build your own multisig, receive a deposit, spent it back out). Nigiri is already so temptingly close to "max easy mode" and, at least in my brief usage thus far, a trivial If nothing else, if it was its own command it would be listed in |
Hey @kdmukai thanks for opening this issue. Do you know every transaction broadcasted through the POST /tx endpoint on the Esplora service or This is in my experience 99% of the time you want to mine a block after you broadcast one tx, and usually client software uses Esplora rather to interact with a plain Bitcoin Core node. That being said I am happy to add a manual command |
@kdmukai Do you know what Sparrow uses to broadcast tx? Does it require a Bitcoin JSONRPC to be available or uses a public Electrum Server? I wish to support all wallet software in a way the dev/user never has to manually mine blocks, but they should automatically mined for you, when we detect a tx is in the mempool |
@tiero Sparrow gives you the option to connect directly to bitcoind rpc or an electrum server. Testing my Sparrow -> nigiri connection shows: Broadcasting a tx with Sparrow in regtest to nigiri in regtest shows the tx as pending in Sparrow but no confirmations. The electrs logs show:
And I think this is unrelated, but also saw this about the same tx:
|
ah-ha I see, they use Electrum protocol over TCP, not Esplora REST. I think we could extend nigiri-chopsticks HTTP passthrough to also monitor the Electrum port and mine the block when What do you think? @altafan |
not sure if we will find a message containing We could fetch the logs by setting up a prometheus instance maybe, but the easiest way to me is making use of
This is even more tricky since chopsticks wraps the Esplora POST /tx that leverages @tiero I think for now it makes sense to add a |
Electrs exposes Electrum JSONRPC server over raw TCP, not JSONRPC over HTTP. I concur that the best thing would be to listen on an additional port for TCP on chopsticks:
ln, err := net.Listen("tcp", ":1234") // Replace 1234 with your port
if err != nil {
// handle error
}
for {
conn, err := ln.Accept()
if err != nil {
// handle error
continue
}
go handleConnection(conn)
}
func handleConnection(conn net.Conn) {
// Read data from conn
// ...
defer conn.Close()
}
|
I'm using nigiri in regtest alongside Sparrow. When I broadcast a tx via Sparrow, I want to be able to issue a nigiri command to mine a block to get a confirmation.
Yes, I could "faucet" or rpc "generatetoaddress" to move it forward, but in either case I have to grab a new address when all I care about is getting a quick confirmation.
Something like:
nigiri mine
would be straightforward, which already aligns with theMine
method in Chopsticks.The text was updated successfully, but these errors were encountered: