e6433fb2c1feat(persist): Add stage_and_commit to Persist (LLFourn)0bee46e75bfix(store): Remove lifetime (LLFourn) Pull request description: Remove gratuitous use of lifetimes in the main persistence struct `Store`. Having lifetimes on this means that you have to keep the magic bytes alive longer than the database which is particularly offensive if you have to send the database to another thread. On top of that the bytes aren't even read. ACKs for top commit: evanlinjin: ACKe6433fb2c1Tree-SHA512: 7f6d9d60951a8ceaee30719d0771e15632c6fad0702294af15409c5df492669a07299874ef5ee34e3d75bdecbbd41df29bced3ff16b2360d5d5c7687ef677ffc
Example RPC CLI
Simple Regtest Test
- Start local regtest bitcoind.
mkdir -p /tmp/regtest/bitcoind bitcoind -regtest -server -fallbackfee=0.0002 -rpcuser=<your-rpc-username> -rpcpassword=<your-rpc-password> -datadir=/tmp/regtest/bitcoind -daemon - Create a test bitcoind wallet and set bitcoind env.
bitcoin-cli -datadir=/tmp/regtest/bitcoind -regtest -rpcuser=<your-rpc-username> -rpcpassword=<your-rpc-password> -named createwallet wallet_name="test" export RPC_URL=127.0.0.1:18443 export RPC_USER=<your-rpc-username> export RPC_PASS=<your-rpc-password> - Get test bitcoind wallet info.
bitcoin-cli -rpcwallet="test" -rpcuser=<your-rpc-username> -rpcpassword=<your-rpc-password> -datadir=/tmp/regtest/bitcoind -regtest getwalletinfo - Get new test bitcoind wallet address.
BITCOIND_ADDRESS=$(bitcoin-cli -rpcwallet="test" -datadir=/tmp/regtest/bitcoind -regtest -rpcuser=<your-rpc-username> -rpcpassword=<your-rpc-password> getnewaddress) echo $BITCOIND_ADDRESS - Generate 101 blocks with reward to test bitcoind wallet address.
bitcoin-cli -datadir=/tmp/regtest/bitcoind -regtest -rpcuser=<your-rpc-username> -rpcpassword=<your-rpc-password> generatetoaddress 101 $BITCOIND_ADDRESS - Verify test bitcoind wallet balance.
bitcoin-cli -rpcwallet="test" -datadir=/tmp/regtest/bitcoind -regtest -rpcuser=<your-rpc-username> -rpcpassword=<your-rpc-password> getbalances - Set descriptor env and get address from RPC CLI wallet.
export DESCRIPTOR="wpkh(tprv8ZgxMBicQKsPfK9BTf82oQkHhawtZv19CorqQKPFeaHDMA4dXYX6eWsJGNJ7VTQXWmoHdrfjCYuDijcRmNFwSKcVhswzqs4fugE8turndGc/1/*)" cargo run -- --network regtest address next - Send 5 test bitcoin to RPC CLI wallet.
bitcoin-cli -rpcwallet="test" -datadir=/tmp/regtest/bitcoind -regtest -rpcuser=<your-rpc-username> -rpcpassword=<your-rpc-password> sendtoaddress <address> 5 - Sync blockchain with RPC CLI wallet.
cargo run -- --network regtest sync <CNTRL-C to stop syncing> - Get RPC CLI wallet unconfirmed balances.
cargo run -- --network regtest balance
- Generate 1 block with reward to test bitcoind wallet address.
bitcoin-cli -datadir=/tmp/regtest/bitcoind -rpcuser=<your-rpc-username> -rpcpassword=<your-rpc-password> -regtest generatetoaddress 10 $BITCOIND_ADDRESS
- Sync the blockchain with RPC CLI wallet.
cargo run -- --network regtest sync
<CNTRL-C to stop syncing>
- Get RPC CLI wallet confirmed balances.
cargo run -- --network regtest balance
- Get RPC CLI wallet transactions.
cargo run -- --network regtest txout list