Skip to content

Commit

Permalink
feat: PRT-add-archive-header-indicator (#1477)
Browse files Browse the repository at this point in the history
* PRT-adding-errored-and-blocked-providers-to-headers

* changing log level from info to debug on spammy logs

* fixing protocol test

* removing remove extensions flow from the csm. managing it on rpcconsumer

* removing deprecated types

* adding new flag to determine is session degradation is allowed

* extension disabling flow is now on rpc consumer server which makes more sense.

* adding more info when failing to fetch pairing.

* fix test

* fix test

* adding comment

* register for pairing updates now requires chain id

* exposing spec id

* registering emergency tracker to all chains

* finalization consensus updater spec id

* spec id to pairing updater

* get pairing does not allow empty anymore.

* fix comment

* rename

* making error more robust

* a

* setting timeout for get pairing

* chaning log to warning and making it more clear

* retry on register pairing.

* robustness overload

* ..

* fixing spec for cosmoshub

* fixing grpc header issue on response.

* fix test

* lava debug

* adding extension node flag to determine if the provider used the extension node or not

* fixing name

* fixing small bugs

* lint

* fix bash

* fix bash

* fix bash

* fix bash

* fix bash

* fix bash

* fix bash

* fix bash

* fix bash

* fix bash

* fix bash

* fix bash

* fix bash

* fix bash

* fix bash

* fix bash

* fix bash

* fix bash

* fix bash

* fix bash

* fix bash

* fix bash

* fix bash

* fix bash

* fix bash

* fix bash

* add trailer info

* add trailer field

* 2.1.1 version increase

* set trailer only when router key is not default value.

* Thanks Yarom... its all your fault.

* Yarom again, specs fix

* fixing this because you know who :)

* just a small change for Yaroms
  • Loading branch information
ranlavanet authored Jun 6, 2024
1 parent 0c35e16 commit 1e9387d
Show file tree
Hide file tree
Showing 34 changed files with 68 additions and 52 deletions.
9 changes: 7 additions & 2 deletions protocol/chainlib/chain_router.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import (
"github.com/lavanet/lava/protocol/common"
"github.com/lavanet/lava/protocol/lavasession"
"github.com/lavanet/lava/utils"
"google.golang.org/grpc"
"google.golang.org/grpc/metadata"
)

type chainRouterEntry struct {
Expand All @@ -30,13 +32,16 @@ type chainRouterImpl struct {
chainProxyRouter map[lavasession.RouterKey][]chainRouterEntry
}

func (cri *chainRouterImpl) getChainProxySupporting(addon string, extensions []string) (ChainProxy, error) {
func (cri *chainRouterImpl) getChainProxySupporting(ctx context.Context, addon string, extensions []string) (ChainProxy, error) {
cri.lock.RLock()
defer cri.lock.RUnlock()
wantedRouterKey := lavasession.NewRouterKey(extensions)
if chainProxyEntries, ok := cri.chainProxyRouter[wantedRouterKey]; ok {
for _, chainRouterEntry := range chainProxyEntries {
if chainRouterEntry.isSupporting(addon) {
if wantedRouterKey != lavasession.GetEmptyRouterKey() { // add trailer only when router key is not default (||)
grpc.SetTrailer(ctx, metadata.Pairs(RPCProviderNodeExtension, string(wantedRouterKey)))
}
return chainRouterEntry.ChainProxy, nil
}
if debug {
Expand All @@ -59,7 +64,7 @@ func (cri chainRouterImpl) ExtensionsSupported(extensions []string) bool {
func (cri chainRouterImpl) SendNodeMsg(ctx context.Context, ch chan interface{}, chainMessage ChainMessageForSend, extensions []string) (relayReply *RelayReplyWrapper, subscriptionID string, relayReplyServer *rpcclient.ClientSubscription, proxyUrl common.NodeUrl, chainId string, err error) {
// add the parsed addon from the apiCollection
addon := chainMessage.GetApiCollection().CollectionData.AddOn
selectedChainProxy, err := cri.getChainProxySupporting(addon, extensions)
selectedChainProxy, err := cri.getChainProxySupporting(ctx, addon, extensions)
if err != nil {
return nil, "", nil, common.NodeUrl{}, "", err
}
Expand Down
1 change: 1 addition & 0 deletions protocol/chainlib/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const (
refererMatchString = "refererMatch"
relayMsgLogMaxChars = 200
RPCProviderNodeAddressHash = "Lava-Provider-Node-Address-Hash"
RPCProviderNodeExtension = "Lava-Provider-Node-Extension"
)

var InvalidResponses = []string{"null", "", "nil", "undefined"}
Expand Down
1 change: 1 addition & 0 deletions protocol/common/endpoints.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ type RelayResult struct {
ConflictHandler ConflictHandlerInterface
StatusCode int
Quorum int
ProviderTrailer metadata.MD // the provider trailer attached to the request. used to transfer useful information (which is not signed so shouldn't be trusted completely).
}

func (rr *RelayResult) GetReplyServer() *pairingtypes.Relayer_RelaySubscribeClient {
Expand Down
4 changes: 4 additions & 0 deletions protocol/lavasession/router_key.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,7 @@ func NewRouterKey(extensions []string) RouterKey {
sort.Strings(uniqueExtensionsSlice)
return RouterKey(sep + strings.Join(uniqueExtensionsSlice, sep) + sep)
}

func GetEmptyRouterKey() RouterKey {
return NewRouterKey([]string{})
}
16 changes: 12 additions & 4 deletions protocol/rpcconsumer/rpcconsumer_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -767,9 +767,8 @@ func (rpccs *RPCConsumerServer) relayInner(ctx context.Context, singleConsumerSe
metadataAdd := metadata.New(map[string]string{common.IP_FORWARDING_HEADER_NAME: consumerToken})
connectCtx = metadata.NewOutgoingContext(connectCtx, metadataAdd)
defer connectCtxCancel()
var trailer metadata.MD
reply, err = endpointClient.Relay(connectCtx, relayRequest, grpc.Trailer(&trailer))
statuses := trailer.Get(common.StatusCodeMetadataKey)
reply, err = endpointClient.Relay(connectCtx, relayRequest, grpc.Trailer(&relayResult.ProviderTrailer))
statuses := relayResult.ProviderTrailer.Get(common.StatusCodeMetadataKey)
if len(statuses) > 0 {
codeNum, errStatus := strconv.Atoi(statuses[0])
if errStatus != nil {
Expand All @@ -779,7 +778,7 @@ func (rpccs *RPCConsumerServer) relayInner(ctx context.Context, singleConsumerSe
}
relayLatency = time.Since(relaySentTime)
if rpccs.debugRelays {
providerNodeHashes := trailer.Get(chainlib.RPCProviderNodeAddressHash)
providerNodeHashes := relayResult.ProviderTrailer.Get(chainlib.RPCProviderNodeAddressHash)
attributes := []utils.Attribute{
utils.LogAttr("GUID", ctx),
utils.LogAttr("addon", relayRequest.RelayData.Addon),
Expand Down Expand Up @@ -1060,6 +1059,15 @@ func (rpccs *RPCConsumerServer) appendHeadersToRelayResult(ctx context.Context,
})
}

// fetch trailer information from the provider by using the provider trailer field.
providerNodeExtensions := relayResult.ProviderTrailer.Get(chainlib.RPCProviderNodeExtension)
if len(providerNodeExtensions) > 0 {
extensionMD := pairingtypes.Metadata{
Name: chainlib.RPCProviderNodeExtension,
Value: providerNodeExtensions[0],
}
relayResult.Reply.Metadata = append(relayResult.Reply.Metadata, extensionMD)
}
relayResult.Reply.Metadata = append(relayResult.Reply.Metadata, metadataReply...)
}

Expand Down
2 changes: 1 addition & 1 deletion scripts/pre_setups/init_aptos_only_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ rm $LOGS_DIR/*.log
killall screen
screen -wipe
GASPRICE="0.000000001ulava"
lavad tx gov submit-legacy-proposal spec-add ./cookbook/specs/ibc.json,./cookbook/specs/cosmoswasm.json,./cookbook/specs/tendermint.json,./cookbook/specs/cosmossdk.json,./cookbook/specs/cosmossdk_45.json,./cookbook/specs/cosmossdk_full.json,./cookbook/specs/ethereum.json,./cookbook/specs/cosmoshub.json,./cookbook/specs/lava.json,./cookbook/specs/osmosis.json,./cookbook/specs/fantom.json,./cookbook/specs/celo.json,./cookbook/specs/optimism.json,./cookbook/specs/arbitrum.json,./cookbook/specs/starknet.json,./cookbook/specs/aptos.json,./cookbook/specs/juno.json,./cookbook/specs/polygon.json,./cookbook/specs/evmos.json,./cookbook/specs/base.json,./cookbook/specs/canto.json,./cookbook/specs/sui.json,./cookbook/specs/solana.json,./cookbook/specs/bsc.json,./cookbook/specs/axelar.json,./cookbook/specs/avalanche.json,./cookbook/specs/fvm.json --lava-dev-test -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE &
lavad tx gov submit-legacy-proposal spec-add ./cookbook/specs/ibc.json,./cookbook/specs/cosmoswasm.json,./cookbook/specs/tendermint.json,./cookbook/specs/cosmossdk.json,./cookbook/specs/cosmossdk_45.json,./cookbook/specs/cosmossdk_full.json,./cookbook/specs/ethermint.json,./cookbook/specs/ethereum.json,./cookbook/specs/cosmoshub.json,./cookbook/specs/lava.json,./cookbook/specs/osmosis.json,./cookbook/specs/fantom.json,./cookbook/specs/celo.json,./cookbook/specs/optimism.json,./cookbook/specs/arbitrum.json,./cookbook/specs/starknet.json,./cookbook/specs/aptos.json,./cookbook/specs/juno.json,./cookbook/specs/polygon.json,./cookbook/specs/evmos.json,./cookbook/specs/base.json,./cookbook/specs/canto.json,./cookbook/specs/sui.json,./cookbook/specs/solana.json,./cookbook/specs/bsc.json,./cookbook/specs/axelar.json,./cookbook/specs/avalanche.json,./cookbook/specs/fvm.json --lava-dev-test -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE &
wait_next_block
lavad tx gov vote 1 yes -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE
wait_next_block
Expand Down
2 changes: 1 addition & 1 deletion scripts/pre_setups/init_arbitrum_only_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ rm $LOGS_DIR/*.log
killall screen
screen -wipe
GASPRICE="0.000000001ulava"
lavad tx gov submit-legacy-proposal spec-add ./cookbook/specs/ibc.json,./cookbook/specs/cosmoswasm.json,./cookbook/specs/tendermint.json,./cookbook/specs/cosmossdk.json,./cookbook/specs/cosmossdk_45.json,./cookbook/specs/cosmossdk_full.json,./cookbook/specs/ethereum.json,./cookbook/specs/cosmoshub.json,./cookbook/specs/lava.json,./cookbook/specs/osmosis.json,./cookbook/specs/fantom.json,./cookbook/specs/celo.json,./cookbook/specs/optimism.json,./cookbook/specs/arbitrum.json,./cookbook/specs/starknet.json,./cookbook/specs/aptos.json,./cookbook/specs/juno.json,./cookbook/specs/polygon.json,./cookbook/specs/evmos.json,./cookbook/specs/base.json,./cookbook/specs/canto.json,./cookbook/specs/sui.json,./cookbook/specs/solana.json,./cookbook/specs/bsc.json,./cookbook/specs/axelar.json,./cookbook/specs/avalanche.json,./cookbook/specs/fvm.json --lava-dev-test -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE &
lavad tx gov submit-legacy-proposal spec-add ./cookbook/specs/ibc.json,./cookbook/specs/cosmoswasm.json,./cookbook/specs/tendermint.json,./cookbook/specs/cosmossdk.json,./cookbook/specs/cosmossdk_45.json,./cookbook/specs/cosmossdk_full.json,./cookbook/specs/ethermint.json,./cookbook/specs/ethereum.json,./cookbook/specs/cosmoshub.json,./cookbook/specs/lava.json,./cookbook/specs/osmosis.json,./cookbook/specs/fantom.json,./cookbook/specs/celo.json,./cookbook/specs/optimism.json,./cookbook/specs/arbitrum.json,./cookbook/specs/starknet.json,./cookbook/specs/aptos.json,./cookbook/specs/juno.json,./cookbook/specs/polygon.json,./cookbook/specs/evmos.json,./cookbook/specs/base.json,./cookbook/specs/canto.json,./cookbook/specs/sui.json,./cookbook/specs/solana.json,./cookbook/specs/bsc.json,./cookbook/specs/axelar.json,./cookbook/specs/avalanche.json,./cookbook/specs/fvm.json --lava-dev-test -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE &
wait_next_block
lavad tx gov vote 1 yes -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE
wait_next_block
Expand Down
2 changes: 1 addition & 1 deletion scripts/pre_setups/init_avalanch_only.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ rm $LOGS_DIR/*.log
killall screen
screen -wipe
GASPRICE="0.000000001ulava"
lavad tx gov submit-legacy-proposal spec-add ./cookbook/specs/ibc.json,./cookbook/specs/cosmoswasm.json,./cookbook/specs/tendermint.json,./cookbook/specs/cosmossdk.json,./cookbook/specs/cosmossdk_45.json,./cookbook/specs/cosmossdk_full.json,./cookbook/specs/ethereum.json,./cookbook/specs/cosmoshub.json,./cookbook/specs/lava.json,./cookbook/specs/osmosis.json,./cookbook/specs/fantom.json,./cookbook/specs/celo.json,./cookbook/specs/optimism.json,./cookbook/specs/arbitrum.json,./cookbook/specs/starknet.json,./cookbook/specs/aptos.json,./cookbook/specs/juno.json,./cookbook/specs/polygon.json,./cookbook/specs/evmos.json,./cookbook/specs/base.json,./cookbook/specs/canto.json,./cookbook/specs/sui.json,./cookbook/specs/solana.json,./cookbook/specs/bsc.json,./cookbook/specs/axelar.json,./cookbook/specs/avalanche.json,./cookbook/specs/fvm.json --lava-dev-test -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE &
lavad tx gov submit-legacy-proposal spec-add ./cookbook/specs/ibc.json,./cookbook/specs/cosmoswasm.json,./cookbook/specs/tendermint.json,./cookbook/specs/cosmossdk.json,./cookbook/specs/cosmossdk_45.json,./cookbook/specs/cosmossdk_full.json,./cookbook/specs/ethermint.json,./cookbook/specs/ethereum.json,./cookbook/specs/cosmoshub.json,./cookbook/specs/lava.json,./cookbook/specs/osmosis.json,./cookbook/specs/fantom.json,./cookbook/specs/celo.json,./cookbook/specs/optimism.json,./cookbook/specs/arbitrum.json,./cookbook/specs/starknet.json,./cookbook/specs/aptos.json,./cookbook/specs/juno.json,./cookbook/specs/polygon.json,./cookbook/specs/evmos.json,./cookbook/specs/base.json,./cookbook/specs/canto.json,./cookbook/specs/sui.json,./cookbook/specs/solana.json,./cookbook/specs/bsc.json,./cookbook/specs/axelar.json,./cookbook/specs/avalanche.json,./cookbook/specs/fvm.json --lava-dev-test -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE &
lavad tx gov vote 1 yes -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE

lavad tx gov submit-legacy-proposal plans-add ./cookbook/plans/test_plans/default.json -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE
Expand Down
2 changes: 1 addition & 1 deletion scripts/pre_setups/init_axelar_only_with_node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ sleep 5
wait_for_lava_node_to_start

GASPRICE="0.000000001ulava"
lavad tx gov submit-legacy-proposal spec-add ./cookbook/specs/ibc.json,./cookbook/specs/cosmoswasm.json,./cookbook/specs/tendermint.json,./cookbook/specs/cosmossdk.json,./cookbook/specs/cosmossdk_45.json,./cookbook/specs/cosmossdk_full.json,./cookbook/specs/ethereum.json,./cookbook/specs/cosmoshub.json,./cookbook/specs/lava.json,./cookbook/specs/osmosis.json,./cookbook/specs/fantom.json,./cookbook/specs/celo.json,./cookbook/specs/optimism.json,./cookbook/specs/arbitrum.json,./cookbook/specs/starknet.json,./cookbook/specs/aptos.json,./cookbook/specs/juno.json,./cookbook/specs/polygon.json,./cookbook/specs/evmos.json,./cookbook/specs/base.json,./cookbook/specs/canto.json,./cookbook/specs/sui.json,./cookbook/specs/solana.json,./cookbook/specs/bsc.json,./cookbook/specs/axelar.json,./cookbook/specs/avalanche.json,./cookbook/specs/fvm.json --lava-dev-test -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE &
lavad tx gov submit-legacy-proposal spec-add ./cookbook/specs/ibc.json,./cookbook/specs/cosmoswasm.json,./cookbook/specs/tendermint.json,./cookbook/specs/cosmossdk.json,./cookbook/specs/cosmossdk_45.json,./cookbook/specs/cosmossdk_full.json,./cookbook/specs/ethermint.json,./cookbook/specs/ethereum.json,./cookbook/specs/cosmoshub.json,./cookbook/specs/lava.json,./cookbook/specs/osmosis.json,./cookbook/specs/fantom.json,./cookbook/specs/celo.json,./cookbook/specs/optimism.json,./cookbook/specs/arbitrum.json,./cookbook/specs/starknet.json,./cookbook/specs/aptos.json,./cookbook/specs/juno.json,./cookbook/specs/polygon.json,./cookbook/specs/evmos.json,./cookbook/specs/base.json,./cookbook/specs/canto.json,./cookbook/specs/sui.json,./cookbook/specs/solana.json,./cookbook/specs/bsc.json,./cookbook/specs/axelar.json,./cookbook/specs/avalanche.json,./cookbook/specs/fvm.json --lava-dev-test -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE &
wait_next_block
wait_next_block
lavad tx gov vote 1 yes -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE
Expand Down
2 changes: 1 addition & 1 deletion scripts/pre_setups/init_canto_only_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ rm $LOGS_DIR/*.log
killall screen
screen -wipe
GASPRICE="0.000000001ulava"
lavad tx gov submit-legacy-proposal spec-add ./cookbook/specs/ibc.json,./cookbook/specs/cosmoswasm.json,./cookbook/specs/tendermint.json,./cookbook/specs/cosmossdk.json,./cookbook/specs/cosmossdk_45.json,./cookbook/specs/cosmossdk_full.json,./cookbook/specs/ethereum.json,./cookbook/specs/cosmoshub.json,./cookbook/specs/lava.json,./cookbook/specs/osmosis.json,./cookbook/specs/fantom.json,./cookbook/specs/celo.json,./cookbook/specs/optimism.json,./cookbook/specs/arbitrum.json,./cookbook/specs/starknet.json,./cookbook/specs/aptos.json,./cookbook/specs/juno.json,./cookbook/specs/polygon.json,./cookbook/specs/evmos.json,./cookbook/specs/base.json,./cookbook/specs/canto.json,./cookbook/specs/sui.json,./cookbook/specs/solana.json,./cookbook/specs/bsc.json,./cookbook/specs/axelar.json,./cookbook/specs/avalanche.json,./cookbook/specs/fvm.json --lava-dev-test -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE &
lavad tx gov submit-legacy-proposal spec-add ./cookbook/specs/ibc.json,./cookbook/specs/cosmoswasm.json,./cookbook/specs/tendermint.json,./cookbook/specs/cosmossdk.json,./cookbook/specs/cosmossdk_45.json,./cookbook/specs/cosmossdk_full.json,./cookbook/specs/ethermint.json,./cookbook/specs/ethereum.json,./cookbook/specs/cosmoshub.json,./cookbook/specs/lava.json,./cookbook/specs/osmosis.json,./cookbook/specs/fantom.json,./cookbook/specs/celo.json,./cookbook/specs/optimism.json,./cookbook/specs/arbitrum.json,./cookbook/specs/starknet.json,./cookbook/specs/aptos.json,./cookbook/specs/juno.json,./cookbook/specs/polygon.json,./cookbook/specs/evmos.json,./cookbook/specs/base.json,./cookbook/specs/canto.json,./cookbook/specs/sui.json,./cookbook/specs/solana.json,./cookbook/specs/bsc.json,./cookbook/specs/axelar.json,./cookbook/specs/avalanche.json,./cookbook/specs/fvm.json --lava-dev-test -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE &
wait_next_block
lavad tx gov vote 1 yes -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE
sleep 4
Expand Down
21 changes: 8 additions & 13 deletions scripts/pre_setups/init_eth_archive_mix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,13 @@ killall screen
screen -wipe

GASPRICE="0.000000001ulava"
PROVIDER1_LISTENER="127.0.0.1:2221"
PROVIDER2_LISTENER="127.0.0.1:2222"
PROVIDER3_LISTENER="127.0.0.1:2223"
PROVIDER4_LISTENER="127.0.0.1:2224"
PROVIDER5_LISTENER="127.0.0.1:2225"
if [ $# -eq 0 ]; then
lavad tx gov submit-legacy-proposal spec-add ./cookbook/specs/ibc.json,./cookbook/specs/cosmoswasm.json,./cookbook/specs/tendermint.json,./cookbook/specs/cosmossdk.json,./cookbook/specs/cosmossdk_45.json,./cookbook/specs/cosmossdk_full.json,./cookbook/specs/ethereum.json,./cookbook/specs/cosmoshub.json,./cookbook/specs/lava.json,./cookbook/specs/osmosis.json,./cookbook/specs/fantom.json,./cookbook/specs/celo.json,./cookbook/specs/optimism.json,./cookbook/specs/arbitrum.json,./cookbook/specs/starknet.json,./cookbook/specs/aptos.json,./cookbook/specs/juno.json,./cookbook/specs/polygon.json,./cookbook/specs/evmos.json,./cookbook/specs/base.json,./cookbook/specs/canto.json,./cookbook/specs/sui.json,./cookbook/specs/solana.json,./cookbook/specs/bsc.json,./cookbook/specs/axelar.json,./cookbook/specs/avalanche.json,./cookbook/specs/fvm.json --lava-dev-test -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE &
lavad tx gov submit-legacy-proposal spec-add ./cookbook/specs/ibc.json,./cookbook/specs/cosmoswasm.json,./cookbook/specs/tendermint.json,./cookbook/specs/cosmossdk.json,./cookbook/specs/cosmossdk_45.json,./cookbook/specs/cosmossdk_full.json,./cookbook/specs/ethermint.json,./cookbook/specs/ethereum.json,./cookbook/specs/cosmoshub.json,./cookbook/specs/lava.json,./cookbook/specs/osmosis.json,./cookbook/specs/fantom.json,./cookbook/specs/celo.json,./cookbook/specs/optimism.json,./cookbook/specs/arbitrum.json,./cookbook/specs/starknet.json,./cookbook/specs/aptos.json,./cookbook/specs/juno.json,./cookbook/specs/polygon.json,./cookbook/specs/evmos.json,./cookbook/specs/base.json,./cookbook/specs/canto.json,./cookbook/specs/sui.json,./cookbook/specs/solana.json,./cookbook/specs/bsc.json,./cookbook/specs/axelar.json,./cookbook/specs/avalanche.json,./cookbook/specs/fvm.json --lava-dev-test -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE &
wait_next_block
wait_next_block
lavad tx gov vote 1 yes -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE
Expand All @@ -29,12 +34,6 @@ if [ $# -eq 0 ]; then
CLIENTSTAKE="500000000000ulava"
PROVIDERSTAKE="500000000000ulava"

PROVIDER1_LISTENER="127.0.0.1:2221"
PROVIDER2_LISTENER="127.0.0.1:2222"
PROVIDER3_LISTENER="127.0.0.1:2223"
PROVIDER4_LISTENER="127.0.0.1:2224"
PROVIDER5_LISTENER="127.0.0.1:2225"

lavad tx subscription buy DefaultPlan $(lavad keys show user1 -a) -y --from user1 --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE
wait_next_block

Expand All @@ -47,14 +46,10 @@ if [ $# -eq 0 ]; then
lavad tx pairing stake-provider "ETH1" $PROVIDERSTAKE "$PROVIDER5_LISTENER,1,archive" 1 $(operator_address) -y --from servicer5 --provider-moniker "servicer5" --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE --delegate-commission 50 --delegate-limit $PROVIDERSTAKE

sleep_until_next_epoch
lavad q pairing effective-policy ETH1 --from user1
lavad q pairing effective-policy ETH1 $(lavad keys show user1 -a)
fi


screen -d -m -S provider1 bash -c "source ~/.bashrc; lavap rpcprovider \
$PROVIDER1_LISTENER ETH1 jsonrpc '$ETH_RPC_WS' \
$EXTRA_PROVIDER_FLAGS --geolocation 1 --log_level debug --from servicer1 --chain-id lava 2>&1 | tee $LOGS_DIR/PROVIDER1.log" && sleep 0.25

i=1
screen -d -m -S provider$i bash -c "source ~/.bashrc; lavap rpcprovider \
127.0.0.1:222$i ETH1 jsonrpc '$ETH_RPC_WS' \
Expand All @@ -76,5 +71,5 @@ $EXTRA_PORTAL_FLAGS --cache-be "127.0.0.1:7778" --geolocation 1 --debug-relays -
echo "--- setting up screens done ---"
screen -ls

sleep 2
sleep 5
lavad test rpcconsumer http://127.0.0.1:3333 ETH1 jsonrpc --chain-id lava
Loading

0 comments on commit 1e9387d

Please sign in to comment.