2 releases

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

#68 in #json-rpc-server

Download history 116/week @ 2024-07-19 89/week @ 2024-07-26 97/week @ 2024-08-02 101/week @ 2024-08-09 80/week @ 2024-08-16 74/week @ 2024-08-23 84/week @ 2024-08-30 79/week @ 2024-09-06 85/week @ 2024-09-13 92/week @ 2024-09-20 69/week @ 2024-09-27 25/week @ 2024-10-04 57/week @ 2024-10-11 53/week @ 2024-10-18 43/week @ 2024-10-25 81/week @ 2024-11-01

234 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

~98MB
~860K SLoC