HD bitcoin wallet using golang and Blockcypher for the blockchain requests, for generating addresses, Blockcypher allows you to create wallets, but I thought that would be good to use the API only for the Blockchain requests.
- See tutorial levelup.gitconnected.com/bitcoin-hd-wallet-with-golang-and-grpc-part
- See original code github.com/LuisAcerv/btchdwallet
- See blockcypher api
make local
- launch the appmake test
- launch test
Metrics can be get on http://127.0.0.1:8082/metrics depending on configuration
Status of server can be get by url
http://127.0.0.1:8082/liveness
and
http://127.0.0.1:8082/readiness
curl -OL https://github.com/google/protobuf/releases/download/v3.2.0/protoc-3.2.0-linux-x86_64.zip
unzip protoc-3.2.0-linux-x86_64.zip -d protoc3
sudo mv protoc3/bin/* /usr/local/bin/
sudo mv protoc3/include/* /usr/local/include/
sudo chwon [user] /usr/local/bin/protoc
sudo chwon -R [user] /usr/local/include/google
Run the grpc server
$ go run main.go
In another terminal run:
go run client/client.go -m=create-wallet
New Wallet >>
Public Key: xpub661MyMwAqRbcG3fYrFtkZGesCkhTZWAwHDM2Q1DbeMH6CcQSkrL5qzYwnRkzwKKhrsjbngkC8EcNTBvQmBAJhMUVAXmU4qv8jzVFkhrqme1
Private Key: xprv9s21ZrQH143K3Zb5kEMkC8i8eiryA3T5uzRRbcoz61k7Kp5JDK1qJCETw9vxGBCe88qu57EKUu2hX54zeivPiZhCNQ5dV6CfKdhsCwMqm5j
Mnemonic: coral light army glare basket boil school egg couple payment flee goose
To get your wallet
go run client/client.go -m=get-wallet -mne="coral light army glare basket boil school egg couple payment flee goose"
To get your balance
go run client/client.go -m=get-balance -addr=1Go23sv8vR81YuV1hHGsUrdyjLcGVUpCDy