This guide focuses on the current CLI and daemon workflow.
Requirements:
- Go
- GCC or another C compiler for
go-sqlite3
Build:
git clone https://github.com/amaydixit11/acorde.git
cd acorde
go build -o acorde ./cmd/acordeIf --data is omitted, Acorde uses:
~/.acorde
Useful files inside a data dir:
acorde.db- SQLite data storenode_id- local peer IDnode_key- libp2p identity keypeer_addrs.json- daemon's persisted live addressespeers.json- allowlisted peers
./acorde daemon --data /tmp/acorde-a --port 4001 --api-port 7331This starts:
- the local engine
- the p2p sync service
- the REST API on
localhost:7331
./acorde add --data /tmp/acorde-a --type note --content "hello"
./acorde list --data /tmp/acorde-a
./acorde get --data /tmp/acorde-a <entry-id>
./acorde update --data /tmp/acorde-a <entry-id> --content "updated hello"
./acorde delete --data /tmp/acorde-a <entry-id>
curl -s http://localhost:7331/entriesTerminal 1:
./acorde daemon --data /tmp/acorde-a --port 4001 --api-port 7331Terminal 2:
./acorde daemon --data /tmp/acorde-b --port 4002 --api-port 7332Terminal 3:
./acorde add --data /tmp/acorde-a --type note --content "hello from A"
sqlite3 /tmp/acorde-b/acorde.db 'select id,type,updated_at,deleted from entries order by id;'Authorize B to write:
cat /tmp/acorde-b/node_id
./acorde authorize --data /tmp/acorde-a <entry-id> <peer-id-from-b>Update from B:
./acorde update --data /tmp/acorde-b <entry-id> --content "updated from B"If you want to verify the remote tombstone after deletion:
./acorde delete --data /tmp/acorde-b <entry-id>
sqlite3 /tmp/acorde-a/acorde.db "select id,deleted from entries where id='<entry-id>';"Device A:
./acorde daemon --data /tmp/acorde-pair-a --port 4021 --api-port 7351 --mdns=false
./acorde invite --data /tmp/acorde-pair-aDevice B:
./acorde pair --data /tmp/acorde-pair-b 'acorde://...'
./acorde daemon --data /tmp/acorde-pair-b --port 4022 --api-port 7352 --mdns=falseNotes:
pairstores the peer in the allowlist.- After pairing, start the daemon if it is not already running.
inviteuses the daemon's live addresses when available.
Initialize:
./acorde init --data /tmp/acorde-enc-aThen use the normal commands:
./acorde add --data /tmp/acorde-enc-a --type note --content "secret"
./acorde list --data /tmp/acorde-enc-a
./acorde get --data /tmp/acorde-enc-a <entry-id>- Private synced entries may exist in SQLite on another peer without appearing in
listor/entriesuntil that peer has read access. - Writers can read the entries they are allowed to write.
- CLI writes made against the same vault while a daemon is already running are picked up and synced by that daemon.