5.2 KiB
id | title |
---|---|
server | Application Server |
App server
The server project is the aggregation of these three sub projects
The server project provides a away to access information from these three projects via a JSON RPC.
Building the server
You can build the server with the sbt native packager. The native packager offers numerous ways to package the project.
In this example we are going to use stage
which will produce bash scripts we can easily execute. You can stage the server with the following command.
$ sbt appServer/universal:stage
This will produce a script to execute bitcoin-s which you can start with
$ ./app/server/target/universal/stage/bin/bitcoin-s-server
Configuration
If you would like to pass in a custom datadir for your server, you can do
./app/server/target/universal/stage/bin/bitcoin-s-server --datadir /path/to/datadir/
To use a config file that is not the bitcoin-s.conf
file in your datadir, you can do
./app/server/target/universal/stage/bin/bitcoin-s-server --conf /path/to/file.conf
You can also pass in a custom rpcport
to bind to
./app/server/target/universal/stage/bin/bitcoin-s-server --rpcport 12345
For more information on configuring the server please see our configuration document
For more information on how to use our built in cli
to interact with the server please see cli.md
Server Endpoints
Blockchain
getblockcount
- Get the current block heightgetfiltercount
- Get the number of filtersgetfilterheadercount
- Get the number of filter headersgetbestblockhash
- Get the best block hash
Wallet
rescan
[options]
- Rescan for wallet UTXOs--force
- Clears existing wallet records. Warning! Use with caution!--batch-size <value>
- Number of filters that can be matched in one batch--start <value>
- Start height--end <value>
- End height--ignorecreationtime
- Ignores the wallet creation date and will instead do a full rescan
isempty
- Checks if the wallet contains any datagetbalance
[options]
- Get the wallet balance--sats
- Display balance in satoshis
getconfirmedbalance
[options]
- Get the wallet balance of confirmed utxos--sats
- Display balance in satoshis
getunconfirmedbalance
[options]
- Get the wallet balance of unconfirmed utxos--sats
- Display balance in satoshis
getutxos
- Returns list of all wallet utxosgetaddresses
- Returns list of all wallet addresses currently being watchedgetspentaddresses
- Returns list of all wallet addresses that have received funds and been spentgetfundedaddresses
- Returns list of all wallet addresses that are holding fundsgetunusedaddresses
- Returns list of all wallet addresses that have not been usedgetaccounts
- Returns list of all wallet accountscreatenewaccount
- Creates a new wallet accountgetaddressinfo
address
- Returns list of all wallet accountsaddress
- Address to get information about
getnewaddress
- Get a new addresssendtoaddress
address
amount
[options]
- Send money to the given addressaddress
- Address to send toamount
- Amount to send in BTC--feerate <value>
- Fee rate in sats per virtual byte
sendfromoutpoints
outpoints
address
amount
[options]
- Send money to the given addressoutpoints
- Out Points to send fromaddress
- Address to send toamount
- Amount to send in BTC--feerate <value>
- Fee rate in sats per virtual byte
sendwithalgo
address
amount
algo
[options]
- Send money to the given address using a specific coin selection algoaddress
- Address to send toamount
- Amount to send in BTCalgo
- Coin selection algo--feerate <value>
- Fee rate in sats per virtual byte
opreturncommit
message
[options]
- Creates OP_RETURN commitment transactionmessage
- message to put into OP_RETURN commitment--hashMessage
- should the message be hashed before commitment--feerate <value>
- Fee rate in sats per virtual byte
Network
getpeers
- List the connected peersstop
- Request a graceful shutdown of Bitcoin-Ssendrawtransaction
tx
Broadcasts the raw transaction
tx
- Transaction serialized in hex
PSBT
combinepsbts
psbts
- Combines all the given PSBTspsbts
- PSBTs serialized in hex or base64 format
joinpsbts
psbts
- Combines all the given PSBTspsbts
- PSBTs serialized in hex or base64 format
finalizepsbt
psbt
- Finalizes the given PSBT if it canpsbt
- PSBT serialized in hex or base64 format
extractfrompsbt
psbt
- Extracts a transaction from the given PSBT if it canpsbt
- PSBT serialized in hex or base64 format
converttopsbt
unsignedTx
- Creates an empty psbt from the given transactionunsignedTx
- serialized unsigned transaction in hex