- Global Configs Seed
source set_env_vars.sh
./devops/exec/configStrategy.js --add-global-configs
# Note: For staging and production follow help- Activate Global Configs
source set_env_vars.sh
./devops/exec/configStrategy.js --activate-configs --chain-id 0 --group-id 0- Create all SAAS Owned DDB Tables - (shards, shard_by_tokens, and base_currencies)
source set_env_vars.sh
node executables/setup/origin/saasDdb.js- Create Tables
source set_env_vars.sh
node executables/setup/blockScanner/initialSetup.js --chainId 3 node executables/setup/blockScanner/addChain.js --chainId 3 --networkId 3 --blockShardCount 1 --transactionShardCount 1 --economyAddressShardCount 2 [Only DevOps] NOTE: Make sure you review SA_DEFAULT_ORIGIN_GAS_PRICE gas price from https://ethgasstation.info/txPoolReport.php, as dynamic gas price cron is not yet active.
- [Only Development] Add
127.0.0.1 ropsten.developmentost.comin hosts files
sudo vim /etc/hosts- Generate master internal funder address for this ENV
source set_env_vars.sh
node devops/exec/chainSetup.js --generate-master-internal-funder-address --chain-id 3- [Only Development] Get ETH funder private key
let address = '0x123___'; // master internal funder address
let rootPrefix = '.';
addressPrivateKeyCache = new (require(rootPrefix + '/lib/cacheManagement/shared/AddressPrivateKey'))({ address: address});
addressPrivateKeyCache.fetchDecryptedData().then(function (res) {console.log("ETH Owner(masterInternalFunder) PK: ", res.data.private_key_d)});NOTE: Copy the ETH funder private key for later use.
- [Only Development] Setup Origin GETH and fund necessary addresses.
source set_env_vars.sh
node tools/localSetup/origin/setupGeth.js --originChainId 3- [Only Development] Start Origin GETH with this script.
sh ~/openst-setup/bin/origin-3/origin-chain-3.sh- [Only DevOps] Fund master internal funder address (EXCEPT PRODUCTION MAIN ENV)
source set_env_vars.sh
node devops/exec/chainSetup.js --fund-master-internal-funder-address --chain-id 3 --eth-owner-private-key '0x0a___' --amount 10- Generate origin address and fund them.
source set_env_vars.sh
node devops/exec/chainSetup.js --generate-origin-addresses --chain-id 3- Insert Simple Token Details in Stake Currencies Mysql Table
source set_env_vars.sh
node executables/setup/origin/insertInStakeCurrencies.js --contractSymbol OST --contractName "Simple Token"- Insert Quote Currency Details in Quote Currencies Mysql Table
source set_env_vars.sh
node executables/setup/origin/insertInQuoteCurrencies.js --symbol USD --name "US Dollar" source set_env_vars.sh
node executables/setup/origin/insertInQuoteCurrencies.js --symbol EUR --name "Euro" source set_env_vars.sh
node executables/setup/origin/insertInQuoteCurrencies.js --symbol GBP --name "Great Britain Pound"- Setup Simple Token (EXCEPT PRODUCTION MAIN ENV)
source set_env_vars.sh
node devops/exec/chainSetup.js --setup-simple-token --chain-id 3 --eth-owner-private-key '0xabc___'NOTE: Copy the response from the script above and save somewhere offline.
- Update simple token contract details in stake currencies and insert in base currencies DDB table.
source set_env_vars.sh
node executables/setup/origin/saveStakeCurrencyDetails.js --contractSymbol OST --contractAddress '0xabc___'- Save simple token admin, owner and contract address in database.
source set_env_vars.sh
node executables/setup/origin/saveSimpleTokenAddresses.js --admin '0xabc___' --owner '0xabc___'- Insert USDC Details in Stake Currencies Mysql Table
source set_env_vars.sh
node executables/setup/origin/insertInStakeCurrencies.js --contractSymbol USDC --contractName "USD Coin"- Setup USDC Token (EXCEPT PRODUCTION MAIN ENV)
source set_env_vars.sh
node devops/exec/chainSetup.js --setup-usdc-token --chain-id 3 --eth-owner-private-key '0xabc___'NOTE: Copy the response from the script above and save somewhere offline.
- Mint sufficient USDC Tokens (EXCEPT PRODUCTION MAIN ENV)
source set_env_vars.sh
node executables/oneTimers/stableCoinStaking/mintUsdcToken.js --usdcTokenOwnerAddress "0xabc___" --usdcTokenOwnerPrivateKey "0xabc___" --usdcContractAddress "0xabc___" --usdcToMintInWei "200000000000000"- Save USDC token owner address in database.
source set_env_vars.sh
node executables/setup/origin/saveUsdcTokenAddresses.js --owner '0xabc___'- Update USDC token contract details in stake currencies and insert in base currencies DDB table.
source set_env_vars.sh
node executables/setup/origin/saveStakeCurrencyDetails.js --contractSymbol USDC --contractAddress '0xabc___'- Use ETH Owner Private Key, to run following command. Granter address gets ETH in this step [ONLY FOR SANDBOX].
source set_env_vars.sh
node executables/setup/origin/fundGranterAddress.js --ethOwnerPrivateKey '0xab___' --ethAmount 50- Use Simple token Owner Private Key, to run following command. Granter address gets OST in this step [ONLY FOR SANDBOX].
source set_env_vars.sh
node executables/setup/origin/fundGranterAddress.js --stakeCurrencySymbol 'OST' --stakeCurrencyOwnerPrivateKey '0x3d___' --stakeCurrencyAmount 1000000- Use USDC Owner Private Key, to run following command. Granter address gets USDC in this step [ONLY FOR SANDBOX].
source set_env_vars.sh
node executables/setup/origin/fundGranterAddress.js --stakeCurrencySymbol 'USDC' --stakeCurrencyOwnerPrivateKey '0x3d___' --stakeCurrencyAmount 1000000- Fund master internal funder with OSTs (EXCEPT PRODUCTION MAIN ENV)
- For non-development environment, use MyEtherWallet, to fund address with OST.
- Otherwise, run following script to fund chain owner with OSTs (pass ST Owner private key in parameter)
source set_env_vars.sh
node executables/setup/origin/fundMasterInternalFunderAddress.js --stOwnerPrivateKey '0xabc___'- Setup Origin Contracts
source set_env_vars.sh
node executables/setup/origin/contracts.js --originChainId 3- Verifier script for origin chain setup
- You can verify local chain setup and contract deployment using following scripts.
source set_env_vars.sh
node tools/verifiers/originChainSetup.js- [Only Development] Seed the cron processes which are unique in a sub-environment using this script.
source set_env_vars.sh
node tools/localSetup/subEnvSpecificCronSeeder.js- [Only Development] Seed the cron processes which are associated to origin chain using this script.
source set_env_vars.sh
node tools/localSetup/originChainSpecificCronSeeder.js> source set_env_vars.sh
> node
InsertRuleAbiKlass = require('./lib/setup/InsertRuleAbiIntoRulesTable.js');
new InsertRuleAbiKlass().perform().then(console.log).catch(console.log) source set_env_vars.sh
node executables/oneTimers/insertInDDBForOriginHighestBlock.js node executables/oneTimers/createOstInfraDatabase.js
node executables/oneTimers/createErrorLogsTable.js[Only Development] Create ost_analytics database and transaction_by_type_graph and transaction_by_type_graph table.
node executables/oneTimers/createOstAnalyticsDatabase.js
node executables/oneTimers/createTransactionByNameGraphTable.js
node executables/oneTimers/createTransactionByTypeGraphTable.js- Start Workflow router factory
source set_env_vars.sh
node executables/workflowFactory.js --cronProcessId 1- Run Origin Transaction Parser
source set_env_vars.sh
node executables/blockScanner/transactionParser.js --cronProcessId 8- Run Origin Block Parser
source set_env_vars.sh
node executables/blockScanner/blockParser.js --cronProcessId 7- Run Origin Finalizer
source set_env_vars.sh
node executables/blockScanner/finalizer.js --cronProcessId 9- Fund by master internal funder origin chain specific
source set_env_vars.sh
node executables/funding/byMasterInternalFunder/originChainSpecific.js --cronProcessId 10