triasapp

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2019 License: Apache-2.0 Imports: 17 Imported by: 0

README

TriasCode

通过实现ABCI来完成与tendermint进行结合。 主要有三类交易,一类是合约的部署、执行、查询相关交易。一类是utxo帐户体系的实现。再一类是纯byte类型的交易,这种是tendermint默认的交易。 目前版本与合约、UTXO的通信为http,这个在下一个版本会修改为grpc。

使用

直接到cmd下go build二进制之后执行即可。其启动后terdermint通过tcp:46658端口连续abci server

Documentation

Overview

* Trias abci :

this application implements the tendermint abci.
@author vincent

Index

Constants

View Source
const (
	TypeContract    = "contract"
	TypeTransaction = "Vout"
)
View Source
const (
	ValidatorSetChangePrefix string = "val:"
)

Variables

This section is empty.

Functions

func MakeValSetChangeTx

func MakeValSetChangeTx(pubkey []byte, power uint64) []byte

func SaveLastBlock

func SaveLastBlock(db dbm.DB, lastBlock LastBlockInfo)

Types

type LastBlockInfo

type LastBlockInfo struct {
	Height  uint64
	AppHash []byte
}

func LoadLastBlock

func LoadLastBlock(db dbm.DB) (lastBlock LastBlockInfo)

Get the last block from the db

type PersistentTriasCodeApplication

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

func NewPersistentTriasCodeApplication

func NewPersistentTriasCodeApplication(dbDir string) *PersistentTriasCodeApplication

func (*PersistentTriasCodeApplication) BeginBlock

func (app *PersistentTriasCodeApplication) BeginBlock(hash []byte, header *types.Header)

Track the block hash and header information

func (*PersistentTriasCodeApplication) CheckTx

func (app *PersistentTriasCodeApplication) CheckTx(tx []byte) types.Result

func (*PersistentTriasCodeApplication) Commit

func (*PersistentTriasCodeApplication) DeliverTx

func (app *PersistentTriasCodeApplication) DeliverTx(tx []byte) types.Result

tx is either "key=value" or just arbitrary bytes

func (*PersistentTriasCodeApplication) EndBlock

func (app *PersistentTriasCodeApplication) EndBlock(height uint64) (resEndBlock types.ResponseEndBlock)

Update the validator set

func (*PersistentTriasCodeApplication) Info

func (app *PersistentTriasCodeApplication) Info() (resInfo types.ResponseInfo)

func (*PersistentTriasCodeApplication) InitChain

func (app *PersistentTriasCodeApplication) InitChain(validators []*types.Validator)

Save the validators in the merkle tree

func (*PersistentTriasCodeApplication) Query

func (*PersistentTriasCodeApplication) SetLogger

func (app *PersistentTriasCodeApplication) SetLogger(l log.Logger)

func (*PersistentTriasCodeApplication) SetOption

func (app *PersistentTriasCodeApplication) SetOption(key string, value string) (log string)

func (*PersistentTriasCodeApplication) Validators

func (app *PersistentTriasCodeApplication) Validators() (validators []*types.Validator)

type TriasCodeApplication

type TriasCodeApplication struct {
	types.BaseApplication
	// contains filtered or unexported fields
}

func NewTriasCodeApplication

func NewTriasCodeApplication() *TriasCodeApplication

func (*TriasCodeApplication) CheckTx

func (app *TriasCodeApplication) CheckTx(tx []byte) types.Result

检查数据 如果包括合约相关的,不关心是合约的创建还是执行,都转发到合约处 如果包括帐户交易相关的,直接转到交易服务处

func (*TriasCodeApplication) Commit

func (app *TriasCodeApplication) Commit() types.Result

func (*TriasCodeApplication) DeliverTx

func (app *TriasCodeApplication) DeliverTx(tx []byte) types.Result

tx is either "key=value" or just arbitrary bytes

func (*TriasCodeApplication) Info

func (app *TriasCodeApplication) Info() (resInfo types.ResponseInfo)

func (*TriasCodeApplication) Query

func (app *TriasCodeApplication) Query(reqQuery types.RequestQuery) (resQuery types.ResponseQuery)

TODO 查询merkle tree的交易问题修复

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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