Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added gRPC admin method docs #1

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions pages/grpc/admin/create_admin.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# CreateAdmin

This method initializes a brand new Sensei node. It can only be called once during intial setup. It is used to set your node username, alias, passphrase, and initial configuration.

This method will also instantiate your seed phrase and `admin.macaroon` file. This means this endpoint is unauthenticated.

### Authentication

No authentication required.

### gRPC Request: CreateAdminRequest

<br/>

| Param | Type | Description |
| ----- | ---- | ----------- |
| username | String | Used for logging into the web administration panel |
| alias | String | The name of your node that will be broadcast to the lightning network |
| passphrase | String | Used to encrypt seed information on disk and as your password for logging into the web administration panel |
| start | Boolean | Whether or not to also unlock and start your node upon successful init |

### gRPC Response: CreateAdminResponse

<br />

| Param | Type | Description |
| ----- | ---- | ----------- |
| pubkey | String | Your node public key. This is often described as your node's id |
| macaroon | String | Hex encoded `admin.macaroon` file |
| external_id | String | An internal identifier for your node |
| role | String | Designates the type of node that was intialized |

29 changes: 29 additions & 0 deletions pages/grpc/admin/create_node.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# CreateNode

This method will create a new lightweight node as a child of the existing Sensei node. You must provide a username and passrphase that will be used to log into the node's administration panel.

The method will return the node's pubkey and macaroon. This information is required to interact with the node in the future.

### Authentication

You must authenticate using the admin node's macaroon.

### gRPC Request: CreateNodeRequest

<br/>

| Param | Type | Description |
| ----- | ---- | ----------- |
| username | String | Used for logging into the web administration panel |
| passphrase | String | Used to encrypt seed information on disk and as your password for logging into the web administration panel |
| alias | String | The name of your node that will be broadcast to the lightning network |
| start | Boolean | Whether or not to also unlock and start your node upon successful init |

### gRPC Response: CreateNodeResponse

<br />

| Param | Type | Description |
| ----- | ---- | ----------- |
| pubkey | String | The node's public key. This is often described as the node's id |
| macaroon | String | Hex encoded `admin.macaroon` |
19 changes: 19 additions & 0 deletions pages/grpc/admin/delete_node.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# DeleteNode

Delete a lightweight node.

### Authentication

You must authenticate using the admin node's macaroon.

### gRPC Request: DeleteNodeRequest

<br/>

| Param | Type | Description |
| ----- | ---- | ----------- |
| pubkey | String | The node's public key |

### gRPC Response: DeleteNodeResponse

There are no parameters in the response body.
Empty file removed pages/grpc/admin/get_config.mdx
Empty file.
Empty file removed pages/grpc/admin/init.mdx
Empty file.
43 changes: 43 additions & 0 deletions pages/grpc/admin/list_nodes.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# ListNodes

This method lists all of your node's child nodes.

### Authentication

You must authenticate using the admin node's macaroon.

### gRPC Request: ListNodesRequest

<br/>

| Param | Type | Description |
| ----- | ---- | ----------- |
| pagination | [PaginationRequest](../overview.mdx#pagination-request-parameters) | A pagination object |

### gRPC Response: ListNodesResponse

<br />

| Param | Type | Description |
| ----- | ---- | ----------- |
| nodes | ListNode[] | A list of node objects |
| pagination | [PaginationResponse](../overview.mdx#pagination-response-parameters) | The pagination response objec |

### ListNode Object

<br />

| Param | Type | Description |
| ----- | ---- | ----------- |
| id | Integer | Internal auto-incremented indentifier |
| external_id | String | An auto-generated identifier that is globally unique |
| role | Integer | What type of node this is. 0 = admin, 1 => child |
| username | String | The username used to log into this node |
| alias | String | The alias broadcast to the lightning network |
| network | String | The network this node is connected to (Regtest, Testnet, Mainnet, etc) |
| listen_addr | String | The hostname this node is listening on for p2p connections |
| listen_port | Integer | The port this node is listening on for p2p connections |
| pubkey | String | The node's public key or node identifier |
| created_at | String | A timestamp when this node was created |
| updated_at | String | A timestamp the last time any of these fields were updated |
| status | Integer | Whether the node is stopped or running |
Empty file removed pages/grpc/admin/login.mdx
Empty file.
Empty file removed pages/grpc/admin/logout.mdx
Empty file.
22 changes: 9 additions & 13 deletions pages/grpc/admin/meta.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
{
"init": "Init Sensei",
"list_nodes": "List Nodes",
"create_node": "Create Node",
"start_node": "Start Node",
"stop_node": "Stop Node",
"delete_node": "Delete Node",
"status": "Node Status",
"start": "Start Sensei",
"login": "Login",
"logout": "Logout",
"get_config": "Get Config",
"update_config": "Update Config"
}
"create_admin": "Create Admin",
"start_admin": "Start Admin",
"list_nodes": "List Lightweight Nodes",
"create_node": "Create Lightweight Node",
"delete_node": "Delete Lightweight Node",
"status": "Get Status",
"start_node": "Start Lightweight Node",
"stop_node": "Stop Lightweight Node"
}
Empty file removed pages/grpc/admin/start.mdx
Empty file.
24 changes: 24 additions & 0 deletions pages/grpc/admin/start_admin.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# StartAdmin

This method starts the Sensei node. On success, it will include the macaroon in the response body. This method can be used to start and login to your node using one request.

### Authentication

This request is unauthenticated but requires a valid passphrase.

### gRPC Request: StartAdminRequest

<br/>

| Param | Type | Description |
| ----- | ---- | ----------- |
| passphrase | String | Used to encrypt seed information on disk and as your password for logging into the web administration panel |

### gRPC Response: StartAdminResponse

<br />

| Param | Type | Description |
| ----- | ---- | ----------- |
| pubkey | String | Your node public key. This is often described as your node's id |
| macaroon | String | Hex encoded `admin.macaroon` |
25 changes: 25 additions & 0 deletions pages/grpc/admin/start_node.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# StartNode

Starts a stopped lightweight node.

### Authentication

You must authenticate using the admin node's macaroon.

### gRPC Request: AdminStartNodeRequest

<br/>

| Param | Type | Description |
| ----- | ---- | ----------- |
| pubkey | String | The node's public key |
| passphrase | String | The node's passphrase used for logging into the admin panel and decrypting the seed |

### gRPC Response: AdminStartNodeResponse

<br />

| Param | Type | Description |
| ----- | ---- | ----------- |
| macaroon | String | The macaroon used to authenticate requests to this node |

26 changes: 26 additions & 0 deletions pages/grpc/admin/status.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# GetStatus

Returns information about your node.

### Authentication

You must authenticate using the admin node's macaroon.

### gRPC Request: GetStatusRequest

There are no parameters in the request body.

### gRPC Response: GetStatusResponse

<br />

| Param | Type | Description |
| ----- | ---- | ----------- |
| alias | String (optional) | The alias used to name your node on the lightning network |
| created | Boolean | A flag for whether or not the admin node has been setup yet |
| running | Boolean | A flag for whether or not the admin node is running |
| authenticated | Boolean | A flag for whether or not this request was properly authenticated |
| pubkey | String (optional) | Your node public key. This is often described as your node's id |
| username | String (optional) | The username used to login to this node's admin panel |
| role | String (optional) | Designates the type of node that was intialized |

19 changes: 19 additions & 0 deletions pages/grpc/admin/stop_node.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# StopNode

Stops a running lightweight node.

### Authentication

You must authenticate using the admin node's macaroon.

### gRPC Request: AdminStopNodeRequest

<br/>

| Param | Type | Description |
| ----- | ---- | ----------- |
| pubkey | String | The node's public key |

### gRPC Response: AdminStopNodeResponse

There are no parameters in the response body.
Empty file removed pages/grpc/admin/update_config.mdx
Empty file.
20 changes: 20 additions & 0 deletions pages/grpc/overview.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
## Pagination

### Pagination Request Parameters

<br/>

| Param | Type | Description |
| ----- | ---- | ----------- |
| page | Integer | The page number to return |
| take | Integer | How many items to include per page |
| query | String | Optional parameter to search for nodes by username, alias, or pubkey |

### Pagination Response Parameters

<br/>

| Param | Type | Description |
| ----- | ---- | ----------- |
| has_more | Boolean | Whether or not there are any more pages after the one requested |
| total | Integer | The total number of items for the provided request parameters |
1 change: 0 additions & 1 deletion pages/http/admin/init.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ No authentication required.
| username | String | Used for logging into the web administration panel |
| passphrase | String | Used to encrypt seed information on disk and as your password for logging into the web administration panel |
| alias | String | The name of your node that will be broadcast to the lightning network |
| electrum_url| String | The connection string for your electrum server |
| start | Boolean | Whether or not to also unlock and start your node upon successful init |

### Response Parameters
Expand Down
2 changes: 1 addition & 1 deletion pages/http/admin/list_nodes.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# List Nodes

This method lists all of your nodes child nodes.
This method lists all of your node's child nodes.

### Endpoint

Expand Down