Hey folks, yesterday I got a testnet node up and running on a little digitalocean droplet. It was a reasonably painless experience and I’m excited to be taking part.
I kept a sort of stream of consciousness log of what I was doing as I set up the node. I’m posting it here in case it’s useful to anyone.
- First, read the docs
- “getting started”
- Okay there’s a download link for binaries
- A simple description of how to start the binary. Looks like it bootstraps a connection without much configuration, great.
- I’m going to need to wait for it to sync up, presumably there’s not a lot to sync right now but I wonder where it stores it’s state.
- Hmm, mining blocks is different to just running a node, which makes sense to me but I wonder how obvious that will be to people who haven’t run other blockchain clients before. Anyway, I’m going to want to do that so let’s take a look at the full node setup
- Oh the link is broken, off we go to report that
- “full node setup”
- Right yeah we’ll need to specify where the node stores it’s data
- I can set my own bootstrap nodes, not really interested in that right now
- Right, we need an account, presumably the keys for that are stored in the data dir?
- Right, I can specify a node key pair if I want. But do I want to? Probably, I’m planning on running this on a digital ocean droplet and I don’t want to worry about it disappearing with my keys. So I guess I’ll generate a keypair and store the private key elsewhere. Or can I just let it start up and then download the private key? I’ll try that first.
- What monitoring do I want? I’ll probably run this using systemd and just rely on the logs in the journal. Happy to send Polkadot telemetry.
- I’m not going to expose the RPC for now, I can always tunnel to it if I want access for my own uses.
- “getting started”
- Okay, let’s get started then, firs to spin up a Digital Ocean droplet. I’m just going to use a tiny $5 one for now, with a 50Gb block store, I’m guessing the chain is going to be pretty small for a while
- Right, droplet up, let’s grab the binaries.
- Downloaded from the github release, can’t see any kind of hash I can use to verify integrity of download
- Alright, running the binary with
--data-path
set to the block store I’ve attached to this droplet- There’s a bunch of output, some stuff about the versions of various components, the chain name, a line about initializing genesis state. Then this slightly confusing
Highest known block at #0
. What does that mean? The highest known block is0
? - Mining is disabled, which is fine, I’m just seeing how the thing runs right now.
- I have 7 peers apparently, very exciting.
- Output has changed from
syncing
toidle
after a few minutes, I’m guessing that means we’re synced up now? I’m not certain though, feels like the logs should say that if that’s the case?
- There’s a bunch of output, some stuff about the versions of various components, the chain name, a line about initializing genesis state. Then this slightly confusing
- Right, let’s try running a few queries against our node to see if it’s working
- Ha, listing organisations shows
monadic
, looks like things are working.
- Ha, listing organisations shows
- Okay, now I want to see if I can get this thing to mine
- Shutting down the node
- running
radicle-registry-cli account generate mining
- Hmm, some kind of error: “Failed to read accounts file: Permission denied”. What is an accounts file?
- Okay that was just an artifact of something about the way this droplet had been set up. For some reason
~/.local
was owned byroot
, fixing that solved the problem. I just figured that out by runningls
in the home directory and looking for things that didn’t belong to my user though, might be useful to log where the CLI is trying to create the accounts file. I couldn’t see anything about it in the help - Right, now to startup the node again but this time with
--mine <address>
- Okay now we have “Role: Full” which looks good
- I’m seeing logs saying stuff like “Prepared block for proposing” which also looks like a good sign
- Interestingly this time the “highest known block” log line says “
highest known block at #11211
”, I wonder if the#0
before was a bug? - I’m confused abut whether these
prepared block for proposing
log lines mean that my node has a block it’s proposing, or whether this is something that’s happening on the network. It happens immediately after a log line sayingimported ...
so I’m guessing the latter. Checking my own balance shows a balance of 0 still so that adds up. - I have no idea what the hashrate of the network is right now and I’m running on a tiny droplet so I guess it’s fairly unlikely I’ll mine anything any time soon.
- Ah I’ve just noticed that the docs say “If your node successfully mined a block and imported it will log Imported own block”, cool.
- Right, now I’m going to wrap this all up in a systemd unit file
- I’ve just copied the binaries into
/usr/local/bin
and made a simple unit file with the invocation I was using on the command line - Unit is running fine, logs are showing a
warn
though:sc_basic_authorship::basic_authorship Timeout fired waiting for transaction pool to be ready. Proceeding to block production anyway
. What does that mean? - Hmm, it might not be worth worrying about. It also fires when I run the binary in the shell, it’s just that in the shell the log levels aren’t visible so it didn’t worry me.
- I’ve just copied the binaries into
- Final thing then, I want to download my private key. From the previous error I’m guessing it’s in
.local
somewhere.- Right, in
~/.local/share/redicle-registry-cli/accounts.json
there’s a json file containing amining.seed
key, I’ll just save that somewhere safe.
- Right, in
- Oh look at that, I just checked my balance and I have 2000uRad funfunfun