modulepackage
2.10.0-alpha
Repository: https://github.com/goat-systems/go-tezos.git
Documentation: pkg.go.dev
# README
A Tezos Go Library
Go Tezos is a GoLang driven library for your Tezos node. This library has received a grant from the Tezos Foundation to ensure it's continuous development through 2020.
Installation
Get goTezos
go get github.com/goat-systems/go-tezos/v2
Getting A Block
package main
import (
"fmt"
goTezos "github.com/goat-systems/go-tezos/v2"
)
func main() {
gt, err := goTezos.New("http://127.0.0.1:8732")
if err != nil {
fmt.Printf("could not connect to network: %v", err)
}
block, err := gt.Block(1000)
if err != nil {
fmt.Println(err)
}
fmt.Println(block)
}
Getting a Cycle
cycle, err := gt.Cycle(50)
if err != nil {
fmt.Println(err)
}
fmt.Println(cycle)
Contributing
The Makefile
The makefile is there as a helper to run quality code checks. To run vet and staticchecks please run:
make checks
Contributers: A Special Thank You
License
This project is licensed under the MIT License - see the LICENSE.md file for details
# Functions
CreateWallet creates a new wallet.
ForgeDelegationOperation forges a delegation operation(s) locally.
ForgeOperation forges an operation locally.
ForgeOriginationOperation forges a origination operation(s) locally.
ForgeRevealOperation forges a reveal operation(s) locally.
ForgeTransactionOperation forges a transaction operation(s) locally.
ImportEncryptedWallet imports an encrypted wallet.
ImportWallet imports an unencrypted wallet.
New returns a pointer to a GoTezos and initializes the library with the host's Tezos netowrk constants.
NewInt returns a pointer GoTezos's wrapper Int.
StripBranchFromForgedOperation will strip the branch off an operation and resturn it with the
rest of the operation string minus the signature if signed.
UnforgeOperation takes a forged/encoded tezos operation and decodes it by returning the
operations branch, and contents.
# Constants
DELEGATIONOP is a kind of operation.
ENDORSEMENTOP is a kind of operation.
MUTEZ is mutez on the tezos network.
ORIGINATIONOP is a kind of operation.
REVEALOP is a kind of operation.
TRANSACTIONOP is a kind of operation.
# Structs
BakingRightsInput is the input for the goTezos.BakingRights function.
BalanceUpdates represents the balance updates in a Tezos block
RPC:
/chains/<chain_id>/blocks/<block_id> (<dyn>)
Link:
https://tezos.gitlab.io/api/rpc.html#get-block-id-context-contracts-contract-id-balance
*/.
Ballots represents a ballot total.
Block represents a Tezos block.
BlocksInput is the input for the goTezos.Blocks function.
Bootstrap represents the bootstrap RPC.
Checkpoint represents a Tezos checkpoint.
Constants represents the constants RPC.
Contents represents the contents in a Tezos operations
RPC:
/chains/<chain_id>/blocks/<block_id> (<dyn>)
Link:
https://tezos.gitlab.io/api/rpc.html#get-block-id-context-contracts-contract-id-balance
*/.
ContentsMetadata represents the contents metadata in a Tezos operations
RPC:
/chains/<chain_id>/blocks/<block_id> (<dyn>)
Link:
https://tezos.gitlab.io/api/rpc.html#get-block-id-context-contracts-contract-id-balance
*/.
Cycle represents the cycle RPC.
Delegate represents the frozen delegate RPC on the tezos network.
DelegatesInput is the input for the goTezos.Delegates function.
EndorsingRightsInput is the input for the goTezos.EndorsingRights function.
Error respresents an error for operation results
RPC:
/chains/<chain_id>/blocks/<block_id> (<dyn>)
Link:
https://tezos.gitlab.io/api/rpc.html#get-block-id-context-contracts-contract-id-balance
*/.
ForgeDelegationOperationInput is the input for the ForgeDelegationOperation function.
ForgeOperationWithRPCInput is the input for the goTezos.ForgeOperationWithRPC function.
ForgeOriginationOperationInput is the input for the ForgeOriginationOperation function.
ForgeRevealOperationInput is the input for the ForgeRevalOperation function.
ForgeTransactionOperationInput is the input for the ForgeTransactionOperation function.
FrozenBalance represents the frozen balance RPC on the tezos network.
GoTezos contains a client (http.Client), network contents, and the host of the node.
Header represents the header in a Tezos block
RPC:
/chains/<chain_id>/blocks/<block_id> (<dyn>)
Link:
https://tezos.gitlab.io/api/rpc.html#get-block-id-context-contracts-contract-id-balance
*/.
InjectionBlockInput is the input for the goTezos.InjectionBlock function.
InjectionOperationInput is the input for the goTezos.InjectionOperation function.
Int Wrapper
Description: Int wraps go's big.Int.
InternalOperationResults represents a field in contents metadata in a Tezos operations
RPC:
/chains/<chain_id>/blocks/<block_id> (<dyn>)
Link:
https://tezos.gitlab.io/api/rpc.html#get-block-id-context-contracts-contract-id-balance
*/.
InvalidBlock represents Tezos invalid blocks.
Level represents the level in a Tezos block
RPC:
/chains/<chain_id>/blocks/<block_id> (<dyn>)
Link:
https://tezos.gitlab.io/api/rpc.html#get-block-id-context-contracts-contract-id-balance
*/.
MaxOperationListLength represents the maxoperationlistlength in a Tezos block
RPC:
/chains/<chain_id>/blocks/<block_id> (<dyn>)
Link:
https://tezos.gitlab.io/api/rpc.html#get-block-id-context-contracts-contract-id-balance
*/.
Metadata represents the metadata in a Tezos block
RPC:
/chains/<chain_id>/blocks/<block_id> (<dyn>)
Link:
https://tezos.gitlab.io/api/rpc.html#get-block-id-context-contracts-contract-id-balance
*/.
OperationResult represents the operation result in a Tezos block
RPC:
/chains/<chain_id>/blocks/<block_id> (<dyn>)
Link:
https://tezos.gitlab.io/api/rpc.html#get-block-id-context-contracts-contract-id-balance
*/.
Operations represents the operations in a Tezos block
RPC:
/chains/<chain_id>/blocks/<block_id> (<dyn>)
Link:
https://tezos.gitlab.io/api/rpc.html#get-block-id-context-contracts-contract-id-balance
*/.
PreapplyOperationsInput is the input for the PreapplyOperations.
RPCError represents and RPC error
*/.
SignOperationOutput contains an operation with the signature appended, and the signature.
TestChainStatus represents the testchainstatus in a Tezos block
RPC:
/chains/<chain_id>/blocks/<block_id> (<dyn>)
Link:
https://tezos.gitlab.io/api/rpc.html#get-block-id-context-contracts-contract-id-balance
*/.
UnforgeOperationWithRPCInput is the input for the goTezos.UnforgeOperationWithRPC function.
UnforgeOperationWithRPCOperation -.
UserActivatedProtocolOverrides represents user activated protocl overrides on the Tezos network.
Version represents the Version RPC.
Wallet is a Tezos wallet.
# Interfaces
IFace is an interface mocking a GoTezos object.
# Type aliases
ActiveChains represents the active chains RPC.
BakingRights represents the baking rights RPC on the tezos network.
BallotList represents a list of casted ballots in a block.
Connections represents the connections RPC.
EndorsingRights represents the endorsing rights RPC on the tezos network.
Listings represents a list of delegates with their voting weight, in number of rolls.
Proposals represents a list of proposals with number of supporters.
RPCErrors represents multiple RPCError(s).s
*/.