Browse Source

lightningd/lightningd: add rpc interface.

daemon/lightning-cli works with this.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ppa-0.6.1
Rusty Russell 8 years ago
parent
commit
0444d68197
  1. 1
      lightningd/Makefile
  2. 24
      lightningd/lightningd.c

1
lightningd/Makefile

@ -11,6 +11,7 @@ default: lightningd-all
LIGHTNINGD_OLD_SRC := \ LIGHTNINGD_OLD_SRC := \
daemon/configdir.c \ daemon/configdir.c \
daemon/json.c \ daemon/json.c \
daemon/jsonrpc.c \
daemon/log.c \ daemon/log.c \
daemon/options.c \ daemon/options.c \
daemon/opt_time.c \ daemon/opt_time.c \

24
lightningd/lightningd.c

@ -36,25 +36,22 @@ struct peer *find_peer(struct lightningd_state *dstate, const struct pubkey *id)
FIXME_IMPLEMENT(); FIXME_IMPLEMENT();
} }
struct json_result *null_response(const tal_t *ctx) size_t get_tx_depth(struct lightningd_state *dstate,
{ const struct sha256_double *txid)
FIXME_IMPLEMENT();
}
void command_success(struct command *cmd, struct json_result *result)
{ {
FIXME_IMPLEMENT(); FIXME_IMPLEMENT();
} }
void command_fail(struct command *cmd, const char *fmt, ...) void debug_dump_peers(struct lightningd_state *dstate);
void debug_dump_peers(struct lightningd_state *dstate)
{ {
FIXME_IMPLEMENT(); FIXME_IMPLEMENT();
} }
size_t get_tx_depth(struct lightningd_state *dstate, u32 get_block_height(struct lightningd_state *dstate)
const struct sha256_double *txid)
{ {
FIXME_IMPLEMENT(); /* FIXME_IMPLEMENT(); */
return 0;
} }
#include <daemon/packets.h> #include <daemon/packets.h>
@ -169,17 +166,16 @@ int main(int argc, char *argv[])
/* Set up HSM. */ /* Set up HSM. */
hsm_init(ld, newdir); hsm_init(ld, newdir);
#if 0 /* Create RPC socket (if any) */
setup_jsonrpc(&ld->dstate, ld->dstate.rpc_filename);
#if 0
/* Initialize block topology. */ /* Initialize block topology. */
setup_topology(dstate); setup_topology(dstate);
/* Load peers from database. */ /* Load peers from database. */
db_load_peers(dstate); db_load_peers(dstate);
/* Create RPC socket (if any) */
setup_jsonrpc(dstate, dstate->rpc_filename);
/* Ready for connections from peers. */ /* Ready for connections from peers. */
setup_listeners(dstate); setup_listeners(dstate);
#endif #endif

Loading…
Cancel
Save