Changes required for running on the CTV signet. - #3
Conversation
fiatjaf
commented
Apr 23, 2022
- remove useless SelectParams call since bitcoinlib doesn't know signet.
- remove generateblocks, replace it with a message telling the user to get signet coins.
- hardcode demo scenario to signet.
- output the "txid:output" as the original_coin instead of just the txid.
- update readme.
jamesob
left a comment
There was a problem hiding this comment.
Thanks for working on this. Before something like this is merged, we need to figure out how to preserve optional regtest use. I'll propose a patch set that does this (with you as co-author) unless you get around to it first.
|
|
||
| This repository demonstrates an implementation of simple, "single-hop" vaults | ||
| using the proposed `OP_CHECKTEMPLATEVERIFY` opcode. | ||
| using the proposed `OP_CHECKTEMPLATEVERIFY` opcode. |
There was a problem hiding this comment.
Would've preferred these doc/whitespace changes in a separate commit, but no big deal.
There was a problem hiding this comment.
Sorry, my editor did this and I know it sucks, but I thought it wasn't a very big deal.
I can rebase and remove these though.
| # https://github.com/JeremyRubin/bitcoin/tree/checktemplateverify-rebase-4-15-21 | ||
| $ bitcoind -regtest -txindex=1 & | ||
| # https://github.com/JeremyRubin/bitcoin/tree/checktemplateverify-signet-23.0-alpha | ||
| $ bitcoind -signet -signetchallenge=512102946e8ba8eca597194e7ed90377d9bbebc5d17a9609ab3e35e706612ee882759351ae -signetseednode=50.18.75.225 -txindex=1 & |
There was a problem hiding this comment.
General feedback on this PR: we need to both support signet and regtest, so it would be useful to segment the various parts of this change out and keep regtest-specific content intact.
| .get_private_key(1) | ||
| .point.p2wpkh_address(network=rpc.net_name) | ||
| ) | ||
| return rpc.generatetoaddress(n, addr) |
There was a problem hiding this comment.
In line with preserving regtest, let's keep this.
|
|
||
| @classmethod | ||
| def from_network(cls, network: str, seed: bytes, coin: Coin = None, **plan_kwargs): | ||
| SelectParams(network) |
There was a problem hiding this comment.
Note to self to verify that this doesn't actually do anything
| c = VaultScenario.from_network( | ||
| "regtest", seed=b"demo", coin=coin_in, block_delay=10 | ||
| ) | ||
| c = VaultScenario.from_network("signet", b"demo", coin=coin_in, block_delay=10) |
There was a problem hiding this comment.
Hardcoded network constants should be factored out into some kind of SelectParams-ish global behavior that still allows use of regtest.
There was a problem hiding this comment.
SelectParams wasn't being used for anything as far as I know, and you already had a global registry of ports for each network.
| def _broadcast_final(c: VaultScenario, tx: CTransaction, hot_or_cold: str): | ||
| print() | ||
| if hot_or_cold == 'cold': | ||
| if hot_or_cold == "cold": |
There was a problem hiding this comment.
Would be good to separate out formatting changes if possible.
|
|
||
|
|
||
| def no_output(*args, **kwargs): | ||
| print(*args, file=sys.stderr, **kwargs) |
There was a problem hiding this comment.
We need to revisit this since it definitely isn't well named as "no_output."
There was a problem hiding this comment.
That was the name it had, I was very confused by it 😛
- remove useless SelectParams call since bitcoinlib doesn't know signet. - remove generateblocks, replace it with a message telling the user to get signet coins. - hardcode demo scenario to signet. - output the "txid:output" as the original_coin instead of just the txid.
|
I've removed the whitespace and quote changes and reduced the README changes to a minimum and brought multi-network support back, although the demo still defaults to |