Documentation ¶
Overview ¶
Package ikhofi is a generated protocol buffer package.
It is generated from these files:
message.proto
It has these top-level messages:
Execution Query TxInfo Result TransactionPb TransactionPbTmp
Index ¶
- Constants
- Variables
- func GetHash(tmp *TransactionPbTmp) (h common.Hash)
- func GetIkhofiPath(path string) string
- func InitIkhofiConfig(root string, conf *viper.Viper) *viper.Viper
- func Sender(signer Signer, tx *Transaction) (common.Address, error)
- type DawnSigner
- type Execution
- func (*Execution) Descriptor() ([]byte, []int)
- func (m *Execution) GetArgs() []string
- func (m *Execution) GetByteCode() []byte
- func (m *Execution) GetId() string
- func (m *Execution) GetMethod() string
- func (m *Execution) GetTxInfo() *TxInfo
- func (m *Execution) GetVersion() int32
- func (*Execution) ProtoMessage()
- func (m *Execution) Reset()
- func (m *Execution) String() string
- type IKHOFIApp
- func (app *IKHOFIApp) CheckTx(bs []byte) error
- func (app *IKHOFIApp) CompatibleWithAngine()
- func (app *IKHOFIApp) ExecuteTx(height def.INT, block *agtypes.BlockCache, bs []byte) (validtx []byte, err error)
- func (app *IKHOFIApp) GetAngineHooks() agtypes.Hooks
- func (app *IKHOFIApp) HandleEvent(eventData civil.EventData, notification *civil.EventNotificationTx)
- func (app *IKHOFIApp) Info() (resInfo agtypes.ResultInfo)
- func (app *IKHOFIApp) OnCommit(height, round def.INT, block *agtypes.BlockCache) (interface{}, error)
- func (app *IKHOFIApp) OnExecute(height, round def.INT, block *agtypes.BlockCache) (interface{}, error)
- func (app *IKHOFIApp) OnNewRound(height, round def.INT, block *agtypes.BlockCache) (interface{}, error)
- func (app *IKHOFIApp) OnPrevote(height, round def.INT, block *agtypes.BlockCache) (interface{}, error)
- func (app *IKHOFIApp) Query(query []byte) agtypes.Result
- func (app *IKHOFIApp) SetCore(c civil.Core)
- func (app *IKHOFIApp) Start() (err error)
- func (app *IKHOFIApp) Stop()
- func (app *IKHOFIApp) SupportCoSiTx()
- type IkhofiConfig
- type LastBlockInfo
- type Query
- type Response
- type Result
- type Signer
- type StartParams
- type Transaction
- type TransactionPb
- func (*TransactionPb) Descriptor() ([]byte, []int)
- func (m *TransactionPb) GetArgs() []string
- func (m *TransactionPb) GetBytecode() []byte
- func (m *TransactionPb) GetFrom() []byte
- func (m *TransactionPb) GetHash() []byte
- func (m *TransactionPb) GetMethod() string
- func (m *TransactionPb) GetNonce() int64
- func (m *TransactionPb) GetR() []byte
- func (m *TransactionPb) GetS() []byte
- func (m *TransactionPb) GetTo() string
- func (m *TransactionPb) GetV() []byte
- func (*TransactionPb) ProtoMessage()
- func (m *TransactionPb) Reset()
- func (m *TransactionPb) String() string
- type TransactionPbTmp
- func (*TransactionPbTmp) Descriptor() ([]byte, []int)
- func (m *TransactionPbTmp) GetArgs() []string
- func (m *TransactionPbTmp) GetBytecode() []byte
- func (m *TransactionPbTmp) GetFrom() []byte
- func (m *TransactionPbTmp) GetMethod() string
- func (m *TransactionPbTmp) GetNonce() int64
- func (m *TransactionPbTmp) GetTo() string
- func (*TransactionPbTmp) ProtoMessage()
- func (m *TransactionPbTmp) Reset()
- func (m *TransactionPbTmp) String() string
- type TxInfo
- func (*TxInfo) Descriptor() ([]byte, []int)
- func (m *TxInfo) GetBlockHeight() int64
- func (m *TxInfo) GetBlockTime() int64
- func (m *TxInfo) GetLastCommitHash() []byte
- func (m *TxInfo) GetTxFrom() string
- func (m *TxInfo) GetTxHash() []byte
- func (*TxInfo) ProtoMessage()
- func (m *TxInfo) Reset()
- func (m *TxInfo) String() string
Constants ¶
const ( RUNTIME_ENV = "ANN_RUNTIME" IKHOFI_PATH = "IKHOFI_PATH" DEFAULT_RUNTIME = ".ann_runtime" DATADIR = "contract_data" DBDATADIR = "chaindata" CONFIGFILE = "ikhofi.yaml" )
const CONFIGTPL = `` /* 179-byte string literal not displayed */
Variables ¶
var ( SystemContractId = "system" SystemDeployMethod = "deploy" SystemUpgradeMethod = "upgrade" SystemQueryContractIdExits = "contract" SystemQueryEventFilterById = "eventFilterById" SystemQueryEventFilterByIdAndType = "eventFilterByIdAndType" )
var ErrInvalidSig = errors.New("invalid transaction v, r, s values")
Functions ¶
func GetHash ¶
func GetHash(tmp *TransactionPbTmp) (h common.Hash)
func GetIkhofiPath ¶
func Sender ¶
func Sender(signer Signer, tx *Transaction) (common.Address, error)
Sender returns the address derived from the signature (V, R, S) using secp256k1 elliptic curve and an error if it failed deriving or upon an incorrect signature.
Sender may cache the address, allowing it to be used regardless of signing method. The cache is invalidated if the cached signer does not match the signer used in the current call.
Types ¶
type DawnSigner ¶
type DawnSigner struct { }
HomesteadTransaction implements TransactionInterface using the homestead rules.
func (DawnSigner) Equal ¶
func (s DawnSigner) Equal(s2 Signer) bool
func (DawnSigner) Hash ¶
func (ds DawnSigner) Hash(tx *Transaction) common.Hash
Hash returns the hash to be sned by the sender. It does not uniquely identify the transaction.
func (DawnSigner) PublicKey ¶
func (ds DawnSigner) PublicKey(tx *Transaction) ([]byte, error)
func (DawnSigner) WithSignature ¶
func (ds DawnSigner) WithSignature(tx *Transaction, sig []byte) (*Transaction, error)
WithSignature returns a new transaction with the given signature. This signature needs to be in the [R || S || V] format where V is 0 or 1.
type Execution ¶
type Execution struct { Version int32 `protobuf:"varint,1,opt,name=version" json:"version,omitempty"` Id string `protobuf:"bytes,2,opt,name=id" json:"id,omitempty"` Method string `protobuf:"bytes,3,opt,name=method" json:"method,omitempty"` Args []string `protobuf:"bytes,4,rep,name=args" json:"args,omitempty"` TxInfo *TxInfo `protobuf:"bytes,5,opt,name=txInfo" json:"txInfo,omitempty"` ByteCode []byte `protobuf:"bytes,6,opt,name=byteCode,proto3" json:"byteCode,omitempty"` }
func (*Execution) Descriptor ¶
func (*Execution) GetByteCode ¶
func (*Execution) GetVersion ¶
func (*Execution) ProtoMessage ¶
func (*Execution) ProtoMessage()
type IKHOFIApp ¶
type IKHOFIApp struct { agtypes.BaseApplication civil.EventAppBase Config *viper.Viper AngineHooks agtypes.Hooks // contains filtered or unexported fields }
func (*IKHOFIApp) CompatibleWithAngine ¶
func (app *IKHOFIApp) CompatibleWithAngine()
func (*IKHOFIApp) GetAngineHooks ¶
func (*IKHOFIApp) HandleEvent ¶
func (app *IKHOFIApp) HandleEvent(eventData civil.EventData, notification *civil.EventNotificationTx)
func (*IKHOFIApp) Info ¶
func (app *IKHOFIApp) Info() (resInfo agtypes.ResultInfo)
func (*IKHOFIApp) OnNewRound ¶
func (*IKHOFIApp) SupportCoSiTx ¶
func (app *IKHOFIApp) SupportCoSiTx()
type IkhofiConfig ¶
type LastBlockInfo ¶
type Query ¶
type Query struct { Version int32 `protobuf:"varint,1,opt,name=version" json:"version,omitempty"` Id string `protobuf:"bytes,2,opt,name=id" json:"id,omitempty"` Method string `protobuf:"bytes,3,opt,name=method" json:"method,omitempty"` Args []string `protobuf:"bytes,4,rep,name=args" json:"args,omitempty"` }
func (*Query) Descriptor ¶
func (*Query) GetVersion ¶
func (*Query) ProtoMessage ¶
func (*Query) ProtoMessage()
type Result ¶
type Result struct { Version int32 `protobuf:"varint,1,opt,name=version" json:"version,omitempty"` Code int32 `protobuf:"varint,2,opt,name=code" json:"code,omitempty"` Msg string `protobuf:"bytes,3,opt,name=msg" json:"msg,omitempty"` Value string `protobuf:"bytes,4,opt,name=value" json:"value,omitempty"` }
func (*Result) Descriptor ¶
func (*Result) GetVersion ¶
func (*Result) ProtoMessage ¶
func (*Result) ProtoMessage()
type Signer ¶
type Signer interface { // Hash returns the rlp encoded hash for signatures Hash(tx *Transaction) common.Hash // PubilcKey returns the public key derived from the signature PublicKey(tx *Transaction) ([]byte, error) // WithSignature returns a copy of the transaction with the given signature. // The signature must be encoded in [R || S || V] format where V is 0 or 1. WithSignature(tx *Transaction, sig []byte) (*Transaction, error) // Checks for equality on the signers Equal(Signer) bool }
type StartParams ¶
type Transaction ¶
type Transaction struct { From common.Address To string Method string Args []string ByteCode []byte Nonce int64 V *big.Int // signature R, S *big.Int // signature Hash common.Hash }
func NewTransaction ¶
func Pb2Transaction ¶
func Pb2Transaction(txpb *TransactionPb) *Transaction
func (*Transaction) SigHash ¶
func (tx *Transaction) SigHash(signer Signer) common.Hash
SigHash returns the hash to be signed by the sender. It does not uniquely identify the transaction.
func (*Transaction) Transaction2Pb ¶
func (tx *Transaction) Transaction2Pb() *TransactionPb
func (*Transaction) Transaction2PbTmp ¶
func (tx *Transaction) Transaction2PbTmp() *TransactionPbTmp
func (*Transaction) WithSignature ¶
func (tx *Transaction) WithSignature(signer Signer, sig []byte) (*Transaction, error)
WithSignature returns a new transaction with the given signature. This signature needs to be formatted as described in the yellow paper (v+27).
type TransactionPb ¶
type TransactionPb struct { From []byte `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` To string `protobuf:"bytes,2,opt,name=to" json:"to,omitempty"` Method string `protobuf:"bytes,3,opt,name=method" json:"method,omitempty"` Args []string `protobuf:"bytes,4,rep,name=args" json:"args,omitempty"` Bytecode []byte `protobuf:"bytes,5,opt,name=bytecode,proto3" json:"bytecode,omitempty"` Nonce int64 `protobuf:"varint,6,opt,name=nonce" json:"nonce,omitempty"` V []byte `protobuf:"bytes,7,opt,name=v,proto3" json:"v,omitempty"` R []byte `protobuf:"bytes,8,opt,name=r,proto3" json:"r,omitempty"` S []byte `protobuf:"bytes,9,opt,name=s,proto3" json:"s,omitempty"` Hash []byte `protobuf:"bytes,10,opt,name=hash,proto3" json:"hash,omitempty"` }
func (*TransactionPb) Descriptor ¶
func (*TransactionPb) Descriptor() ([]byte, []int)
func (*TransactionPb) GetArgs ¶
func (m *TransactionPb) GetArgs() []string
func (*TransactionPb) GetBytecode ¶
func (m *TransactionPb) GetBytecode() []byte
func (*TransactionPb) GetFrom ¶
func (m *TransactionPb) GetFrom() []byte
func (*TransactionPb) GetHash ¶
func (m *TransactionPb) GetHash() []byte
func (*TransactionPb) GetMethod ¶
func (m *TransactionPb) GetMethod() string
func (*TransactionPb) GetNonce ¶
func (m *TransactionPb) GetNonce() int64
func (*TransactionPb) GetR ¶
func (m *TransactionPb) GetR() []byte
func (*TransactionPb) GetS ¶
func (m *TransactionPb) GetS() []byte
func (*TransactionPb) GetTo ¶
func (m *TransactionPb) GetTo() string
func (*TransactionPb) GetV ¶
func (m *TransactionPb) GetV() []byte
func (*TransactionPb) ProtoMessage ¶
func (*TransactionPb) ProtoMessage()
func (*TransactionPb) Reset ¶
func (m *TransactionPb) Reset()
func (*TransactionPb) String ¶
func (m *TransactionPb) String() string
type TransactionPbTmp ¶
type TransactionPbTmp struct { From []byte `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` To string `protobuf:"bytes,2,opt,name=to" json:"to,omitempty"` Method string `protobuf:"bytes,3,opt,name=method" json:"method,omitempty"` Args []string `protobuf:"bytes,4,rep,name=args" json:"args,omitempty"` Bytecode []byte `protobuf:"bytes,5,opt,name=bytecode,proto3" json:"bytecode,omitempty"` Nonce int64 `protobuf:"varint,6,opt,name=nonce" json:"nonce,omitempty"` }
func (*TransactionPbTmp) Descriptor ¶
func (*TransactionPbTmp) Descriptor() ([]byte, []int)
func (*TransactionPbTmp) GetArgs ¶
func (m *TransactionPbTmp) GetArgs() []string
func (*TransactionPbTmp) GetBytecode ¶
func (m *TransactionPbTmp) GetBytecode() []byte
func (*TransactionPbTmp) GetFrom ¶
func (m *TransactionPbTmp) GetFrom() []byte
func (*TransactionPbTmp) GetMethod ¶
func (m *TransactionPbTmp) GetMethod() string
func (*TransactionPbTmp) GetNonce ¶
func (m *TransactionPbTmp) GetNonce() int64
func (*TransactionPbTmp) GetTo ¶
func (m *TransactionPbTmp) GetTo() string
func (*TransactionPbTmp) ProtoMessage ¶
func (*TransactionPbTmp) ProtoMessage()
func (*TransactionPbTmp) Reset ¶
func (m *TransactionPbTmp) Reset()
func (*TransactionPbTmp) String ¶
func (m *TransactionPbTmp) String() string
type TxInfo ¶
type TxInfo struct { BlockHeight int64 `protobuf:"varint,1,opt,name=blockHeight" json:"blockHeight,omitempty"` LastCommitHash []byte `protobuf:"bytes,2,opt,name=lastCommitHash,proto3" json:"lastCommitHash,omitempty"` TxFrom string `protobuf:"bytes,3,opt,name=txFrom" json:"txFrom,omitempty"` BlockTime int64 `protobuf:"varint,4,opt,name=blockTime" json:"blockTime,omitempty"` TxHash []byte `protobuf:"bytes,5,opt,name=txHash,proto3" json:"txHash,omitempty"` }
func (*TxInfo) Descriptor ¶
func (*TxInfo) GetBlockHeight ¶
func (*TxInfo) GetBlockTime ¶
func (*TxInfo) GetLastCommitHash ¶
func (*TxInfo) ProtoMessage ¶
func (*TxInfo) ProtoMessage()