Skip to content

Instantly share code, notes, and snippets.

@oconnor663
Created March 4, 2015 15:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oconnor663/eb90a4100385d6f29ddb to your computer and use it in GitHub Desktop.
Save oconnor663/eb90a4100385d6f29ddb to your computer and use it in GitHub Desktop.
Exercise the daemon RPC
rpc = require 'framed-msgpack-rpc'
assert = require 'assert'
x = rpc.createTransport { path: '/run/user/1000/keybased.sock' }
await x.connect defer err
if err
console.log "error connecting"
else
c = new rpc.Client x, "keybase.1"
await c.invoke 'config.getCurrentStatus', [{}], defer err, response
if err? then console.log "error in RPC: #{err.toString()}"
else console.log response
x.close()
process.exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment