···11+# Account Setup
22+33+Once you've followed the setup instructions in the main README, your PDS should be accessible on the internet. Loading the index page should show some ASCII art and a "Hello" message.
44+55+The next step is to create a user account.
66+77+These instructions assume you are already familiar with atproto's DID mechanisms. TODO: don't assume that!
88+99+Millipds does not hold did:plc rotation keys, and therefore it cannot make DID document updates on your behalf. This is good for security, and means that you can store your rotation keys offline.
1010+1111+It *does* however need to hold a repo signing key.
1212+1313+Below, I assume you have two separate machines, the "server" (where the millipds server runs) and the "local machine". If you don't care about security (keeping rotation keys off the server) you can ignore that distinction and run everything on the server.
1414+1515+## New Account (with did:plc)
1616+1717+These instructions assume you're creating a user with handle `bob.example.com`, on a PDS at `https://pds.example.com` - replace them as appropriate!
1818+1919+On the **local machine**:
2020+```sh
2121+git clone https://github.com/DavidBuchanan314/millipds
2222+cd millipds
2323+python3 -m pip install . # install the millipds command (use a venv if you want, I guess)
2424+./test_data/create_identity.sh bob.example.com https://pds.example.com https://plc.directory
2525+```
2626+2727+Successful output should look something like this:
2828+```
2929+Generating keys...
3030+Submitting genesis op to PLC...
3131+OK
3232+3333+Created identity for bob.example.com at https://plc.directory/did:plc:shnwoo25lrvyq3gijyjdmmal
3434+3535+rotation key has been saved to bob.example.com_rotation_key.pem
3636+repo signing key has been saved to bob.example.com_repo_key.pem
3737+did:plc string has been logged to bob.example.com_did.txt
3838+3939+Please store the rotation key somewhere especially safe!
4040+```
4141+4242+Store `*_rotation_key.pem` very securely, this is the key to your whole atproto identity (feel free to give it a more descriptive file name).
4343+4444+You'll need to copy `*_repo_key.pem` onto the server, however. (This key should also be kept secret, but if it's ever compromised or lost, you can replace it using the rotation key)
4545+4646+Now, on the **server**:
4747+```sh
4848+sudo -u millipds -s
4949+source ~/.venv/bin/activate
5050+millipds account create did:plc:shnwoo25lrvyq3gijyjdmmal bob.example.com --signing_key=bob.example.com_repo_key.pem
5151+```
5252+5353+Edit the DID per the one you just generated above, and the handle and signing key path likewise.
5454+5555+You'll be prompted to enter a new password for the account, interactively. On success it should look something like this:
5656+5757+```
5858+Password for new account:
5959+Confirm password:
6060+INFO:millipds.database:creating account for did=did:plc:shnwoo25lrvyq3gijyjdmmal, handle=bob.example.com
6161+```
6262+6363+You also need to make sure the handle resolves. In this example, you'd create a TXT DNS record at `_atproto.bob.example` with value `did=did:plc:shnwoo25lrvyq3gijyjdmmal` (or use the .well-known method, see atproto docs. TODO: link)
6464+6565+At this point, the account is created, and you should be able to log in through a client like `bsky.app`.
6666+6767+You'll probably run into some error messages because the relay doesn't know about your PDS yet. This can be solved like so:
6868+6969+```sh
7070+curl --json '{"hostname": "https://pds.example.com"}' "https://bsky.network/xrpc/com.atproto.sync.requestCrawl"
7171+```
7272+7373+Finally, we need to emit an `#identity` event (probably an `#account` event too but millipds doesn't do that yet!!!). This can be done by heading to your settings in `bsky.app` and "changing" your handle to the value it already is (e.g. `bob.example.com`) - this tells millipds to emit an `#identity` event. (I'll make this part more automatic in the future)
7474+7575+Now, post something. If you're lucky, the relay and appview will pick it up, and now other people can see it. If not... have fun debugging...
7676+7777+## New Account (with did:web)
7878+7979+TODO (but it's conceptually not that different to did:plc, I bet you can figure it out!)
8080+8181+## Inbound Migration
8282+8383+TODO (millipds doesn't even support this yet, but one day it will)
+10-4
test_data/create_identity.sh
···1515ROTATION_KEY_PATH="${HANDLE}_rotation_key.pem"
1616REPO_KEY_PATH="${HANDLE}_repo_key.pem"
1717GENESIS_JSON_PATH="${HANDLE}_plc_genesis.json"
1818+DID_LOG_PATH="${HANDLE}_did.txt"
18191920echo "Generating keys..."
2021···3031 --repo_pubkey=$(millipds util print_pubkey $REPO_KEY_PATH)
3132)
32333333-echo $DID_PLC > "${HANDLE}_did.txt"
3434+echo $DID_PLC > $DID_LOG_PATH
34353536echo "Submitting genesis op to PLC..."
3637···38393940curl --json @$GENESIS_JSON_PATH $PLC_URL
4041echo
4141-4242-echo "Created identity for ${HANDLE} at ${DID_PLC}"
4343-echo $PLC_URL
4242+echo
4343+echo "Created identity for ${HANDLE} at ${PLC_URL}"
4444+echo
4545+echo "rotation key has been saved to ${ROTATION_KEY_PATH}"
4646+echo "repo signing key has been saved to ${REPO_KEY_PATH}"
4747+echo "did:plc string has been logged to ${DID_LOG_PATH}"
4848+echo
4949+echo "Please store the rotation key somewhere especially safe!"