2 releases

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

#15 in #uptime

Download history 98/week @ 2024-03-11 121/week @ 2024-03-18 200/week @ 2024-03-25 198/week @ 2024-04-01 85/week @ 2024-04-08 119/week @ 2024-04-15 123/week @ 2024-04-22 112/week @ 2024-04-29 138/week @ 2024-05-06 115/week @ 2024-05-13 111/week @ 2024-05-20 75/week @ 2024-05-27 91/week @ 2024-06-03 90/week @ 2024-06-10 99/week @ 2024-06-17 123/week @ 2024-06-24

403 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

~100MB
~876K SLoC