Versions in this module Expand all Collapse all v0 v0.1.0 Feb 24, 2018 Changes in this version + const Delete + const FAIL + const GITHUB_API_URL + const GITHUB_DEFAULT_URL + const General + const Invoke + const Query + const Read + const STATUS_ACCEPTED + const STATUS_CREATED + const STATUS_OK + const SUCCESS + const Status_TRANSACTION_CONFIRMED + const Status_TRANSACTION_UNCONFIRMED + const Status_TRANSACTION_UNKNOWN + const Write + func ChangeRemote(repos_path string, dir string) error + func CloneRepos(repos_path string, dir string) error + func CloneReposWithName(repos_path string, dir string, dirName string) error + func CommitAll(dir string, comment string) error + func CommitAndPush(dir string, comment string) error + func MakeHashArg(tx Transaction) []string + func MakeTar(source string, target string) error + func PullAndCopyAndRunDocker(imageName string, tarPath string) *docker.Client + func PushRepos(dir string) error + func ResetWithSHA(dir string, sha string) error + func ToConsensusProtoMessage(consensusMessage ConsensusMessage) *pb.ConsensusMessage + func ToElectionProtoMessage(electionMessage ElectionMessage) *pb.ElectionMessage + func ToProtoBlock(block *Block) *pb.Block + func ToProtoPeer(pp Peer) *pb.Peer + func ToProtoPeerTable(pt PeerTable) *pb.PeerTable + func ToProtoTransaction(t Transaction) *pb.Transaction + func ToProtoTxData(t TxData) *pb.TxData + func ToProtoView(view View) *pb.View + type Block struct + Header *BlockHeader + MerkleTree [][]string + MerkleTreeHeight int + TransactionCount int + Transactions []*Transaction + func BlockDeserialize(by []byte) (Block, error) + func CreateNewBlock(prevBlock *Block, createPeerId string) *Block + func FromProtoBlock(pb *pb.Block) *Block + func (s *Block) GenerateBlockHash() error + func (s *Block) MakeMerkleTree() + func (s *Block) PutTranscation(tx *Transaction) error + func (s *Block) Reset() + func (s Block) BlockSerialize() ([]byte, error) + func (s Block) FindTransactionIndex(hash string) (idx int, err error) + func (s Block) MakeMerklePath(idx int) (path []string) + func (s Block) VerifyBlock() (bool, error) + func (s Block) VerifyTx(tx Transaction) (bool, error) + type BlockChain struct + Blocks []*Block + Header *ChainHeader + func CreateNewBlockChain(channelID string, peerId string) *BlockChain + type BlockHeader struct + BlockHash string + BlockHeight int + BlockStatus Block_Status + CreatedPeerID string + MerkleTreeRootHash string + Number uint64 + PeerId string + PreviousHash string + Signature []byte + TimeStamp time.Time + Version string + type Block_Status int + const Status_BLOCK_CONFIRMED + const Status_BLOCK_UNCONFIRMED + type ChainHeader struct + ChainHeight int + ChannelName string + PeerID string + type ConsensusMessage struct + Block *Block + ConsensusID string + MsgType MsgType + SenderID string + SequenceID int64 + TimeStamp time.Time + View View + func FromConsensusProtoMessage(consensusMessage pb.ConsensusMessage) *ConsensusMessage + func NewConsesnsusMessage(consensusID string, view View, sequenceID int64, block *Block, peerID string, ...) ConsensusMessage + type ConsensusState struct + Block *Block + CommitMsgs map[string]ConsensusMessage + CurrentStage Stage + ID string + IsEnd int32 + PrepareMsgs map[string]ConsensusMessage + View *View + func NewConsensusState(view *View, consensusID string, block *Block, currentStage Stage, ...) *ConsensusState + func (cs *ConsensusState) AddMessage(consensusMessage ConsensusMessage) + func (cs *ConsensusState) CommitReady() bool + func (cs *ConsensusState) End() + func (cs *ConsensusState) PrepareReady() bool + type ConsensusStateBuilder interface + Block func(*Block) ConsensusStateBuilder + Build func() *ConsensusState + ConsensusID func(string) ConsensusStateBuilder + CurrentStage func(Stage) ConsensusStateBuilder + EndConsensusHandler func(EndConsensusHandle) ConsensusStateBuilder + Period func(int32) ConsensusStateBuilder + View func(*View) ConsensusStateBuilder + func NewConsensusStateBuilder() ConsensusStateBuilder + type ElectionMessage struct + LastBlockHash string + MsgType ElectionMsgType + PeerIDs []string + SenderID string + Term int64 + func FromElectionProtoMessage(electionMessage pb.ElectionMessage) *ElectionMessage + func NewElectionMessage(r *Raft) ElectionMessage + type ElectionMsgType int32 + const HeartBeatMsg + const RequestVoteMsg + const VoteMsg + type EndConsensusHandle func(*ConsensusState) + type FunctionType string + type GithubRepoInfoResponse struct + FullName string + Name string + func GetRepositoryList(userName string) ([]GithubRepoInfoResponse, error) + type GithubRequestCreateRepos struct + Description string + Name string + type GithubResponse struct + Full_name string + Html_url string + Id int + Message string + Name string + Owner struct{ ... } + Source struct{ ... } + func CreateRepos(repos_name string, token string) (GithubResponse, error) + func ForkRepos(repos_path string, token string) (GithubResponse, error) + func GetRepos(repos_path string) (GithubResponse, error) + type GithubResponseCommits struct + Author struct{ ... } + Committer struct{ ... } + Message string + Sha string + func GetReposCommits(repos_path string) ([]GithubResponseCommits, error) + type Identity struct + type MsgType int + const CommitMsg + const PrepareMsg + const PreprepareMsg + type Params struct + Args []string + Function string + ParamsType int + func SetTxMethodParameters(params_type int, function string, args []string) Params + type Peer struct + HeartBeat int + IpAddress string + PeerID string + Port string + PubKey []byte + TimeStamp time.Time + func FromProtoPeer(pp pb.Peer) *Peer + func (pi *Peer) GetEndPoint() string + func (pi *Peer) Update(Peer *Peer) error + func (pi *Peer) UpdateTimeStamp() + func (pi Peer) String() string + type PeerTable struct + Leader *Peer + MyID string + PeerMap map[string]*Peer + TimeStamp time.Time + func FromProtoPeerTable(pt pb.PeerTable) *PeerTable + func NewPeerTable(myInfo *Peer) (*PeerTable, error) + func (pt *PeerTable) AddPeer(Peer *Peer) + func (pt *PeerTable) FindPeerByPeerID(peerID string) *Peer + func (pt *PeerTable) GetAllPeerList() []*Peer + func (pt *PeerTable) GetMyInfo() Peer + func (pt *PeerTable) GetPeerList() []*Peer + func (pt *PeerTable) IncrementHeartBeat() error + func (pt *PeerTable) SelectRandomPeers(percent float64) ([]Peer, error) + func (pt *PeerTable) UpdatePeerTable(peerTable PeerTable) + func (pt *PeerTable) UpdateTimeStamp() + func (pt PeerTable) String() string + type Raft struct + ElectionTimer time.Timer + HeartbeatTimer time.Timer + func NewRaft(nodeId string) *Raft + func (r *Raft) AppendPeerId(peerId string) + func (r *Raft) CountTerm() + func (r *Raft) CountVote() + func (r *Raft) GetLastBlockHash() string + func (r *Raft) GetLeaderId() string + func (r *Raft) GetNodeId() string + func (r *Raft) GetPeerId() []string + func (r *Raft) GetState() RaftState + func (r *Raft) GetTerm() int64 + func (r *Raft) GetVoteCount() int + func (r *Raft) GetVotedFor() string + func (r *Raft) ResetElectionTimer() + func (r *Raft) ResetVote() + func (r *Raft) SetHeartbeatTimer(t time.Duration) + func (r *Raft) SetLastBlockHash(hash string) + func (r *Raft) SetLeaderId(leaderId string) + func (r *Raft) SetPeerId(peerids []string) + func (r *Raft) SetState(state RaftState) + func (r *Raft) SetTerm(term int64) + func (r *Raft) StopElectionTimer() + func (r *Raft) StopHeartbeatTimer() + func (r *Raft) VoteValidate(candidateRaft *Raft) (bool, error) + func (r *Raft) VotesForItself() + func (r *Raft) Voting(peerId string) + type RaftState int32 + const Candidate + const Follower + const Leader + const ShutDown + type SmartContractResponse struct + Data map[string]string + Error string + Method string + Result string + type Stage int + const Committed + const Idle + const PrePrepared + const Prepared + type Transaction struct + InvokePeerID string + TimeStamp time.Time + TransactionHash string + TransactionID string + TransactionStatus TransactionStatus + TransactionType TransactionType + TxData *TxData + func CreateNewTransaction(peer_id string, tx_id string, tx_type TransactionType, t time.Time, ...) *Transaction + func FromProtoTransaction(t pb.Transaction) *Transaction + func (tx *Transaction) GenerateHash() + func (tx *Transaction) GetTxHash() string + func (tx Transaction) GenerateTransactionHash() string + func (tx Transaction) Validate() bool + type TransactionStatus int + type TransactionType int + type TxData struct + ContractID string + Jsonrpc string + Method TxDataType + Params Params + func FromProtoTxData(ptxData pb.TxData) *TxData + func SetTxData(jsonrpc string, method TxDataType, params Params, contract_id string) *TxData + type TxDataType string + type View struct + ID string + LeaderID string + PeerID []string + func FromProtoView(protoView *pb.View) View