{"id":21658781,"url":"https://github.com/OpenST/platform-api","last_synced_at":"2025-07-17T21:31:42.563Z","repository":{"id":56339858,"uuid":"161133088","full_name":"OpenST/platform-api","owner":"OpenST","description":"OpenST platform v1 API \u0026 Internal API Endpoints","archived":false,"fork":false,"pushed_at":"2020-11-13T13:10:06.000Z","size":10330,"stargazers_count":4,"open_issues_count":6,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-03-02T15:18:20.366Z","etag":null,"topics":["api","internal-api","openst","ost","saas-api"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OpenST.png","metadata":{"files":{"readme":"README-AUX-SETUP.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-12-10T07:14:41.000Z","updated_at":"2021-08-24T12:40:48.000Z","dependencies_parsed_at":"2022-08-15T17:00:14.414Z","dependency_job_id":null,"html_url":"https://github.com/OpenST/platform-api","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenST%2Fplatform-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenST%2Fplatform-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenST%2Fplatform-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenST%2Fplatform-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OpenST","download_url":"https://codeload.github.com/OpenST/platform-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226305022,"owners_count":17603729,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","internal-api","openst","ost","saas-api"],"created_at":"2024-11-25T09:29:48.939Z","updated_at":"2024-11-25T09:30:07.965Z","avatar_url":"https://github.com/OpenST.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# AUX CHAIN SETUP\n\n## Seed config strategy\n\n* AUX Configs Seed\n```bash\n    source set_env_vars.sh\n    ./devops/exec/configStrategy.js --add-aux-configs\n\n    # Note: For staging and production follow help\n```\n\n* Activate AUX Configs\n```bash\n    source set_env_vars.sh\n    ./devops/exec/configStrategy.js --activate-configs --chain-id 2000 --group-id 1\n```\n\n## Setup AUX Block Scanner and SAAS DDB\n\n* Create all SAAS Owned DDB Tables\n```bash\n    source set_env_vars.sh\n    node executables/setup/aux/saasDdb.js --auxChainId 2000 --userShardNoStr 1,2 --deviceShardNoStr 1,2 --sessionShardNoStr 1,2 --balanceShardNoStr 1,2 --recoveryOwnerAddressShardNoStr 1,2\n```\n    * All the parameters are mandatory parameters.\n\n\n* Create Shared Aux DDB Tables (To be run ONLY FOR THE FIRST AUX CHAIN BEING SETUP)\n```bash\n    source set_env_vars.sh\n    node executables/setup/blockScanner/initialSetup.js --chainId 2000\n```\n\n* Create Sharded Aux DDB Tables (Run the addChain service and pass all the necessary parameters):\n```bash\n    source set_env_vars.sh\n    node executables/setup/blockScanner/addChain.js --chainId 2000 --networkId 2000 --blockShardCount 1 --transactionShardCount 1 --economyAddressShardCount 2\n```\n    * Mandatory parameters: chainId, networkId\n    * Optional parameters (defaults to 1): blockShardCount, transactionShardCount, economyAddressShardCount\n\n\n## Auxiliary Chain Setup\n\n* Generate AUX addresses and Fund.\n```bash\n    source set_env_vars.sh\n    node devops/exec/chainSetup.js --generate-aux-addresses --chain-id 2000\n```\n\n* [Only Development] Setup Aux GETH and necessary addresses.\n```bash\n    source set_env_vars.sh\n    node tools/localSetup/aux/setupGeth.js --originChainId 3 --auxChainId 2000\n```\n\n* [Only Development] Start AUX GETH (with Zero Gas Price) with this script.\n```bash\n    sh ~/openst-setup/bin/aux-2000/aux-chain-zeroGas-2000.sh\n```\n\n* Add sealer address.  \n  NOTE: Use MyEtherWallet to export private key from keystore file. \n  Visit the following link [MyEtherWallet](https://vintage.myetherwallet.com/#view-wallet-info) and select the `Keystore / JSON File` option. \n  Upload the keystore file from `~/openst-setup/geth/aux-2000/keystore` folder. The unlock password is \n  `testtest`. Pass the address and privateKey (including 0x) in the command below.\n\nAnd add it to tables using following script.\n```bash\n    source set_env_vars.sh\n    node executables/setup/aux/addSealerAddress.js --auxChainId 2000 --sealerAddress '0xabc___' --sealerPrivateKey '0xabc___'\n```\n\n* Setup Aux Contracts\n```bash\n    source set_env_vars.sh\n    node executables/setup/aux/contracts.js --originChainId 3 --auxChainId 2000\n```\n\n* Verifier script for auxiliary chain setup\n    - You can verify local chain setup and contract deployment using following script.\n```bash\n    source set_env_vars.sh\n    node tools/verifiers/auxChainSetup.js --auxChainId 2000\n```\n\n* Mark simple token as active in stake currencies\n```bash\n   source set_env_vars.sh\n   node executables/setup/origin/activateStakeCurrency.js --stakeCurrencySymbol \"OST\"\n```\n\n* Mark USDC as active in stake currencies\n```bash\n   source set_env_vars.sh\n   node executables/setup/origin/activateStakeCurrency.js --stakeCurrencySymbol \"USDC\"\n```\n\n\n* [Only Development] Seed the cron processes which are associated to the aux chain using this script.\n```bash\n    source set_env_vars.sh\n    node tools/localSetup/auxChainSpecificCronSeeder.js\n```\n   \n## Run block-scanner crons and aggregator\n\n* Run Aggregator. This is done only to initialize the queue.\n```bash\n    source set_env_vars.sh\n    node executables/blockScanner/aggregator.js --cronProcessId 14\n```\n\n* Run Auxiliary Transaction Finalizer\n```bash\n    source set_env_vars.sh\n    node executables/blockScanner/balanceSettler.js --cronProcessId 26\n```\n\n* Run Auxiliary Transaction Parser\n```bash\n    source set_env_vars.sh\n    node executables/blockScanner/transactionParser.js --cronProcessId 12\n```\n\n* Run Auxiliary Block Parser\n```bash\n    source set_env_vars.sh\n    node executables/blockScanner/blockParser.js --cronProcessId 11\n```\n\n* Run Auxiliary Block Finalizer\n```bash\n    source set_env_vars.sh\n    node executables/blockScanner/finalizer.js --cronProcessId 13\n```\n\n\n## ST Prime Stake and Mint in Zero Gas\n\n//TODO: change amountToStake to amountToStakeInWei\n```bash\n    source set_env_vars.sh\n    \u003e node\n        // beneficiary -\u003e masterInternalFunderKind\n        // facilitator -\u003e masterInternalFunderKind\n        // stakerAddress -\u003e masterInternalFunderKind\n        // firstTimeMint -\u003e set this to 'true' if you are minting st prime for the first time [optional]\n        \n        params = {\n                stepKind: 'stPrimeStakeAndMintInit',\n                taskStatus: 'taskReadyToStart',\n                clientId: 0,\n                chainId: 3,\n                topic: 'workflow.stPrimeStakeAndMint',\n                requestParams: {\n                    stakerAddress: '0xb3bb6be32abfad59b647d5a40301084db2043f90', \n                    originChainId: 3, \n                    auxChainId: 2000, \n                    sourceChainId: 3,\n                    destinationChainId: 2000,\n                    facilitator: '0xb3bb6be32abfad59b647d5a40301084db2043f90', \n                    amountToStake: '1000000000000000000000000', \n                    beneficiary: '0xb3bb6be32abfad59b647d5a40301084db2043f90',\n                    firstTimeMint: true //[optional]\n                }\n        }\n        stPrimeRouterK = require('./lib/workflow/stakeAndMint/stPrime/Router')\n        stPrimeRouter = new stPrimeRouterK(params)\n   \n        stPrimeRouter.perform().then(console.log).catch(function(err){console.log('err', err)})\n```\n* [HELP ONLY TO KNOW HOW TO START THE STUCK WORKFLOW]\n```js\n        params = {\n              stepKind: '', //step kind of row from where it need to restart\n              taskStatus: 'taskReadyToStart',\n              clientId: 0,\n              chainId: 3,\n              topic: 'workflow.stPrimeStakeAndMint',\n              workflowId: , //Workflow id\n              currentStepId: //Id of table from where it need to restart\n          }\n```\n\n* Stop geth running at zero gas price \u0026 Start AUX GETH (With Non Zero Gas Price) with this script.\n```bash\n    sh ~/openst-setup/bin/aux-2000/aux-chain-2000.sh\n```\n\n## Run Aggregator\n```bash\n  source set_env_vars.sh\n  node executables/blockScanner/aggregator.js --cronProcessId 14\n```\n\n### Funding crons\n\n* Fund by sealer aux chain specific\n```bash\n    source set_env_vars.sh\n    node executables/funding/bySealer/auxChainSpecific.js --cronProcessId 16\n```\n\n* Fund by master internal funder aux chain specific chain addresses\n```bash\n    source set_env_vars.sh\n    node executables/funding/byMasterInternalFunder/auxChainSpecific/chainAddresses.js --cronProcessId 15\n```\n\n* Fund by master internal funder aux chain specific token funder addresses\n```bash\n    source set_env_vars.sh\n    node executables/funding/byMasterInternalFunder/auxChainSpecific/tokenFunderAddresses.js --cronProcessId 20\n```\n\n* Fund by master internal funder aux chain specific inter chain facilitator addresses on origin chain.\n```bash\n    source set_env_vars.sh\n    node executables/funding/byMasterInternalFunder/auxChainSpecific/interChainFacilitatorAddresses.js --cronProcessId 21\n```\n\n* Fund by token aux funder aux chain specific\n```bash\n    source set_env_vars.sh\n    node executables/funding/byTokenAuxFunder/auxChainSpecific.js --cronProcessId 17\n```\n\n### Start Crons\n* Start Aux Workflow router factory\n```bash\n    source set_env_vars.sh\n    node executables/auxWorkflowFactory.js --cronProcessId 24\n```\n* Start execute transaction cron process\n```bash\n    source set_env_vars.sh\n    node executables/executeTransaction.js --cronProcessId 22\n```\n\n### Start state root sync cron\n* Start origin to aux state root sync cron.\n```bash\n    source set_env_vars.sh\n    node executables/stateRootSync/originToAux.js --cronProcessId 28\n```\n\n* Start aux to origin state root sync cron.\n```bash\n    source set_env_vars.sh\n    node executables/stateRootSync/auxToOrigin.js --cronProcessId 29\n```\n\n### Update price points.\n```bash\n    source set_env_vars.sh\n    node executables/updatePricePoints.js --cronProcessId 18\n```\n\n```bash\n    source set_env_vars.sh\n    node executables/updatePricePoints.js --cronProcessId 19\n```\n\n### Start webhooks preprocessor.\n```bash\n    source set_env_vars.sh\n    node executables/webhook/preProcessor.js --cronProcessId 33\n```\n\n### Start webhooks processor.\n```bash\n    source set_env_vars.sh\n    node executables/webhook/processor.js --cronProcessId 34\n```\n\n### Start balance Verifier\n* Start balance verifier\n```bash\n    source set_env_vars.sh\n    node executables/balanceVerifier.js --cronProcessId 31\n```\n###### ALWAYS AT THE END\n### Open up config group for allocation\n```js\nlet ConfigGroupModel = require('./app/models/mysql/ConfigGroup');\nlet auxChainId = 2000;\nlet auxGroupId = 1;\n\nConfigGroupModel.markAsAvailableForAllocation(auxChainId, auxGroupId).then(console.log);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FOpenST%2Fplatform-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FOpenST%2Fplatform-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FOpenST%2Fplatform-api/lists"}