up readme

syui 2 months ago
parent b892dcaa02
commit 7829c67c2a
Signed by: syui
GPG Key ID: 67AC97A939D3EA19

@ -48,3 +48,55 @@ $ fly pg attach -a $app ${app}-db
$ fly deploy
```
### SERVER_DID
ref : https://github.com/KingYoSun/atproto-aws/tree/main
> pacakges/dev-env/src/index.ts
```js
import * as cbor from '@ipld/dag-cbor'
import * as uint8arrays from 'uint8arrays'
console.log(`signingKey=${keypair.did()}`)
console.log(`recoveryKey=${keypair.did()}`)
const obj = {
type: 'create',
signingKey: keypair.did(),
recoveryKey: keypair.did(),
handle: '${ADMIN_USER_NAME}.${DOMAIN}',
service: 'https://${DOMAIN}',
prev: null,
}
const data = new Uint8Array(cbor.encode(obj))
console.log(
`sig=${uint8arrays.toString(await keypair.sign(data), 'base64url')}`,
)
```
```sh
make build
make run-dev-env
handle=admin.example.com
service=https://example.com
url=https://plc.directory/did:plc:q4ugjxbx2mp6rmnnljjystesttesttest
json="{
\"type\": \"create\",
\"signingKey\": \"${signingKey}\",
\"recoveryKey\": \"${recoveryKey}\",
\"handle\": \"${handle}\",
\"service\": \"${service}\",
\"prev\": null,
\"sig\": \"${sig}\"
}"
curl -X POST -H "Content-Type: application/json" -d "$json" $url
Hash of genesis operation does not match DID identifier: xxx
url=did:plc:xxx
curl -X POST -H "Content-Type: application/json" -d "$json" $url
Ok
```

Loading…
Cancel
Save