Documentation ¶
Index ¶
- Constants
- Variables
- func CreateChildChain(ctx *cli.Context, chainId string, validator tdmTypes.PrivValidator, ...) error
- func GetTendermintConfig(chainId string, ctx *cli.Context) cfg.Config
- func InitChildChainCmd(ctx *cli.Context) error
- func InitCmd(ctx *cli.Context) error
- func InitEthGenesis(ctx *cli.Context) error
- func MustGetEthereumFromNode(node *node.Node) *eth.Ethereum
- func StartChain(ctx *cli.Context, chain *Chain, startDone chan<- struct{}) error
- type BalaceAmount
- type Chain
- type ChainManager
- func (cm *ChainManager) GetNodeID() string
- func (cm *ChainManager) InitCrossChainHelper()
- func (cm *ChainManager) InitP2P()
- func (cm *ChainManager) LoadChains(childIds []string) error
- func (cm *ChainManager) LoadChildChainInRT(chainId string)
- func (cm *ChainManager) LoadMainChain(ctx *cli.Context) error
- func (cm *ChainManager) StartChains() error
- func (cm *ChainManager) StartInspectEvent()
- func (cm *ChainManager) StartMainChain() error
- func (cm *ChainManager) StartP2PServer() error
- func (cm *ChainManager) StartRPC() error
- func (cm *ChainManager) Stop()
- func (cm *ChainManager) StopChain()
- func (cm *ChainManager) Wait()
- func (cm *ChainManager) WaitChainsStop()
- type CrossChainHelper
- func (cch *CrossChainHelper) CanCreateChildChain(from common.Address, chainId string, minValidators uint16, ...) error
- func (cch *CrossChainHelper) ChangeValidators(chainId string)
- func (cch *CrossChainHelper) CreateChildChain(from common.Address, chainId string, minValidators uint16, ...) error
- func (cch *CrossChainHelper) DeleteTX3(chainId string, txHash common.Hash)
- func (cch *CrossChainHelper) GetAllTX3ProofData() []*types.TX3ProofData
- func (cch *CrossChainHelper) GetChainInfoDB() dbm.DB
- func (cch *CrossChainHelper) GetClient() *ethclient.Client
- func (cch *CrossChainHelper) GetEpochFromMainChain() (string, *epoch.Epoch)
- func (cch *CrossChainHelper) GetHeightFromMainChain() *big.Int
- func (cch *CrossChainHelper) GetMainChainId() string
- func (cch *CrossChainHelper) GetMutex() *sync.Mutex
- func (cch *CrossChainHelper) GetTX3(chainId string, txHash common.Hash) *types.Transaction
- func (cch *CrossChainHelper) GetTX3ProofData(chainId string, txHash common.Hash) *types.TX3ProofData
- func (cch *CrossChainHelper) GetTxFromMainChain(txHash common.Hash) *types.Transaction
- func (cch *CrossChainHelper) JoinChildChain(from common.Address, pubkey crypto.PubKey, chainId string, ...) error
- func (cch *CrossChainHelper) ProcessPostPendingData(newPendingIdxBytes []byte, deleteChildChainIds []string)
- func (cch *CrossChainHelper) ReadyForLaunchChildChain(height *big.Int, stateDB *state.StateDB) ([]string, []byte, []string)
- func (cch *CrossChainHelper) RevealVote(ep *epoch.Epoch, from common.Address, pubkey crypto.PubKey, ...) error
- func (cch *CrossChainHelper) SaveChildChainProofDataToMainChain(bs []byte) error
- func (cch *CrossChainHelper) ValidateJoinChildChain(from common.Address, consensusPubkey []byte, chainId string, ...) error
- func (cch *CrossChainHelper) ValidateTX3ProofData(proofData *types.TX3ProofData) error
- func (cch *CrossChainHelper) ValidateTX4WithInMemTX3ProofData(tx4 *types.Transaction, tx3ProofData *types.TX3ProofData) error
- func (cch *CrossChainHelper) VerifyChildChainProofData(bs []byte) error
- func (cch *CrossChainHelper) VoteNextEpoch(ep *epoch.Epoch, from common.Address, voteHash common.Hash, txHash common.Hash) error
- func (cch *CrossChainHelper) WriteTX3ProofData(proofData *types.TX3ProofData) error
- type InvalidArgs
Constants ¶
View Source
const ( // Client identifier to advertise over the network MainChain = "pchain" TestnetChain = "testnet" )
View Source
const ( OFFICIAL_MINIMUM_VALIDATORS = 1 OFFICIAL_MINIMUM_DEPOSIT = "100000000000000000000000" // 100,000 * e18 )
View Source
const ( POSReward = "315000000000000000000000000" LockReward = "11500000000000000000000000" // 11.5m DefaultAccountPassword = "pchain" )
Variables ¶
View Source
var ( // tendermint config Config cfg.Config )
Functions ¶
func CreateChildChain ¶
func CreateChildChain(ctx *cli.Context, chainId string, validator tdmTypes.PrivValidator, keyJson []byte, validators []tdmTypes.GenesisValidator) error
func GetTendermintConfig ¶
func InitChildChainCmd ¶ added in v1.0.24
func InitChildChainCmd(ctx *cli.Context) error
func InitEthGenesis ¶
func InitEthGenesis(ctx *cli.Context) error
func StartChain ¶
Types ¶
type BalaceAmount ¶
type BalaceAmount struct {
// contains filtered or unexported fields
}
type ChainManager ¶
type ChainManager struct {
// contains filtered or unexported fields
}
func GetCMInstance ¶
func GetCMInstance(ctx *cli.Context) *ChainManager
func (*ChainManager) GetNodeID ¶
func (cm *ChainManager) GetNodeID() string
func (*ChainManager) InitCrossChainHelper ¶
func (cm *ChainManager) InitCrossChainHelper()
func (*ChainManager) InitP2P ¶
func (cm *ChainManager) InitP2P()
func (*ChainManager) LoadChains ¶
func (cm *ChainManager) LoadChains(childIds []string) error
func (*ChainManager) LoadChildChainInRT ¶
func (cm *ChainManager) LoadChildChainInRT(chainId string)
func (*ChainManager) LoadMainChain ¶
func (cm *ChainManager) LoadMainChain(ctx *cli.Context) error
func (*ChainManager) StartChains ¶
func (cm *ChainManager) StartChains() error
func (*ChainManager) StartInspectEvent ¶
func (cm *ChainManager) StartInspectEvent()
func (*ChainManager) StartMainChain ¶
func (cm *ChainManager) StartMainChain() error
func (*ChainManager) StartP2PServer ¶
func (cm *ChainManager) StartP2PServer() error
func (*ChainManager) StartRPC ¶
func (cm *ChainManager) StartRPC() error
func (*ChainManager) Stop ¶
func (cm *ChainManager) Stop()
func (*ChainManager) StopChain ¶ added in v1.0.19
func (cm *ChainManager) StopChain()
func (*ChainManager) Wait ¶ added in v1.0.19
func (cm *ChainManager) Wait()
func (*ChainManager) WaitChainsStop ¶
func (cm *ChainManager) WaitChainsStop()
type CrossChainHelper ¶
type CrossChainHelper struct {
// contains filtered or unexported fields
}
func (*CrossChainHelper) CanCreateChildChain ¶
func (cch *CrossChainHelper) CanCreateChildChain(from common.Address, chainId string, minValidators uint16, minDepositAmount, startupCost *big.Int, startBlock, endBlock *big.Int) error
CanCreateChildChain check the condition before send the create child chain into the tx pool
func (*CrossChainHelper) ChangeValidators ¶
func (cch *CrossChainHelper) ChangeValidators(chainId string)
func (*CrossChainHelper) CreateChildChain ¶
func (cch *CrossChainHelper) CreateChildChain(from common.Address, chainId string, minValidators uint16, minDepositAmount *big.Int, startBlock, endBlock *big.Int) error
CreateChildChain Save the Child Chain Data into the DB, the data will be used later during Block Commit Callback
func (*CrossChainHelper) DeleteTX3 ¶
func (cch *CrossChainHelper) DeleteTX3(chainId string, txHash common.Hash)
func (*CrossChainHelper) GetAllTX3ProofData ¶
func (cch *CrossChainHelper) GetAllTX3ProofData() []*types.TX3ProofData
func (*CrossChainHelper) GetChainInfoDB ¶
func (cch *CrossChainHelper) GetChainInfoDB() dbm.DB
func (*CrossChainHelper) GetClient ¶
func (cch *CrossChainHelper) GetClient() *ethclient.Client
func (*CrossChainHelper) GetEpochFromMainChain ¶
func (cch *CrossChainHelper) GetEpochFromMainChain() (string, *epoch.Epoch)
func (*CrossChainHelper) GetHeightFromMainChain ¶
func (cch *CrossChainHelper) GetHeightFromMainChain() *big.Int
func (*CrossChainHelper) GetMainChainId ¶
func (cch *CrossChainHelper) GetMainChainId() string
func (*CrossChainHelper) GetMutex ¶
func (cch *CrossChainHelper) GetMutex() *sync.Mutex
func (*CrossChainHelper) GetTX3 ¶
func (cch *CrossChainHelper) GetTX3(chainId string, txHash common.Hash) *types.Transaction
TX3LocalCache start
func (*CrossChainHelper) GetTX3ProofData ¶
func (cch *CrossChainHelper) GetTX3ProofData(chainId string, txHash common.Hash) *types.TX3ProofData
func (*CrossChainHelper) GetTxFromMainChain ¶
func (cch *CrossChainHelper) GetTxFromMainChain(txHash common.Hash) *types.Transaction
func (*CrossChainHelper) JoinChildChain ¶
func (cch *CrossChainHelper) JoinChildChain(from common.Address, pubkey crypto.PubKey, chainId string, depositAmount *big.Int) error
JoinChildChain Join the Child Chain
func (*CrossChainHelper) ProcessPostPendingData ¶
func (cch *CrossChainHelper) ProcessPostPendingData(newPendingIdxBytes []byte, deleteChildChainIds []string)
func (*CrossChainHelper) ReadyForLaunchChildChain ¶
func (*CrossChainHelper) RevealVote ¶
func (*CrossChainHelper) SaveChildChainProofDataToMainChain ¶
func (cch *CrossChainHelper) SaveChildChainProofDataToMainChain(bs []byte) error
func (*CrossChainHelper) ValidateJoinChildChain ¶
func (cch *CrossChainHelper) ValidateJoinChildChain(from common.Address, consensusPubkey []byte, chainId string, depositAmount *big.Int, signature []byte) error
ValidateJoinChildChain check the criteria whether it meets the join child chain requirement
func (*CrossChainHelper) ValidateTX3ProofData ¶
func (cch *CrossChainHelper) ValidateTX3ProofData(proofData *types.TX3ProofData) error
func (*CrossChainHelper) ValidateTX4WithInMemTX3ProofData ¶
func (cch *CrossChainHelper) ValidateTX4WithInMemTX3ProofData(tx4 *types.Transaction, tx3ProofData *types.TX3ProofData) error
func (*CrossChainHelper) VerifyChildChainProofData ¶
func (cch *CrossChainHelper) VerifyChildChainProofData(bs []byte) error
verify the signature of validators who voted for the block most of the logic here is from 'VerifyHeader'
func (*CrossChainHelper) VoteNextEpoch ¶
func (*CrossChainHelper) WriteTX3ProofData ¶
func (cch *CrossChainHelper) WriteTX3ProofData(proofData *types.TX3ProofData) error
type InvalidArgs ¶
type InvalidArgs struct {
// contains filtered or unexported fields
}
func (InvalidArgs) Error ¶
func (invalid InvalidArgs) Error() string
Click to show internal directories.
Click to hide internal directories.