Skip to content

skalenetwork/helper-scripts

Repository files navigation

SKALE Helper bash scripts

Export the vars in .env into your shell: export $(egrep -v '^#' .env | xargs)

Deployment Options

Deploy SKALE Manager

Option 1: Deploy with Local Anvil Node

To deploy using a local Anvil node, set the RUN_ANVIL environment variable to true. This will automatically start a local Anvil node and use its private key for deployment.

Required environment variables:

  • RUN_ANVIL=true
  • MANAGER_TAG (tag for the SKALE Manager version)

Example:

MANAGER_TAG=<manager_tag> RUN_ANVIL=true bash deploy_manager.sh

Option 2: Deploy to a Custom Network

To deploy to a custom network, provide the following environment variables:

Required environment variables:

  • ETH_PRIVATE_KEY (Ethereum private key without the 0x prefix)
  • ENDPOINT (Ethereum RPC endpoint)
  • MANAGER_TAG (tag for the SKALE Manager version)
  • GAS_PRICE (optional, default: 10000000000)
  • NETWORK (optional, default: custom)
  • ETHERSCAN (optional, default: 1234)

Example:

ETH_PRIVATE_KEY=<your_private_key> MANAGER_TAG=<manager_tag> ENDPOINT=<rpc_endpoint> GAS_PRICE=<gas_price> NETWORK=<network_name> ETHERSCAN=<etherscan_api_key> bash deploy_manager.sh

Deploy IMA

Option 1: Deploy with Local Anvil Node

To deploy using a local Anvil node, set the RUN_ANVIL environment variable to true. This will automatically start a local Anvil node and use its private key for deployment.

Required environment variables:

  • RUN_ANVIL=true
  • IMA_TAG (tag for the IMA version)

Example:

IMA_TAG=<ima_tag> RUN_ANVIL=true bash deploy_ima.sh

Option 2: Deploy to a Custom Network

To deploy to a custom network, provide the following environment variables:

Required environment variables:

  • ETH_PRIVATE_KEY (Ethereum private key without the 0x prefix)
  • ENDPOINT (Ethereum RPC endpoint)
  • IMA_TAG (tag for the IMA version)
  • GAS_PRICE (optional, default: 10000000000)
  • NETWORK (optional, default: custom)
  • ETHERSCAN (optional, default: 1234)

Example:

ETH_PRIVATE_KEY=<your_private_key> IMA_TAG=<ima_tag> ENDPOINT=<rpc_endpoint> GAS_PRICE=<gas_price> NETWORK=<network_name> ETHERSCAN=<etherscan_api_key> bash deploy_ima.sh

Deploy Fair-Manager

Option 1: Deploy with Local Anvil Node

Run a local Anvil instance and deploy fair-manager contracts on it:

Required environment variables:

  • RUN_ANVIL=true
  • FAIR_TAG (tag for the Fair-Manager version)
  • CHAIN_NAME (name of the chain)
  • TARGET (skale-manager alias or address)
  • MAINNET_ENDPOINT (mainnet RPC endpoint)

Example:

RUN_ANVIL=true FAIR_TAG=0.0.1-develop.6 CHAIN_NAME=<chain_name> TARGET=<skale_manager_alias_or_address> MAINNET_ENDPOINT=<mainnet_endpoint> bash deploy_fair.sh

Option 2: Deploy to a Custom Network

Deploy fair-manager contracts to a custom network:

Required environment variables:

  • ETH_PRIVATE_KEY (Ethereum private key without the 0x prefix)
  • ENDPOINT (Fair Chain RPC endpoint)
  • FAIR_TAG (tag for the Fair-Manager version)
  • CHAIN_NAME (name of the chain)
  • TARGET (skale-manager alias or address)
  • MAINNET_ENDPOINT (mainnet RPC endpoint)
  • GAS_PRICE (optional, default: 10000000000)
  • NETWORK (optional, default: custom)
  • ETHERSCAN (optional, default: 1234)

Example:

ETH_PRIVATE_KEY=<your_private_key> ENDPOINT=<fair_chain_endpoint> FAIR_TAG=0.0.1-develop.6 CHAIN_NAME=<chain_name> TARGET=<skale_manager_alias_or_address> MAINNET_ENDPOINT=<mainnet_endpoint> bash deploy_fair.sh

ABI and address of the deployed contracts will be saved in contracts_data/fair.json file.

Deploy SKALE Allocator

Option 1: Deploy with Local Anvil Node

To deploy using a local Anvil node, set the RUN_ANVIL environment variable to true. This will automatically start a local Anvil node and use its private key for deployment.

Required environment variables:

  • RUN_ANVIL=true
  • ALLOCATOR_TAG (tag for the Allocator version)

Example:

ALLOCATOR_TAG=<allocator_tag> RUN_ANVIL=true bash deploy_allocator.sh

Option 2: Deploy to a Custom Network

To deploy to a custom network, provide the following environment variables:

Required environment variables:

  • ETH_PRIVATE_KEY (Ethereum private key without the 0x prefix)
  • ENDPOINT (Ethereum RPC endpoint)
  • ALLOCATOR_TAG (tag for the Allocator version)
  • GAS_PRICE (optional, default: 10000000000)
  • NETWORK (optional, default: custom)

Example:

ETH_PRIVATE_KEY=<your_private_key> ALLOCATOR_TAG=<allocator_tag> ENDPOINT=<rpc_endpoint> GAS_PRICE=<gas_price> NETWORK=<network_name> bash deploy_allocator.sh

Additional Scripts

Calculate Version

To calculate the version, use the following script:

Required environment variables:

  • BRANCH (branch name)
  • VERSION (base version)

Example:

BRANCH=<branch_name> VERSION=<base_version> ./helper-scripts/calculate_version.sh

Embedded Usage

Add helper-scripts to your repo

  1. Add git submodule to your repo
git submodule add -b develop https://github.com/skalenetwork/helper-scripts.git
git submodule init
  1. Update submodule later on
git submodule update --remote

Add submodules to your Github Actions build

You can use this package: https://github.com/marketplace/actions/checkout-submodules

Just add those lines to the pipeline:

steps:
- name: Checkout submodules
  uses: textbook/git-checkout-submodule-action@master
  with:
    remote: true

About

No description or website provided.

Topics

Resources

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 7