# README

Node

GoDoc

Package node provides an interface for cardano backends/nodes. Node implements two backends; blockfrost API and cardano-cli.

Installation

go get github.com/jsambuo/go-cardano-serialization/node

Usage

Basic usage on how to setup a Blockfrost Node on testnet and query for utxos for an address.

package main

import (
    "fmt"
    "log"
    "github.com/jsambuo/go-cardano-serialization/node"
)

func prettyPrint(v interface{}) string {
	bytes, _ := json.MarshalIndent(v, "", "	")
	return string(bytes)
}

func main() {
    cli := node.NewBlockfrostClient(
		os.Getenv("BLOCKFROST_PROJECT_ID"),
		network.TestNet(),
	)

    addr, err := address.NewAddress(
        "addr_test1qqe6zztejhz5hq0xghlf72resflc4t2gmu9xjlf73x8dpf88d78zlt4rng3ccw8g5vvnkyrvt96mug06l5eskxh8rcjq2wyd63"
    )
    if err != nil {
        log.Fatal(err)
    }

    utxos, err := cli.UTXOs(addr)
    if err != nil {
        log.Fatal(err)
    }

    prettyPrint(utxos)
}

More examples on node usage can be found in the examples

License

Licensed under the Apache License 2.0, see LICENSE

# Functions

NewBlockfrostClient returns a wrapper for the blockfrost API/SDK with Node interface.
NewCardanoCliNode returns a wrapper for the cardano-cli with the Node interface.

# Structs

NetworkTip contains parameters from the tip of the network.

# Interfaces

No description provided by the author