For development purposes, it is convenient to set up a local Ethereum client with a group of connected peers. A note-taken walkthrough set up local T network covers the entire process including setting up a local Ethereum client, deploying T contracts and configuring T peers.
Additionally, to start a client we need to provide configuration options. It is
required to create a config file under
/configs for each client. You can also
overwrite the existing config file by passing supported parameters. For simple
installation using a config file please refer to the
./scripts/install.sh needs to be run only once and it will:
install yarn dependencies across the projects
unlock ethereum accounts
build a client
For more info please refer to
Usage: ENV_VAR(S) ./scripts/install.sh \ --network <network> \ --tbtc-path <tbtc-path> \ --threshold-network-path <threshold-network-path> \ --skip-deployment \ --skip-client-build Environment variables: KEEP_ETHEREUM_PASSWORD: The password to unlock local Ethereum accounts to set up delegations. Required only for 'local' network. Default value is 'password' Optional line arguments: --network: Ethereum network for keep-core client(s). Available networks and settings are specified in the 'hardhat.config.ts' --tbtc-path: 'Local' tbtc project's path. 'tbtc' is cloned to a temporary directory upon installation if the path is not provided --threshold-network-path: 'Local' threshold network project's path. 'threshold-network/solidity-contracts' is cloned to a temporary directory upon installation if the path is not provided --skip-deployment: This option skips all the contracts deployment. Default is false --skip-client-build: Should execute contracts part only. Client installation will not be executed
./scripts/initialize.sh has to be run for each client instance you wish to
--stake-owner <address> is not set, then it will prompt you to select a
configuration file that will be used to fetch the stake owner’s address from.
Default setup assumes that the staking provider, operator, beneficiary, and the
authorizer all have the same addresses as the stake owner. Only the
has to be unique for the default setup. The default stake amount is
tokens. The default authorization amount is the minimum authorization amount.
Ex. if you need to initialize a network with 3 clients using the default setup, then this script needs to be run 3 times with a different selected config file like so:
./scripts/initialize.sh Select client config file: 1) config.toml <-- 2) config1.toml 3) config2.toml
./scripts/initialize.sh Select client config file: 1) config.toml 2) config1.toml <-- 3) config2.toml
./scripts/initialize.sh Select client config file: 1) config.toml 2) config1.toml 3) config2.toml <--
./scripts/initialize.sh script will:
mint & approve
increase authorization for
register operator for
For more info please refer to
Usage: ./scripts/initialize.sh \ --network <network> \ --stake-owner <stake owner address> \ --staking-provider <staking provider address> \ --operator <operator address> \ --beneficiary <beneficiary address> \ --authorizer <authorizer address> \ --stake-amount <stake amount> \ --authorization-amount <authorization amount> Optional line arguments: --network: Ethereum network for keep-core client. Available networks and settings are specified in the 'hardhat.config.ts' --stake-owner: Stake owner address --staking-provider: Staking provider address --operator: Operator address --beneficiary: Staking beneficiary address --authorizer: Staking authorizer address --stake-amount: Stake amount --authorization-amount: Authorization amount
./scripts/initialize.sh now you can
./scripts/start.sh to start a client. It will prompt you to chose from the
available config files (that should match the one chosen for
./scripts/initialize.sh) and the log level.
./scripts/start.sh Select client config file: 1) config.toml <-- 2) config1.toml 3) config2.toml 1 Select log level [info]: 1) info 2) debug 3) custom...
./scripts/start.sh Select client config file: 1) config.toml 2) config1.toml <-- 3) config2.toml 2 Select log level [info]: 1) info 2) debug 3) custom...
./scripts/start.sh Select client config file: 1) config.toml 2) config1.toml 3) config2.toml <-- 3 Select log level [info]: 1) info 2) debug 3) custom...
Please refer to
./scripts/start.sh --help for more info
./scripts/start.sh --help Usage: ENV_VAR(S) ./scripts/start.sh --config-dir <path-to-configuration-files> Environment variables: KEEP_ETHEREUM_PASSWORD: Ethereum account password. Required only for 'local' network. Default value is 'password' Command line arguments: --config-dir: Path to a client configuration files
There are two primary languages in the T code right now:
Go code largely adheres to community practices where they have been decided. Divergences and additional tidbits are listed in the Go Guidelines document.
The fastest and easiest way to have a local Ethereum testent is to use Hardhat.
Navigate to one of the projects
You can deploy contracts executing
yarn deploy or run tests against the local