Skip to content

Commit

Permalink
Add two methods
Browse files Browse the repository at this point in the history
  • Loading branch information
ben221199 committed Mar 21, 2024
1 parent c82a2a1 commit 805559f
Showing 1 changed file with 40 additions and 4 deletions.
44 changes: 40 additions & 4 deletions bip-0040.mediawiki
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ It could be possible that a request or response also has a <code>Content-MD5</co

Because it is not sure if an HTTP connection will stay open, it is highly possible that messages will be sent over multiple connections. To keep track of the same "session", a cookie with the name <code>STRATUM_SESSION</code> is used. If a client sends a request with a cookie, the servers knows exactly which session is used and which notifications to send.

Servers could send the <code>Stratum-Session-Timeout</code> header to tell the client when a session with the same session id will be seen as a new session by the server.<ref name="extended"/> The header contains a number that indicates how many seconds are left. This is different from <code>Expires</code> or <code>Max-Age</code> parameters of the <code>Set-Cookie</code> header, that indicate when a cookie (not necessarily a session) should have been expired by the client. For backwards compatibility, a <code>X-Session-Timeout</code> header with the same value should be sent in those requests too.
Servers could send the <code>Stratum-Session-Timeout</code><ref name="extended"/> header to tell the client when a session with the same session id will be seen as a new session by the server. The header contains a number that indicates how many seconds are left. This is different from <code>Expires</code> or <code>Max-Age</code> parameters of the <code>Set-Cookie</code> header, that indicate when a cookie (not necessarily a session) should have been expired by the client. For backwards compatibility, a <code>X-Session-Timeout</code> header with the same value should be sent in those requests too.

====HTTP Poll====

Expand All @@ -83,9 +83,9 @@ If no error occurred, the server will respond with a 200 status code and with <c

====HTTP Push====

HTTP Poll is the default mode when connecting with a server over HTTP. To get the session in HTTP Push mode, a client should send a regular HTTP Poll request with an additional <code>Stratum-Callback-URL</code> header. This will let the server send notifications using the callback URL without the client needing to send HTTP poll requests in with a very small interval. To disable HTTP Push mode, a regular HTTP poll request should be sent with an additional empty <code>Stratum-Callback-URL</code> header. For backwards compatibility, a <code>X-Callback-URL</code> header with the same value should be sent in those requests too.
HTTP Poll is the default mode when connecting with a server over HTTP. To get the session in HTTP Push mode, a client should send a regular HTTP Poll request with an additional <code>Stratum-Callback-URL</code><ref name="extended"/> header. This will let the server send notifications using the callback URL without the client needing to send HTTP poll requests in with a very small interval. To disable HTTP Push mode, a regular HTTP poll request should be sent with an additional empty <code>Stratum-Callback-URL</code><ref name="extended"/> header. For backwards compatibility, a <code>X-Callback-URL</code> header with the same value should be sent in those requests too.

The callback URL will be called when there are notifications. This request is an HTTP POST request with a <code>Content-Type</code> header and a <code>Stratum-Session-ID</code> header. The <code>Stratum-Session-ID</code> contains the same id as the <code>STRATUM_SESSION</code> cookie. This makes it possible to use the callback URL for multiple sessions. The response is of the callback URL is expected to be empty, so any response body will likely be ignored. For backwards compatibility, a <code>X-Session-ID</code> header with the same value should be sent in those requests too.
The callback URL will be called when there are notifications. This request is an HTTP POST request with a <code>Content-Type</code> header and a <code>Stratum-Session-ID</code><ref name="extended"/> header. The <code>Stratum-Session-ID</code><ref name="extended"/> contains the same id as the <code>STRATUM_SESSION</code> cookie. This makes it possible to use the callback URL for multiple sessions. The response is of the callback URL is expected to be empty, so any response body will likely be ignored. For backwards compatibility, a <code>X-Session-ID</code> header with the same value should be sent in those requests too.

===HTTP over SSL/TLS===

Expand Down Expand Up @@ -124,7 +124,43 @@ Stratum over a WebSocket connection with SSL/TLS. Just the same as normal WebSoc
==Specification: Commands==

TODO
===Service: Blockchain Address===

* Service name: <code>blockchain.address</code>
====Method: Get History====

* Method name: <code>get_history</code>
{|
!
! Name
! Value
|-
! Method
| colspan="2" | <code>blockchain.address.get_history</code>
|-
! Param [0]
| <code></code>
| <code></code>
|}

====Method: Subscribe====

* Method name: <code>subscribe</code>
{|
!
! Name
! Value
|-
! Method
| colspan="2" | <code>blockchain.address.subscribe</code>
|-
! Param [0]
| <code></code>
| <code></code>
|}

==References==
<references/>

0 comments on commit 805559f

Please sign in to comment.