2022 Dec 19
Learned about rpcauth and .cookie from this and this. I can understand the difference between the deprecated
rpcuser
andrpcauth
fields in thebitcoin.conf
compared to the newrpcauth
: The previous version was storing the plaintext credentials in the config file whereas the new field stores a salted version of the password. This is more secure because it doesn’t explicitly reveal the password if somehow the contents of the config file were leaked (but the attacker doesn’t have access to the local filesystem otherwise..?). My understanding of.cookie
is that it’s a default rpcauth for whoever has access to the local filesystem already. So Bitcoin Core requires some sort of rpcauth at all times, and the cookie is a convenient way to grant/use it for the user who controls the node. Also contents of.cookie
file are<rpc-username>:<rpc-password>
Opened my first PR on the ldk-sample-node repo! Will probably ask for feedback in the discord tomorrow! Ran into a couple interesting bits: 1. for doing multiple matches in an
if let
instance you must put your values in a tuple, 2. setting a variable equal to the result of anif
ormatch
statement is not as versatile as I once thought, but for good reason, mainly you can only use the non-return notation for returning values so you can’t return early unless you want to return from the entire function. Interesting to compare this to closures as parameters.Refreshed my self on testing in Rust. Testing private functions is always done in the same module. If you want to run some setup before tests, you can only do that in integration tests, which are found in the folder
/tests/
.Learned if you
git commit --amend
after pushing to a remote repository, you don’t have to clutter up your commit logs by pulling. Instead just force push:git push --force
.Learned more about nostr! Tried setting up my own nostr-rs-relay, but it was too late at night so I stopped part way. Listened to this conversation and felt their excitement. Great way to describe protocols is connecting to the idea of email. Also in describing nostr specifically: anyone can run a relay, you don’t have to run a relay to use it, we get all these decentralization properties by just connecting to relay pools and sharing relays.