You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BOLT 3: Bitcoin Gold Transaction and Script Formats
BOLT 4: Onion Routing Protocol
BOLT 5: Recommendations for On-chain Transaction Handling
BOLT 7: P2P Node and Channel Discovery
BOLT 8: Encrypted and Authenticated Transport
BOLT 9: Assigned Feature Flags
BOLT 10: DNS Bootstrap and Assisted Node Location
BOLT 11: Invoice Protocol for Lightning Payments
Misc
Unit tests
Cross-client regression test
SPV client
Application
GUI integration
Payment gateway integration
Have some fun
If you can set up a BTG LN node successfully, please connect to me: 0260af55e51ebb4def6298fd26eba1101e4ede0b54ca76d268f2c5dd30f3d5faa9@45.56.84.44:9735. I will pay you a virtual coffee by testnet btg.
Instructions (BTG testnet only)
This guide will help you compile your own LND for BTG and send / receive Lightning payments between LND nodes. Note that this guide is for testnet only. We use Ubuntu as the example environment.
Step 1: Run BTG core node on testnet
Compile the latest testnet full node from master branch. Make sure zmq support is enabled.
Edit the config file at $HOME/.bitcoingold/bitcoingold.conf. This is the default config file path for Linux builds. Please adjust if you are running on a different OS.
# The following settings are necessary for LND
server=1
rpcuser=your_rpc_user_name
rpcpassword=your_rpc_password
zmqpubrawblock=tcp://127.0.0.1:18501
zmqpubrawtx=tcp://127.0.0.1:18501
txindex=1
# We are still on testnet
testnet=1
# Optional settings
daemon=1
debug=1
Start the bgoldd daemon and fully sync to the testnet. You can check https://test-explorer.bitcoingold.org to ensure the node is at the right block height.
Step 2: Install LND
Generally the instructions are similar to the official LND installation guide (link), but you need to use our repo BTCGPU/lnd instead of the original one.
Install golang-1.10-go:
sudo apt-get install golang-1.10-go
If apt failed to find the package, try apt update
If your package manager doesn't have golang 1.10, you can try to download the binary.
Create Go's base directory $HOME/gocode (as an example) for source management and add the path to $PATH. If you put them in your .bashrc they'll always be ready for you:
git clone https://github.com/BTCGPU/lnd $GOPATH/src/github.com/BTCGPU/lnd
cd $GOPATH/src/github.com/BTCGPU/lnd
make
make install
If you see errors like cannot find package "golang.org/x/sys/cpu", please check the Troubleshooting Section.
You should now be able to use the command line tools lnd and lncli.
Step 3: Configure LND
After installing LND, we connect LND to the BTG core client bgoldd. Note that LND will try to read the rpc credentials and zmq ports from the default core node configuration at $HOME/.bitcoingold/bitcoingold.conf.
Change the default LND config file at $HOME/.lnd/lnd.conf
[Application Options]
; The directory that logs are stored in. The logs are auto-rotated by default.
; Rotated logs are compressed in place.
logdir=~/.lnd/logs
; Disable macaroon authentication. Macaroons are used are bearer credentials to
; authenticate all RPC access. If one wishes to opt out of macaroons, uncomment
; the line below.
; no-macaroons=true
; Listen on port 9735 for incoming connections.
listen=0.0.0.0:9735
[Bitcoingold]
; If the Bitcoingold chain should be active. Atm, only a single chain can be
; active.
bitcoingold.active=1
; Use Bitcoingold's test network.
bitcoingold.testnet=1
; Use the bgoldd back-end
bitcoingold.node=bgoldd
Start bgoldd daemon on testnet and wait it to be fully synced.
Run lnd and it should show similar text as below:
Attempting automatic RPC configuration to bgoldd
Automatically obtained bgoldd's RPC credentials
2018-06-18 03:14:54.363 [INF] LTND: Version 0.3.0-alpha
2018-06-18 03:14:54.363 [INF] CHDB: Checking for schema update: latest_version=0, db_version=0
2018-06-18 03:14:54.367 [INF] RPCS: password gRPC proxy started at 127.0.0.1:8080
2018-06-18 03:14:54.367 [INF] RPCS: password RPC server listening on 127.0.0.1:10009
2018-06-18 03:14:54.367 [INF] LTND: Waiting for wallet encryption password. Use `lncli create` to create wallet, or `lncli unlock` to unlock already created wallet.
Following the instruction for lnd, run lncli create to create a new wallet with your password.
Restart lnd. This time run lncli unlock with your password to activate the daemon.
Run lncli newaddress np2wkh to generate a wallet address and send some coins to the address for testing. The testnet faucet can be used to get testnet coins. (Note: a segwit address is needed for establishing LN channel.)
(Optional) Check the wallet balance by lncli walletbalance.
Connect to another node
Run lncli getinfo. You can get basic information and your identity pubkey from the result.
To connect to another node the identity pubkey and the ip/port is needed. Example:
Note that when connecting two nodes, the one who accepts the connection should have its port (9735 by default) public accessible. To connect to a peer, you need to know its identity pubkey.
When the connection is established, you can check the connected peers by lncli listpeers:
Caveat: Please be aware that a bgoldd instance cannot be shared with more than one lnd if you are doing experiment locally. Sharing the node may result in unexpected behavior.
Open channels
Open a channel to existing peers: lncli openchannel --node_key <target_pubkey> --local_amt <local_amount> --push_amt 0 --block 1.
local_amt: Your initial funding for the new channel, in satoshi.
push_amt: The money you want to push to the other side of the channel.
Send pay_req to the payer. The payer should first check the invoice: lncli decodepayreq <pay_req>
Then the payer pays the invoice: lncli payinvoice --pay_req lntbtg5u1pdnlkpvpp5h5852qdg27t6sq3le4pu7576q4kl8panlwrrsyj3l5ulmrcnrdjqdq4wpshjgrdv5s8qmr9v9ek2cqzysw2xd8rmsxzwxn6n0xpc4ck97l6y09hrmkxf7g88x6n60l8ppgmtsx806t7c6sufuqgvxe492hn7c8flr5uk2z2dlzj385xzgza25mrqqdehuuj
That's it! The instant transaction is done.
Multi-hop payment
Assume there are three nodes: A, B, C. We need to connect them in pairs by channels (e.g. A-B, B-C)
Now A, B, and C can pay to each other, within the channel capacity. A payment between A and C will be relayed by B.
(Optional) To check the route between two nodes, you can run lncli queryroutes <identity_pubkey> --amt <amount_in_sat> (known issue: "lncli queryroutes" crash #4)
Caveat
Technical Preview 2 is our second preview version and is not fully functional, but is useful to demonstrate the progress of development.
Changelog
lncli queryroutesissueStatus of this version
Code base: https://github.com/BTCGPU/lnd
Implementation Checklist
Have some fun
If you can set up a BTG LN node successfully, please connect to me:
0260af55e51ebb4def6298fd26eba1101e4ede0b54ca76d268f2c5dd30f3d5faa9@45.56.84.44:9735. I will pay you a virtual coffee by testnet btg.Instructions (BTG testnet only)
This guide will help you compile your own LND for BTG and send / receive Lightning payments between LND nodes. Note that this guide is for testnet only. We use Ubuntu as the example environment.
Step 1: Run BTG core node on testnet
masterbranch. Make sure zmq support is enabled.$HOME/.bitcoingold/bitcoingold.conf. This is the default config file path for Linux builds. Please adjust if you are running on a different OS.bgoldddaemon and fully sync to the testnet. You can check https://test-explorer.bitcoingold.org to ensure the node is at the right block height.Step 2: Install LND
Generally the instructions are similar to the official LND installation guide (link), but you need to use our repo
BTCGPU/lndinstead of the original one.golang-1.10-go:aptfailed to find the package, tryapt update$HOME/gocode(as an example) for source management and add the path to $PATH. If you put them in your.bashrcthey'll always be ready for you:cannot find package "golang.org/x/sys/cpu", please check the Troubleshooting Section.lndandlncli.Step 3: Configure LND
After installing LND, we connect LND to the BTG core client
bgoldd. Note that LND will try to read the rpc credentials and zmq ports from the default core node configuration at$HOME/.bitcoingold/bitcoingold.conf.$HOME/.lnd/lnd.confbgoldddaemon on testnet and wait it to be fully synced.lndand it should show similar text as below:Step 4: Play with LND
The technical preview 1 has the functionality to run the tutorial:
https://dev.lightning.community/tutorial/01-lncli/index.html
We use
lnclito controllnd.Prepare the wallet
lnd, runlncli createto create a new wallet with your password.lnd. This time runlncli unlockwith your password to activate the daemon.lncli newaddress np2wkhto generate a wallet address and send some coins to the address for testing. The testnet faucet can be used to get testnet coins. (Note: a segwit address is needed for establishing LN channel.)lncli walletbalance.Connect to another node
lncli getinfo. You can get basic information and your identity pubkey from the result.Note that when connecting two nodes, the one who accepts the connection should have its port (9735 by default) public accessible. To connect to a peer, you need to know its identity pubkey.
When the connection is established, you can check the connected peers by
lncli listpeers:Caveat: Please be aware that a
bgolddinstance cannot be shared with more than onelndif you are doing experiment locally. Sharing the node may result in unexpected behavior.Open channels
lncli openchannel --node_key <target_pubkey> --local_amt <local_amount> --push_amt 0 --block 1.Output:
lncli pendingchannelslncli listchannels:lncli walletbalanceRequest money by invoice
lncli addinvoice --amt 1234 --memo "pay me a virtual coffee"pay_reqto the payer. The payer should first check the invoice:lncli decodepayreq <pay_req>lncli payinvoice --pay_req lntbtg5u1pdnlkpvpp5h5852qdg27t6sq3le4pu7576q4kl8panlwrrsyj3l5ulmrcnrdjqdq4wpshjgrdv5s8qmr9v9ek2cqzysw2xd8rmsxzwxn6n0xpc4ck97l6y09hrmkxf7g88x6n60l8ppgmtsx806t7c6sufuqgvxe492hn7c8flr5uk2z2dlzj385xzgza25mrqqdehuujThat's it! The instant transaction is done.
Multi-hop payment
lncli queryroutes <identity_pubkey> --amt <amount_in_sat>(known issue: "lncli queryroutes" crash #4)Close channel