-
Make sure you have docker instance on your machine
- run
yarn
to install all dependencies - To run geth in docker please follow next steps:
- Install Docker
yarn run geth
- to run build & run docker containeryarn run geth:stop
- to stop docker containeryarn run geth:reset
- to reset geth data folder (be carefull it will destroy all private node data)- Please notice that mining take a lot of hardware recources
- Default exposed ports 8585 - rpc, 8546 - websockets
- geth runs with 12 addresses if you need more please change ./geth/docker/genesis.2key.json ./geth/docker/key.prv ./geth/docker/passwords and ./geth/docker/geth.bash
- First time run takes some time to generate all neccessary data
- run
-
Go to the root of the project and run following command in terminal:
yarn run geth:start
-
After that, you should see in terminal that blocks are being mined (1 minute approximately waiting time until that)
-
Make sure you have file named accountsConfig.json inside configurationFiles folder.
-
The file configurationFiles/accountsConfig.json should be in the following format:
{
"address" : "",
"mnemonic" : "",
"mnemonic_private" : "",
"infura_id" : "" //Note that infura_id field can be empty if not deploying through infura nodes
}
- This file should be filled with the address you want to use for tests, and the corresponding mnemonic
- Once you have this file, you should run:
yarn run test:one 2key-protocol/test/sendETH.spec.ts
to get some test ether on local network - After this step you are ready to deploy contracts locally and run all the test over them
yarn run deploy --migrate dev-local,plasma-test-local --reset
./test-funnel.sh
will run all the necessary tests
- Make sure to install all external dependencies
curl https://raw.githubusercontent.com/Tenderly/tenderly-cli/master/scripts/install-macos.sh | sudo sh
- Make sure you have installed on your machine executable from command line : https://github.com/git-chglog/git-chglog
- Make sure you have did all the steps related to the first title ("How to test contracts")
- Make sure your configurationFiles/accountsConfig.json file contains address with enough ether for deploy
- in case you're deploying with Ledger wallet, this file must be present but will be ignored
- Make sure all 3 branches are up-to-date.
- root
- 2key-protocol/src
- 2key-protocol/dist
- Make sure you have .env-slack file. For content for this file ask @Nikola (necessary because deployment sends slack alerts)
- Run the command
yarn run deploy network1,network2,...,networkN --reset
- Make sure you have did all the steps related to the first title ("How to test contracts")
- Make sure your configurationFiles/accountsConfig.json file contains address with enough ether for deploy
- Update 2 cases:
- Patch of protocol only
yarn run deploy update
- Patch of smart contracts (with or without protocol changes)
yarn run deploy <network> update
where network is the network to which contracts are deployed and you want to patch them
- Patch of protocol only
- edit
ContractDeploymentWhiteList.json
--migrate
- runs truffle migrate --network with generatingcontracts.ts
abi interface and without running tests--test
- runs tests from2key-protocol/test/index.spec.ts
--generate
- runs generatingcontracts.ts
abi interface from existing artifacts inbuild/contracts
--archive
- archive currentbuild/contracts
to2key-protocol/src/contracts.tar.gz
--extract
- extract from2key-protocol/src/contracts.tar.gz
tobuild/contracts
-
check tenderly
tenderly whoami
-
make sure we're on required branches and pull everything:
cd 2key-protocol/src -> git pull & git reset HEAD --hard
cd 2key-protocol/dist -> git pull & git reset HEAD --hard
Same in root git pull & git reset HEAD --hard
-
run the migrations:
yarn run deploy private.staging-ledger,public.staging-ledger --reset
-
if pushing npm failed, you will need to continue the following manually:
cd 2key-protocol/dist
npm publish --tag staging (if you're on staging) OR npm publish --tag prod (if you're on prod)
cd ... (back to root)
tenderly push --tag 1.2.0-staging (or whatever git tag was created during the deploy)
- push everything
cd 2key-protocol/src -> git add .
git commit -m 'sync-submodules'
git push -u
cd 2key-protocol/dist -> git add .
git commit -m 'sync-submodules'
git push -u
Same in root -> git add .
git commit -m 'sync-submodules'
git push -u
- in case tenderly push didn't succeed:
rm -rf build
yarn run deploy --extract
tenderly push --tag 1.2.0-staging