Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 37 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

<img src="Icon.png" style="height: 60px;"/>

A Golang client library wrapping the BGLd JSON RPC API for Bitgesell blockchain network.
[![Go Reference](https://pkg.go.dev/badge/github.com/bitgesellofficial/go-bgld.svg)](https://pkg.go.dev/github.com/bitgesellofficial/go-bgld)

A Go client library wrapping the BGLd JSON-RPC API for the Bitgesell blockchain network.


## Installation
Expand All @@ -15,64 +17,59 @@ go get github.com/bitgesellofficial/go-bgld
## Usage
----
```go
package main

import (
"github.com/bitgesellofficial/go-bgld"
"log"
)

const (
SERVER_HOST = "You server host"
SERVER_PORT = port (int)
USER = "user"
PASSWD = "passwd"
USESSL = false
WALLET_PASSPHRASE = "WalletPassphrase"
)

func main() {
bc, err := bgld.New(SERVER_HOST, SERVER_PORT, USER, PASSWD, USESSL)
if err != nil {
log.Fatalln(err)
}

//walletpassphrase
err = bc.WalletPassphrase(WALLET_PASSPHRASE, 3600)
log.Println(err)

// backupwallet
err = bc.BackupWallet("/tmp/wallet.dat")
log.Println(err)
package main

import (
"log"

bgld "github.com/bitgesellofficial/go-bgld"
)

const (
serverHost = "localhost"
serverPort = 8454
user = "user"
password = "password"
useSSL = false
walletPassphrase = "wallet-passphrase"
)

func main() {
bc, err := bgld.New(serverHost, serverPort, user, password, useSSL)
if err != nil {
log.Fatalln(err)
}

err = bc.WalletPassphrase(walletPassphrase, 3600)
log.Println(err)

// dumpprivkey
privKey, err := bc.DumpPrivKey("1KU5DX7jKECLxh1nYhmQ7CahY7GMNMVLP3")
log.Println(err, privKey)
err = bc.BackupWallet("/tmp/wallet.dat")
log.Println(err)

}
privKey, err := bc.DumpPrivKey("1KU5DX7jKECLxh1nYhmQ7CahY7GMNMVLP3")
log.Println(err, privKey)
}
```

Mores examples in example.go (in examples folder)
More examples are available in `examples/example.go`.

## Documentation

Click on the button below to access the full documentation:

[![GoDoc](https://godoc.org/github.com/bitgesellofficial/go-bgld?status.png)](https://godoc.org/github.com/bitgesellofficial/go-bgld)
[Go Reference for github.com/bitgesellofficial/go-bgld](https://pkg.go.dev/github.com/bitgesellofficial/go-bgld)



## Unit tests
[![Build Status](https://travis-ci.org/Toorop/go-bitcoind.svg)](https://travis-ci.org/toorop/go-bitcoind)

More than 100 unit tests are made.

To run tests:

$ go get github.com/onsi/ginkgo/ginkgo
$ go get github.com/onsi/gomega
$ ginkgo
```sh
go test ./...
```

Running Suite: BGLd Suite
=============================
Expand All @@ -99,4 +96,3 @@ Todo
##### Note on SSL support

Note on ssl support : bgld library doesn't verify the server's certificate chain. That means that it accepts any certificate presented by the server and any host name in that certificate. In this mode, TLS is susceptible to man-in-the-middle attacks.