😅

Bluesky Sosial on Ubuntu22.04

2023/03/30に公開
6

Bluesky Sosial

Run ATProtocol server by The Bluesky Team on Ubuntu22.04 for Nodejs beginner like me.

atproto

git clone https://github.com/bluesky-social/atproto.git
cd atproto
make
    Helper Commands:
        help                 Print info about all commands
        build                Compile all modules
        test                 Run all tests
        run-dev-env          Run a "development environment" shell
        run-pds              Run PDS locally
        lint                 Run style checks and verify syntax
        fmt                  Run syntax re-formatting
        deps                 Installs dependent libs using 'yarn install'
        nvm-setup            Use NVM to install and activate node+yarn

Nodejs

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
source ~/.bashrc
nvm install 18
npm install --global yarn
echo 'export PATH="$NVM_DIR/versions/node/v18.15.0/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc

Postgresql

cat packages/pds/example.dev.env
    DB_POSTGRES_URL="postgres://bsky:yksb@localhost/pds_dev"
    DEBUG_MODE=1
    LOG_ENABLED="true"
    LOG_LEVEL=debug
    LOG_DESTINATION=1
    AVAILABLE_USER_DOMAINS=".test,.dev.bsky.dev"
sudo apt update && sudo apt upgrade -y
sudo apt install postgresql postgresql-contrib -y
sudo -i -u postgres createuser --interactive
    Enter name of role to add: bsky
    Shall the new role be a superuser? (y/n) y
sudo -i -u postgres psql -c "alter user bsky with password 'yksb';"
sudo -i -u postgres createdb pds_dev
  • delete
sudo -i -u postgres dropdb pds_dev

Run

make deps
make run-pds
    if [ ! -f "packages/pds/.dev.env" ]; then cp packages/pds/example.dev.env packages/pds/.dev.env; fi
    cd packages/pds; ENV=dev yarn run start | yarn exec pino-pretty
    yarn exec v1.22.19
    yarn run v1.22.19
    $ node dist/bin.js
    [08:17:17.995] INFO (app-view/8665): repo subscription disabled
    🌞 ATP Data server is running at http://localhost:2583

Caution: use another terminal when making run-dev-env.

make run-dev-env
    cd packages/dev-env; yarn run start
    yarn run v1.22.19
    $ node dist/cli.js

    ██████╗
    ██╔═══██╗
    ██║██╗██║
    ██║██║██║
    ╚█║████╔╝
    ╚╝╚═══╝  protocol

    [  v0.0.1  | created by Bluesky ]

    Initializing...
    [2582] 👤 DID Placeholder server started http://localhost:2582
    [2584] 🌞 Personal Data server started http://localhost:2584
    Test environment generated.
    Type .hel

App

Search "Bluesky Sosial" on App Store.

Install Open
1 2

Create a new Account

Caution: Hosting provider IP address is that of run-pds.

Hosting provider Email & Password user handle
3 4 5

Test

Home Post Profile
6 7 8
  • Watch log of running run-pds
[10:10:05.710] INFO (pds/9545): request completed
    req: {
      "id": 46,
      "method": "GET",
      "url": "/xrpc/com.atproto.repo.listRecords?collection=app..
 :
     }

Discussion

Dongri JinDongri Jin

記事ありがとうございます!
bsky.socialなど他のサーバーと連携するにはどうすればいいですか?

tactac

KingYoSunさんの記事にありますが、

現状単一のPDSサーバー(マストドンでいうインスタンス)を立てられるだけでサーバー同士が繋がりません。分散ならぬ分断型です

という訳で現状はXRPCで連携できません。そのうちできるようになると思います。

Dongri JinDongri Jin

そうですね、まだ仕様が固まってない状態ですね
ありがとうございます!