Skip to content

cristianino/gokeypubscan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GoKeyPubScan

Este es un generador de direcciones de Bitcoin en Golang, su implementación es sencilla

Instalación

go get -u github.com/cristianino/gokeypubscan

Uso consultando API

package main

import (
	"fmt"

	"github.com/cristianino/gokeypubscan"
)

func main() {
	var keys gokeypubscan.Keys
	keys.GeneratePrivKey()
	keys.GeneratePublicKey()
	keys.GenerateAddress()
	keys.GetBalance()

	// Print the private key, public key, and Bitcoin address to the console.
	fmt.Println("Private key:", keys.GetKeyPrivate())
	fmt.Println("Public key:", keys.GetKeyPublic())
	fmt.Println("Bitcoin address:", keys.GetAddress())
	fmt.Printf("El saldo de la wallet BTC es: %f BTC\n", keys.Balance)
}

Uso consultando Nodo local

package main

import (
	"fmt"

	"github.com/cristianino/gokeypubscan"
)

func main() {
	var keys gokeypubscan.Keys
	keys.GeneratePrivKey()
	keys.GeneratePublicKey()
	keys.GenerateAddress()
	keys.isLocalNode(NodeData{
		url:     "127.0.0.1",
		port:    ":8332",
		userRcp: "tu_usuario_rpc",
		passRcp: "tu_contraseña_rpc",
		useSSL:  false,
	})
	keys.GetBalance()

	// Print the private key, public key, and Bitcoin address to the console.
	fmt.Println("Private key:", keys.GetKeyPrivate())
	fmt.Println("Public key:", keys.GetKeyPublic())
	fmt.Println("Bitcoin address:", keys.GetAddress())
	fmt.Printf("El saldo de la wallet BTC es: %f BTC\n", keys.Balance)
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages