integration

package
v4.2.8-alpha Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 1, 2023 License: AGPL-3.0 Imports: 6 Imported by: 1

README

Test Insructions

Setup

  • Clone stack-orchestrator, ipld-eth-db go-ethereum repositories.

  • Checkout v4 release in ipld-eth-db repo.

    # In ipld-eth-db repo.
    git checkout v4.2.1-alpha
    
  • Checkout v4 release in go-ethereum repo.

    # In go-ethereum repo.
    git checkout v1.10.23-statediff-4.2.0-alpha
    
  • Checkout working commit in stack-orchestrator repo.

    # In stack-orchestrator repo.
    git checkout f2fd766f5400fcb9eb47b50675d2e3b1f2753702
    

Run

  • Run unit tests:

    # In ipld-eth-server root directory.
    ./scripts/run_unit_test.sh
    
  • Run integration tests:

    • In stack-orchestrator repo, create config file:

      cd helper-scripts
      
      ./create-config.sh
      

      A config.sh will be created in the root directory.

    • Update/Edit the generated config file with:

      #!/bin/bash
      
      # Path to ipld-eth-server repo.
      vulcanize_ipld_eth_db=~/ipld-eth-db/
      
      # Path to go-ethereum repo.
      vulcanize_go_ethereum=~/go-ethereum/
      
      # Path to ipld-eth-server repo.
      vulcanize_ipld_eth_server=~/ipld-eth-server/
      
      # Path to test contract.
      vulcanize_test_contract=~/ipld-eth-server/test/contract
      
      genesis_file_path='start-up-files/go-ethereum/genesis.json'
      db_write=true
      eth_forward_eth_calls=false
      eth_proxy_on_error=false
      eth_http_path="go-ethereum:8545"
      
    • Run stack-orchestrator:

      # In stack-orchestrator root directory.
      cd helper-scripts
      
      ./wrapper.sh \
      -e docker \
      -d ../docker/local/docker-compose-db-sharding.yml \
      -d ../docker/local/docker-compose-go-ethereum.yml \
      -d ../docker/local/docker-compose-ipld-eth-server.yml \
      -d ../docker/local/docker-compose-contract.yml \
      -v remove \
      -p ../config.sh
      
    • Run test:

      # In ipld-eth-server root directory.
      ./scripts/run_integration_test.sh
      
    • Update stack-orchestrator config.sh file:

      #!/bin/bash
      
      # Path to go-ethereum repo.
      vulcanize_go_ethereum=~/go-ethereum/
      
      # Path to ipld-eth-server repo.
      vulcanize_ipld_eth_server=~/ipld-eth-server/
      
      # Path to test contract.
      vulcanize_test_contract=~/ipld-eth-server/test/contract
      
      genesis_file_path='start-up-files/go-ethereum/genesis.json'
      db_write=false
      eth_forward_eth_calls=true
      eth_proxy_on_error=false
      eth_http_path="go-ethereum:8545"
      
    • Stop the stack-orchestrator and start again using the same command

    • Run integration tests for direct proxy fall-through of eth_calls:

      ./scripts/run_integration_test_forward_eth_calls.sh
      

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearWatchedAddresses

func ClearWatchedAddresses(gethRPCClient *rpc.Client) error

Types

type ContractDeployed

type ContractDeployed struct {
	Address         string `json:"address"`
	TransactionHash string `json:"txHash"`
	BlockNumber     int    `json:"blockNumber"`
	BlockHash       string `json:"blockHash"`
}

func Create2Contract

func Create2Contract(contractName string, salt string) (*ContractDeployed, error)

func DeployContract

func DeployContract() (*ContractDeployed, error)

func DeploySLVContract

func DeploySLVContract() (*ContractDeployed, error)

type ContractDestroyed

type ContractDestroyed struct {
	BlockNumber int64 `json:"blockNumber"`
}

func DestroyContract

func DestroyContract(addr string) (*ContractDestroyed, error)

func DestroySLVContract

func DestroySLVContract(addr string) (*ContractDestroyed, error)

type CountIncremented

type CountIncremented struct {
	BlockNumber int64 `json:"blockNumber"`
}

func IncrementCount

func IncrementCount(addr string, count string) (*CountIncremented, error)

type StorageKey

type StorageKey struct {
	Key string `json:"key"`
}

func GetStorageSlotKey

func GetStorageSlotKey(contract string, label string) (*StorageKey, error)

type Tx

type Tx struct {
	From            string   `json:"from"`
	To              string   `json:"to"`
	Value           *big.Int `json:"value"`
	TransactionHash string   `json:"txHash"`
	BlockNumber     int      `json:"blockNumber"`
	BlockHash       string   `json:"blockHash"`
}

func SendEth

func SendEth(to string, value string) (*Tx, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL