1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
typedef enum LogLevel LogLevel;
typedef struct ProviderHandle ProviderHandle;
void ;
/**
* Start message listening and stabilization.
*
* # Safety
*
* `provider_ptr` must be NULL or a live ProviderHandle returned by
* `rings_node_new_provider_with_callback`. NULL is logged and ignored. Using a
* handle after `rings_node_provider_destroy` is undefined behavior.
*/
void ;
/**
* Request internal rpc api.
*
* # Safety
*
* `provider_ptr` must be NULL or a live ProviderHandle returned by
* `rings_node_new_provider_with_callback`; `method` and `params` must be valid
* null-terminated UTF-8 strings. Returns NULL when request validation or
* execution fails. Every non-NULL returned string must be released exactly once
* with `rings_node_string_free`.
*/
char *;
/**
* Free a string returned by `rings_node_request`.
*
* Passing NULL is a no-op. Passing any pointer not returned by
* `rings_node_request`, or freeing the same pointer twice, is undefined
* behavior.
*/
void ;
/**
* Destroy a ProviderHandle returned by `rings_node_new_provider_with_callback`.
*
* Passing NULL is a no-op. The pointer is invalid after this call. Do not call
* concurrently with other functions that use the same handle.
*/
void ;
/**
* Craft a new Provider with signer, keeping its stores under `storage_path`.
*
* `storage_path` is a directory the provider owns: it opens the node's stores
* under it as the native daemon does (the DHT data store, the authoritative
* transaction replay store, the retained relay inbox, the onion entry guards
* and the measurement stores). Reusing the path across runs keeps the replay
* windows, held mail and entry guards; a fresh path is a fresh node state.
*
* The provider owns its stores exclusively while it lives: each store locks
* its directory at open (#1039), so a second provider, or a native daemon,
* given a store this provider holds fails to open it, and creation returns
* NULL, instead of interleaving writes with it. The lock is per store:
* providers with distinct roots never conflict.
*
* # Safety
*
* String pointers, `storage_path` included, must be valid null-terminated
* UTF-8 strings. The signer must write exactly 65 signature bytes into the
* provided output buffer. Returns NULL when provider creation fails, a store
* that cannot be opened included. The returned handle must be released exactly
* once with `rings_node_provider_destroy`.
*/
struct ProviderHandle *;