Crate bitcoin_ipc

source ·

Structs

  • | Cap’n Proto context struct. Generally the | parent ipc::Context struct should be used | instead of this struct to give all IPC | protocols access to application state, so | there aren’t unnecessary differences between | IPC protocols. But this specialized struct can | be used to pass capnp-specific function and | object types to capnp hooks.
  • | Exception class thrown when a call to remote | method fails due to an IPC error, like a socket | getting disconnected.
  • | Context struct used to give IPC protocol | implementations or implementation hooks access | to application state, in case they need to run | extra code that isn’t needed within a single | process, like code copying global state from | an existing process to a new process when it’s | initialized, or code dealing with shared | objects that are created or destroyed | remotely.

Traits


  • | Interface providing access to | interprocess-communication (IPC) | functionality. The IPC implementation is | responsible for establishing connections | between a controlling process and a process | being controlled. When a connection is | established, the process being controlled | returns an interfaces::Init pointer to the | controlling process, which the controlling | process can use to get access to other | interfaces and functionality. | | When spawning a new process, the steps are: | | 1. The controlling process calls | interfaces::Ipc::spawnProcess(), which | calls ipc::Process::spawn(), which spawns | a new process and returns a socketpair file | descriptor for communicating with it. | interfaces::Ipc::spawnProcess() then calls | ipc::Protocol::connect() passing the | socketpair descriptor, which returns | a local proxy interfaces::Init | implementation calling remote | interfaces::Init methods. | | 2. The spawned process calls | interfaces::Ipc::startSpawnProcess(), which | calls ipc::Process::checkSpawned() to read | command line arguments and determine | whether it is a spawned process and what | socketpair file descriptor it should | use. It then calls ipc::Protocol::serve() | to handle incoming requests from the | socketpair and invoke interfaces::Init | interface methods, and exit when the socket | is closed. | | 3. The controlling process calls local proxy | interfaces::Init object methods to make | other proxy objects calling other remote | interfaces. It can also destroy the initial | interfaces::Init object to close the | connection and shut down the spawned | process.
  • | IPC process interface for spawning bitcoin | processes and serving requests in processes | that have been spawned. | | There will be different implementations of | this interface depending on the platform | (e.g. unix, windows).
  • | IPC protocol interface for calling IPC methods | over sockets. | | There may be different implementations of this | interface for different IPC protocols | (e.g. Cap’n Proto, gRPC, JSON-RPC, or custom | protocols).


Functions

Type Definitions