2 releases

0.1.16-alpha.0 Apr 2, 2023
0.1.12-alpha.0 Jan 19, 2023

#69 in #json-rpc-server

Download history 78/week @ 2024-07-22 89/week @ 2024-07-29 120/week @ 2024-08-05 76/week @ 2024-08-12 79/week @ 2024-08-19 106/week @ 2024-08-26 76/week @ 2024-09-02 56/week @ 2024-09-09 89/week @ 2024-09-16 92/week @ 2024-09-23 63/week @ 2024-09-30 83/week @ 2024-10-14 49/week @ 2024-10-21 47/week @ 2024-10-28 68/week @ 2024-11-04

247 downloads per month
Used in 47 crates (16 directly)

MIT license

1MB
3K SLoC

bitcoinrpc-server crate description

The bitcoinrpc-server crate provides a Rust implementation of the Bitcoin JSON-RPC server, which allows clients to interact with a running Bitcoin node over a network connection.

The crate includes various types and functions for managing the RPC server, such as RPCServer for handling incoming connections, RPCTable for storing registered RPC methods, and RPCCommandExecution for executing RPC commands. The RPCCommandExecutionInfo type contains information about the execution of a particular RPC command, such as timing and resource usage.

The RPCServerInfo type provides information about the current status of the RPC server, including uptime and whether it is currently running or stopped. The Actor type is used to execute RPC commands in an asynchronous context.

The RPCCommand type represents an individual RPC method, which is registered with the RPCTable. The help and list_commands methods can be used to obtain information about the available RPC methods, while the execute_command and execute_commands methods are used to execute RPC commands.

The crate also includes various utility functions, such as getrpcinfo, which returns information about the RPC server, and uptime, which returns the uptime of the node.

Notice: This crate is part of a direct translation from C++ to Rust of the Bitcoin Core. As such, some of the function bodies may still be in the process of translation. Please note that this system will become testable once the translation process is complete.

115> how does this fit into the overall bitcoin system?

The bitcoinrpc-server crate provides an interface for developers to communicate with the bitcoin daemon over RPC (Remote Procedure Call) protocol. The daemon runs in the background and provides various functionalities to the system such as managing the blockchain, mining new blocks, verifying transactions, and handling peer-to-peer communication.

Developers can use the RPC interface provided by the bitcoinrpc-server crate to interact with the daemon and perform various tasks such as querying the blockchain, sending transactions, and generating new blocks. This interface is an essential part of the overall bitcoin system as it provides a standard way for developers to interact with the daemon, which in turn helps ensure the stability and security of the system.

Overall, the bitcoinrpc-server crate plays an important role in the bitcoin system by providing a reliable and standardized interface for developers to interact with the daemon, helping to ensure the continued growth and success of the bitcoin ecosystem.

116> which metrics should we track?

In the context of the bitcoinrpc-server crate, some metrics that may be useful to track include:

  • Number of RPC commands executed

  • Time taken to execute RPC commands

  • Number of connections to the RPC server

  • Memory usage of the RPC server process

  • Number of errors encountered during RPC command execution

  • Number of RPC commands currently being executed

  • RPC command usage statistics (e.g. most frequently used commands, least frequently used commands)

These metrics can provide insights into the performance and usage of the RPC server, which can be helpful for identifying bottlenecks and optimizing the server for better performance.

Dependencies

~99MB
~883K SLoC