Documentation
¶
Index ¶
- Constants
- Variables
- func ConnectToDHT(ctx context.Context, h host.Host, dht *p2p.BlobstreamDHT, target peer.AddrInfo) error
- func HandleNetworkError(t *testing.T, network *BlobstreamNetwork, err error, expectError bool)
- type BlobstreamNetwork
- func (network BlobstreamNetwork) DeleteAll() error
- func (network BlobstreamNetwork) DeployBlobstreamContract() error
- func (network BlobstreamNetwork) ExecCommand(service Service, command []string) error
- func (network BlobstreamNetwork) GetCurrentDataCommitmentWindow(ctx context.Context) (uint64, error)
- func (network BlobstreamNetwork) GetDataCommitmentConfirm(_ctx context.Context, dht *p2p.BlobstreamDHT, nonce uint64, evmAddr string) (*blobstreamtypes.DataCommitmentConfirm, error)
- func (network BlobstreamNetwork) GetDataCommitmentConfirmByHeight(_ctx context.Context, dht *p2p.BlobstreamDHT, height uint64, evmAddr string) (*blobstreamtypes.DataCommitmentConfirm, error)
- func (network BlobstreamNetwork) GetLatestAttestationNonce(_ctx context.Context) (uint64, error)
- func (network BlobstreamNetwork) GetLatestDeployedBlobstreamContract(_ctx context.Context) (*blobstreamwrapper.Wrappers, error)
- func (network BlobstreamNetwork) GetLatestDeployedBlobstreamContractWithCustomTimeout(_ctx context.Context, timeout time.Duration) (*blobstreamwrapper.Wrappers, error)
- func (network BlobstreamNetwork) GetLatestValset(ctx context.Context) (*types.Valset, error)
- func (network BlobstreamNetwork) GetValsetConfirm(_ctx context.Context, dht *p2p.BlobstreamDHT, nonce uint64, evmAddr string) (*blobstreamtypes.ValsetConfirm, error)
- func (network BlobstreamNetwork) GetValsetContainingVals(_ctx context.Context, number int) (*types.Valset, error)
- func (network BlobstreamNetwork) KillAll() error
- func (network BlobstreamNetwork) PrintLogs()
- func (network BlobstreamNetwork) Start(service Service) error
- func (network BlobstreamNetwork) StartAll() error
- func (network BlobstreamNetwork) StartBase() error
- func (network BlobstreamNetwork) StartMinimal() error
- func (network BlobstreamNetwork) StartMultiple(services ...Service) error
- func (network BlobstreamNetwork) Stop(service Service) error
- func (network BlobstreamNetwork) StopAll() error
- func (network BlobstreamNetwork) StopMultiple(services ...Service) error
- func (network BlobstreamNetwork) UpdateDataCommitmentWindow(ctx context.Context, newWindow uint64) error
- func (network BlobstreamNetwork) WaitForBlock(_ctx context.Context, height int64) error
- func (network BlobstreamNetwork) WaitForBlockWithCustomTimeout(_ctx context.Context, height int64, timeout time.Duration) error
- func (network BlobstreamNetwork) WaitForEventNonce(ctx context.Context, bridge *blobstreamwrapper.Wrappers, n uint64) error
- func (network BlobstreamNetwork) WaitForNodeToStart(_ctx context.Context, rpcAddr string) error
- func (network BlobstreamNetwork) WaitForOrchestratorToStart(_ctx context.Context, dht *p2p.BlobstreamDHT, evmAddr string) (uint64, uint64, error)
- func (network BlobstreamNetwork) WaitForRelayerToStart(_ctx context.Context, bridge *blobstreamwrapper.Wrappers) error
- func (network BlobstreamNetwork) WasAttestationSigned(_ctx context.Context, dht *p2p.BlobstreamDHT, nonce uint64, evmAddress string) (bool, error)
- type Service
Constants ¶
const ( CORE0 = "core0" CORE0ACCOUNTADDRESS = "celestia198gj5ges3xayhmrtp4wzrjc2wqu2qtz0kavyg2" CORE0EVMADDRESS = "0x966e6f22781EF6a6A82BBB4DB3df8E225DfD9488" COREOORCH = "core0-orch" CORE1 = "core1" CORE1ACCOUNTADDRESS = "celestia1nmu3r37v7lcx0lr68h9v4vr4m20tqkrwt97wej" CORE1EVMADDRESS = "0x91DEd26b5f38B065FC0204c7929Da1b2A21877Ad" CORE1ORCH = "core1-orch" CORE2 = "core2" CORE2ACCOUNTADDRESS = "celestia1p236k88sk7tdqgsw539jclmy44vn9m4lk8kqgd" CORE2EVMADDRESS = "0x3d22f0C38251ebdBE92e14BBF1bd2067F1C3b7D7" CORE2ORCH = "core2-orch" CORE3 = "core3" CORE3ACCOUNTADDRESS = "celestia1d47nxy65684ptn3l8j7dwf5tx3qe5xjcl2qrdj" CORE3EVMADDRESS = "0x3EE99606625E740D8b29C8570d855Eb387F3c790" CORE3ORCH = "core3-orch" DEPLOYER = "deployer" RELAYER = "relayer" GANACHE = "ganache" )
const TRUE = "true"
Variables ¶
var BOOTSTRAPPERS = []string{"/ip4/127.0.0.1/tcp/30000/p2p/12D3KooWBSMasWzRSRKXREhediFUwABNZwzJbkZcYz5rYr9Zdmfn"}
var ErrNetworkStopped = errors.New("network is stopping")
Functions ¶
func ConnectToDHT ¶
func HandleNetworkError ¶
func HandleNetworkError(t *testing.T, network *BlobstreamNetwork, err error, expectError bool)
Types ¶
type BlobstreamNetwork ¶
type BlobstreamNetwork struct { ComposePaths []string Identifier string Instance *testcontainers.LocalDockerCompose EVMRPC string TendermintRPC string CelestiaGRPC string P2PAddr string EncCfg encoding.Config Logger tmlog.Logger // contains filtered or unexported fields }
func NewBlobstreamNetwork ¶
func NewBlobstreamNetwork() (*BlobstreamNetwork, error)
func (BlobstreamNetwork) DeleteAll ¶
func (network BlobstreamNetwork) DeleteAll() error
DeleteAll deletes the containers, network and everything related to the cluster.
func (BlobstreamNetwork) DeployBlobstreamContract ¶
func (network BlobstreamNetwork) DeployBlobstreamContract() error
DeployBlobstreamContract uses the Deployer service to deploy a new Blobstream contract based on the existing running network. If no Celestia-app nor ganache is started, it creates them automatically.
func (BlobstreamNetwork) ExecCommand ¶
func (network BlobstreamNetwork) ExecCommand(service Service, command []string) error
func (BlobstreamNetwork) GetCurrentDataCommitmentWindow ¶
func (network BlobstreamNetwork) GetCurrentDataCommitmentWindow(ctx context.Context) (uint64, error)
func (BlobstreamNetwork) GetDataCommitmentConfirm ¶
func (network BlobstreamNetwork) GetDataCommitmentConfirm( _ctx context.Context, dht *p2p.BlobstreamDHT, nonce uint64, evmAddr string, ) (*blobstreamtypes.DataCommitmentConfirm, error)
GetDataCommitmentConfirm Returns the data commitment confirm for nonce `nonce` signed by orchestrator whose EVM address is `evmAddr`.
func (BlobstreamNetwork) GetDataCommitmentConfirmByHeight ¶
func (network BlobstreamNetwork) GetDataCommitmentConfirmByHeight( _ctx context.Context, dht *p2p.BlobstreamDHT, height uint64, evmAddr string, ) (*blobstreamtypes.DataCommitmentConfirm, error)
GetDataCommitmentConfirmByHeight Returns the data commitment confirm that commits to height `height` signed by orchestrator whose EVM address is `evmAddr`.
func (BlobstreamNetwork) GetLatestAttestationNonce ¶
func (network BlobstreamNetwork) GetLatestAttestationNonce(_ctx context.Context) (uint64, error)
GetLatestAttestationNonce Returns the latest attestation nonce.
func (BlobstreamNetwork) GetLatestDeployedBlobstreamContract ¶
func (network BlobstreamNetwork) GetLatestDeployedBlobstreamContract(_ctx context.Context) (*blobstreamwrapper.Wrappers, error)
func (BlobstreamNetwork) GetLatestDeployedBlobstreamContractWithCustomTimeout ¶
func (network BlobstreamNetwork) GetLatestDeployedBlobstreamContractWithCustomTimeout( _ctx context.Context, timeout time.Duration, ) (*blobstreamwrapper.Wrappers, error)
func (BlobstreamNetwork) GetLatestValset ¶
func (BlobstreamNetwork) GetValsetConfirm ¶
func (network BlobstreamNetwork) GetValsetConfirm( _ctx context.Context, dht *p2p.BlobstreamDHT, nonce uint64, evmAddr string, ) (*blobstreamtypes.ValsetConfirm, error)
GetValsetConfirm Returns the valset confirm for nonce `nonce` signed by orchestrator whose EVM address is `evmAddr`.
func (BlobstreamNetwork) GetValsetContainingVals ¶
func (network BlobstreamNetwork) GetValsetContainingVals(_ctx context.Context, number int) (*types.Valset, error)
GetValsetContainingVals Gets the last valset that contains a certain number of validator. This is used after enabling orchestrators not to sign unless they belong to some valset. Thus, any nonce after the returned valset should be signed by all orchestrators.
func (BlobstreamNetwork) KillAll ¶
func (network BlobstreamNetwork) KillAll() error
KillAll kills all the containers.
func (BlobstreamNetwork) PrintLogs ¶
func (network BlobstreamNetwork) PrintLogs()
func (BlobstreamNetwork) Start ¶
func (network BlobstreamNetwork) Start(service Service) error
Start starts a service from the `Service` enum. Make sure to call `Stop`, in the end, to release the resources.
func (BlobstreamNetwork) StartAll ¶
func (network BlobstreamNetwork) StartAll() error
StartAll starts the whole Blobstream cluster with multiple validators, orchestrators and a relayer Make sure to release the resources after finishing by calling the `StopAll()` method.
func (BlobstreamNetwork) StartBase ¶
func (network BlobstreamNetwork) StartBase() error
StartBase starts the very minimal component to have a network. It consists of starting `core0` as it is the genesis validator, and the docker network will be created along with it, allowing more containers to join it.
func (BlobstreamNetwork) StartMinimal ¶
func (network BlobstreamNetwork) StartMinimal() error
StartMinimal starts a network containing: 1 validator, 1 orchestrator, 1 relayer and a ganache instance.
func (BlobstreamNetwork) StartMultiple ¶
func (network BlobstreamNetwork) StartMultiple(services ...Service) error
StartMultiple start multiple services. Make sure to call `Stop`, in the end, to release the resources.
func (BlobstreamNetwork) Stop ¶
func (network BlobstreamNetwork) Stop(service Service) error
func (BlobstreamNetwork) StopAll ¶
func (network BlobstreamNetwork) StopAll() error
StopAll stops the network and leaves the containers created. This allows to resume execution from the point where they stopped.
func (BlobstreamNetwork) StopMultiple ¶
func (network BlobstreamNetwork) StopMultiple(services ...Service) error
StopMultiple start multiple services. Make sure to call `Stop` or `StopMultiple`, in the end, to release the resources.
func (BlobstreamNetwork) UpdateDataCommitmentWindow ¶
func (network BlobstreamNetwork) UpdateDataCommitmentWindow(ctx context.Context, newWindow uint64) error
func (BlobstreamNetwork) WaitForBlock ¶
func (network BlobstreamNetwork) WaitForBlock(_ctx context.Context, height int64) error
func (BlobstreamNetwork) WaitForBlockWithCustomTimeout ¶
func (BlobstreamNetwork) WaitForEventNonce ¶
func (network BlobstreamNetwork) WaitForEventNonce(ctx context.Context, bridge *blobstreamwrapper.Wrappers, n uint64) error
func (BlobstreamNetwork) WaitForNodeToStart ¶
func (network BlobstreamNetwork) WaitForNodeToStart(_ctx context.Context, rpcAddr string) error
func (BlobstreamNetwork) WaitForOrchestratorToStart ¶
func (network BlobstreamNetwork) WaitForOrchestratorToStart(_ctx context.Context, dht *p2p.BlobstreamDHT, evmAddr string) (uint64, uint64, error)
WaitForOrchestratorToStart waits for the orchestrator having the evm address `evmAddr` to sign the first data commitment (could be upgraded to get any signature, either valset or data commitment, and for any nonce, but would require adding a new method to the querier. Don't think it is worth it now as the number of valsets that will be signed is trivial and reaching 0 would be in no time). Returns the height and the nonce of some attestation that the orchestrator signed.
func (BlobstreamNetwork) WaitForRelayerToStart ¶
func (network BlobstreamNetwork) WaitForRelayerToStart(_ctx context.Context, bridge *blobstreamwrapper.Wrappers) error
func (BlobstreamNetwork) WasAttestationSigned ¶
func (network BlobstreamNetwork) WasAttestationSigned( _ctx context.Context, dht *p2p.BlobstreamDHT, nonce uint64, evmAddress string, ) (bool, error)
WasAttestationSigned Returns true if the attestation confirm exist.