2020-07-01 16:29:09 +00:00
|
|
|
package testkit
|
2020-06-30 22:02:01 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/filecoin-project/go-address"
|
|
|
|
"github.com/filecoin-project/lotus/genesis"
|
|
|
|
"github.com/filecoin-project/lotus/node/modules/dtypes"
|
|
|
|
"github.com/libp2p/go-libp2p-core/peer"
|
|
|
|
"github.com/testground/sdk-go/sync"
|
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
2020-07-01 16:29:09 +00:00
|
|
|
GenesisTopic = sync.NewTopic("genesis", &GenesisMsg{})
|
|
|
|
BalanceTopic = sync.NewTopic("balance", &InitialBalanceMsg{})
|
|
|
|
PresealTopic = sync.NewTopic("preseal", &PresealMsg{})
|
|
|
|
ClientsAddrsTopic = sync.NewTopic("clients_addrs", &peer.AddrInfo{})
|
|
|
|
MinersAddrsTopic = sync.NewTopic("miners_addrs", &MinerAddressesMsg{})
|
|
|
|
PubsubTracerTopic = sync.NewTopic("pubsub_tracer", &PubsubTracerMsg{})
|
|
|
|
DrandConfigTopic = sync.NewTopic("drand_config", &DrandRuntimeInfo{})
|
2020-06-30 22:02:01 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
2020-07-01 16:29:09 +00:00
|
|
|
StateReady = sync.State("ready")
|
|
|
|
StateDone = sync.State("done")
|
|
|
|
StateStopMining = sync.State("stop-mining")
|
|
|
|
StateMinerPickSeqNum = sync.State("miner-pick-seq-num")
|
2020-06-30 22:02:01 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type InitialBalanceMsg struct {
|
|
|
|
Addr address.Address
|
|
|
|
Balance int
|
|
|
|
}
|
|
|
|
|
|
|
|
type PresealMsg struct {
|
|
|
|
Miner genesis.Miner
|
|
|
|
Seqno int64
|
|
|
|
}
|
|
|
|
|
|
|
|
type GenesisMsg struct {
|
|
|
|
Genesis []byte
|
|
|
|
Bootstrapper []byte
|
|
|
|
}
|
|
|
|
|
|
|
|
type MinerAddressesMsg struct {
|
|
|
|
PeerAddr peer.AddrInfo
|
|
|
|
ActorAddr address.Address
|
|
|
|
}
|
|
|
|
|
|
|
|
type PubsubTracerMsg struct {
|
|
|
|
Multiaddr string
|
|
|
|
}
|
|
|
|
|
|
|
|
type DrandRuntimeInfo struct {
|
|
|
|
Config dtypes.DrandConfig
|
|
|
|
GossipBootstrap dtypes.DrandBootstrap
|
|
|
|
}
|