service

package
v0.0.0-...-2797e35 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 18, 2020 License: MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AtomicSwapService atomicSwapManager
View Source
var ChannelService = channelManager{}
View Source
var CommitmentTxService commitmentTxManager
View Source
var CommitmentTxSignedService commitmentTxSignedManager
View Source
var FundingTransactionService fundingTransactionManager
View Source
var HDWalletService hdWalletManager
View Source
var HtlcBackwardTxService htlcBackwardTxManager

HTLC Reverse pass the R (Preimage R)

View Source
var HtlcCloseTxService htlcCloseTxManager

htlc 关闭当前htlc交易

View Source
var HtlcForwardTxService htlcForwardTxManager

htlc pay money 付款

View Source
var HtlcHMessageService htlcHMessageManager
View Source
var HtlcQueryService = htlcQueryManager{}
View Source
var HttpService httpService
View Source
var MessageService messageManage
View Source
var OnlineUserMap = make(map[string]bool)
View Source
var P2PLocalPeerId string
View Source
var PathService = pathManager{}
View Source
var ScheduleService = scheduleManager{}
View Source
var UserService = UserManager{}

Functions

func CreateCustomMuiltAddress

func CreateCustomMuiltAddress()

构建一个自定义的多签地址,用于锁住输入

func CreateCustomP2SHSpendTx

func CreateCustomP2SHSpendTx()

func CreateCustomP2SHTx

func CreateCustomP2SHTx()

func CreateCustomSpendTx

func CreateCustomSpendTx()

func CreateCustomSpendTxForScriptHash

func CreateCustomSpendTxForScriptHash()

func CreateCustomTx

func CreateCustomTx()

解密 Transaction puzzle https://en.bitcoin.it/wiki/Script#Transaction_puzzle

func CreateMuiltAddress

func CreateMuiltAddress()

func CreateP2PKHSpendTx

func CreateP2PKHSpendTx()

func CreateP2PKHTx

func CreateP2PKHTx()

新的地址 用addrtool_mnemonic_test.go的Test_Demo2生成,index = 1 {"index":1,"address":"n2Lo7zwvek2NHmvHSD85WARKSfYwJxofve","pub_key":"0288d87affee96b8fd0fc5eb6fa4f4dae0c2e69145deda8d0768a3c2aa3a77a0b5","wif":"cVEQD3Wm9pdpmAjHz3AuA5uGqZVgEt2kKbVrwUwRTsyLx9z12KvT"}

func CreateP2SHSpendTx

func CreateP2SHSpendTx()

func CreateP2SHTx

func CreateP2SHTx()

func DeriveRevocationPubkey

func DeriveRevocationPubkey(revokeBase, commitPoint *btcec.PublicKey) *btcec.PublicKey

func FindUserIsOnline

func FindUserIsOnline(peerId string) error

func GenMultiSigScript

func GenMultiSigScript(aPub, bPub []byte) ([]byte, error)

func GenerateBTC

func GenerateBTC() (string, string, error)

func GenerateBTCTest

func GenerateBTCTest() (string, string, error)

func GetChannelInfoByTwoPeerID

func GetChannelInfoByTwoPeerID(peerIdA string, peerIdB string) (channelInfo *dao.ChannelInfo, err error)

GetChannelInfoByTwoPeerID

Get a channel info by two peer ID.

func GetHtlcFee

func GetHtlcFee() float64

func Ripemd160H

func Ripemd160H(d []byte) []byte

func SenderHTLCScript

func SenderHTLCScript(senderHtlcKey, receiverHtlcKey, revocationKey *btcec.PublicKey, paymentHash []byte) ([]byte, error)

func SingleTweakBytes

func SingleTweakBytes(commitPoint, basePoint *btcec.PublicKey) []byte

func WitnessScriptHash

func WitnessScriptHash(witnessScript []byte) ([]byte, error)

Types

type Message

type Message struct {
	Id        int             `storm:"id,increment" json:"id" `
	HashValue string          `json:"hash_value"`
	Sender    string          `json:"sender"`
	Receiver  string          `json:"receiver"`
	Data      string          `json:"data"`
	CurrState dao.NormalState `json:"curr_state"`
	CreateAt  time.Time       `json:"create_at"`
	ReadAt    time.Time       `json:"read_at"`
}

type Node

type Node struct {
	ID   int `storm:"id,increment" `
	Name string
	Date time.Time
}

type NodeService

type NodeService struct {
}

func (*NodeService) Get

func (service *NodeService) Get(id interface{}) (data Node, err error)

func (*NodeService) Save

func (service *NodeService) Save(node *Node) error

type PathBranchInfo

type PathBranchInfo struct {
	Peer2Peer string           `json:"peer_2_peer"`
	Amount    float64          `json:"amount"`
	Channel   *dao.ChannelInfo `json:"channel"`
}

type PathNode

type PathNode struct {
	ParentNode     int    `json:"parent_node"`
	PathNames      string `json:"path_names"`
	PathIdArr      []int  `json:"path_peers"`
	ChannelId      int    `json:"channel_id"`
	Level          uint16 `json:"level"`
	CurrNodePeerId string `json:"curr_node_peer_id"`
	IsRoot         bool   `json:"is_root"`
	IsTarget       bool   `json:"is_target"`
}

type RequestGetInfoByChannelId

type RequestGetInfoByChannelId struct {
	ChannelId string `json:"channel_id"`
}

type Transaction

type Transaction struct {
	TxId               string `json:"txid"`
	SourceAddress      string `json:"source_address"`
	DestinationAddress string `json:"destination_address"`
	Amount             int64  `json:"amount"`
	UnsignedTx         string `json:"unsignedtx"`
	SignedTx           string `json:"signedtx"`
}

func CreateTransaction

func CreateTransaction(secret string, destination string, amount int64, txHash string) (Transaction, error)

type TreeNode

type TreeNode struct {
	// contains filtered or unexported fields
}

type UserManager

type UserManager struct {
}

func (*UserManager) UserInfo

func (service *UserManager) UserInfo(email string) (user *dao.User, e error)

func (*UserManager) UserLogin

func (service *UserManager) UserLogin(user *bean.User) error

func (*UserManager) UserLogout

func (service *UserManager) UserLogout(user *bean.User) error

func (*UserManager) UserSignUp

func (service *UserManager) UserSignUp(user *bean.User) error

UserSignUp

type Wallet

type Wallet struct {
	Index   int    `json:"index"`
	Address string `json:"address"`
	PubKey  string `json:"pub_key"`
	//PrivateKey    string `json:"private_key"`
	Wif string `json:"wif"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL