Blockstream Completes Its First Lightning Transaction on Bitcoin Testnet
4 stars based on
80 reviews
The default bcoin HTTP server listens on the standard RPC port for main, for testnet, testnet blockchain height regtest, and default for simnet. Install bcoin-cli and bwallet-cli command line tools with the bclient package. Included with bcoin by default, but can be installed separately: You can also use api with Javascript Library used by bcoin-cli.
There are two objects: Client for general API and bcoin. Wallet for wallet API. Broadcast a transaction by adding it to the node's mempool. If mempool verification fails, the node will testnet blockchain height forcefully advertise and testnet blockchain height the transaction for the next 60 seconds.
This is documentation how to use it with bcoin. It won't accept that block as valid Invalidation will work while running, restarting node will remove invalid block from list. Returns the estimated current or historical network hashes per second, based on last blocks.
Returns new work, whenever new TX is received in the mempool or new block has been discovered. So miner can restart mining on new data. Also validates proposal if mode is specified as proposal. Admin commands are simply commands no specific to any particular wallet, and may impact all wallets on the system.
Additional security is available by specifying admin-token in your configuration if wallet-auth is also enabled. Testnet blockchain height admin-token is specified, add? Initiates a blockchain rescan for the walletdb.
Wallets will be rolled back to the specified height transactions above this height will be unconfirmed. The best way to interact with the wallet API is with the bwallet-cli in the bclient package. Installing globally with npm i -g bclient gives you access to the cli. You can also install locally to your project. Note that when using testnet blockchain height in your own program, you will need to explicitly pass in a port option.
The testnet blockchain height way to do this is with bcoin. You can create a client for a specific wallet and be compatible with the old api with the wallet method on Testnet blockchain height class. Bcoin maintains a wallet database which contains every wallet. Wallets are not usable without also using a wallet database. For testing, the wallet database can be in-memory, but it must be there. Wallets testnet blockchain height uniquely identified by an id and the walletdb is created with a default id of primary.
See Create a Wallet below for more details. Wallets in bcoin use bip They also originally supported bip45 for multisig, but support was removed to reduce code complexity, and also because bip45 doesn't seem to add any benefit in practice. The wallet database can contain many different wallets, with many different accounts, with many different addresses for each account.
Each account can testnet blockchain height of a different type. You could have a pubkeyhash account, as well as a multisig account, a witness pubkeyhash account, etc. Note that accounts should not be accessed directly from the public API. They do not have locks which can lead to race conditions during writes. The wallet HTTP server listens on it's own port, separate from the node's server. Persistent configuration can be added to wallet. Same directory has bcoin.
A wallet is always created with a corresponding token. When using api endpoints for a specific wallet, the token must be sent back in the query string or json body. Get wallet master HD key. This is normally censored in the wallet info route. The provided api key must have admin access. Derive the AES key from passphrase and hold it in memory for a specified number of seconds.
During this time, account creation and signing of transactions will not require a passphrase. Testnet blockchain height import can be either a private key or a public key for watch-only.
Watch Only wallets will throw an error if trying to import a private key. Import a Base58Check encoded address. Addresses like public keys can only be imported into watch-only wallets. Response will return addedKey: Returns false if key already added, but will still return success: Response will return removedKey: Returns false if key already removed, but will still return success: Derive new nested p2sh receiving address for account.
Note that this can't be done on a non-witness account otherwise you will receive the following error:. Get wallet or account balance. If no account option is passed, testnet blockchain height call defaults to wallet balance with account index of Abandon single pending transaction. Confirmed transactions will throw an error. Note that this object does not enforce locks. Any method that does a write is internal API only testnet blockchain height will lead to race conditions if used elsewhere.
From the BIP44 Specification:. This level splits the key space into independent user identities, so the wallet never mixes the coins across different accounts. Users can use these accounts to organize the funds in the same fashion as bank accounts; for donation purposes where all addresses are considered publicfor saving purposes, for common expenses etc.
Accounts are numbered from index 0 in sequentially increasing manner. This number is used as child index in BIP32 derivation. List all account testnet blockchain height array indices map directly to bip44 account indices associated with a specific wallet id.
Note that even if the server API key is disabled on the test server, the wallet auth event must still be sent to complete the handshake. After creating a websocket and authing with the server, you must send a wallet join event to listen for events testnet blockchain height a wallet. Object in the form: Any errors will be returned with an http status code other thancontaining a JSON object in the form:.
Authentication Auth curl http: Further examples will only include "result" part. RPC Calls are accepted at: Name Default Description None.
Name Default Description 1 script Required Bitcoin script. It will rewind network to blockhash and invalidate it. Name Default Description 1 testnet blockchain height Required Hash of the block 2 verbose true If set to false, it will return hex of the block 3 details false If set to true, it will return transaction details too. Name Default Description 1 blockheight Required height of the block in the blockchain.
The above command returns JSON "result" like this: Or mempool tx list. Name Default Description 1 nblocks 1 Number of blocks to check for estimation. Name Default Description 1 outpoints Required Outpoint list 1. Name Default Description 1 proof Required Proof of transaction inclusion. Name Default Description 1 blocks Number of blocks to lookup. Or submits solved block. Name Default Description 1 data Data to be submitted to the network. Name Default Description 1 blockdata Required.
Name Default Description 1 mining 0 true will start mining, false will stop. Name Default Description 1 numblocks 1 Number of blocks to mine. Coin Getting coin information via API.
Returns coin in bcoin coin json format. This is highly recommended, especially on testnet blockchain height instances. Returns an array of strings. Configuration Persistent configuration can be added to wallet.
If not present, it will be generated witness Boolean false Whether to use witness programs watchOnly Boolean false accountKey Testnet blockchain height The extended public key for the primary account in the new wallet.