PlatON has implemented an L2 application chain based on PlatON, adopting the same consensus algorithm, virtual machine, and economic model as PlatON. The source code for this project is located at https://github.com/PlatONnetwork/AppChain-SDK.
PlatON has deployed a set of PlatON L2 application chains for testing. The test environment consists of 4 nodes with IP addresses 8.219.210.248, 8.222.253.224, 8.222.207.89, and 8.219.242.242. The browser address is http://8.219.177.143:8000/.
Users can develop and test contracts and dAPPs in the test environment, or they can set up their own nodes to join the test chain and perform performance verification. The method is as follows:
The operating system is Ubuntu 24.04 LTS. The download link is: https://app-chain.oss-ap-southeast-1.aliyuncs.com/testnetnode.tar.gz
cd scripts/binNavigate to the script directory../generate.sh --stakeamount 1000000000
Generate the private key required for the node. 1000000000 represents the number of tokens the node will stake.
After executing the generate.sh script, the following information will be displayed. Please provide the addresses corresponding to user address and checkpoint address to us to obtain test tokens.
generate keys success please contact the official team to ensure sufficient balance for both the user address:0x6f9f59826097D25f0D6F4d719805D1cF8ba7a07d and checkpoint address:0x1Df85FA030d2E00bA28EfA7115eF5dB88B14CcDD
- user address: Validator account address, requires obtaining PlatON testnet LAT and application chain test tokens (SIMAPP).
- checkpoint address: Account address for sending checkpoint transactions, requires obtaining PlatON testnet LAT.
- Switch to the project root directory.
./init.sh./start.sh
Before performing the staking operation, please ensure your node is fully synchronized to the latest block. Otherwise, penalties may be incurred during the staking operation.
- Check if the
config/envparameters are correct. The default configuration issued is consistent with the node. - Enter the
bindirectory. - Execute
./staking.sh staketo perform staking. If the balance is insufficient, please contact the official team. - Execute
./staking.sh validatorsto check if it has become a validator node. This usually takes some time. - Execute
./staking.sh unstaketo unstake. The node will exit the validator list. - Execute
./staking.sh validatorsto check if the node has exited the validator list. This usually takes some time.
cd scripts/bin./benchmark.sh gencontracttx 200000Generate 200000 ERC20 contract transfer transactions../benchmark.sh statusCheck if cache:200000 has been generated../benchmark.sh startcontracttxStart the stress test../benchmark.sh statusCheck if sent:200000 has been completed.
The block transaction status can be queried through the browser.
Users can build their own PlatON L2 application chain based on this source code. The following provides a setup using a compiled private chain configuration environment:
The operating system is Ubuntu 24.04 LTS (install ansible). The download link is: https://app-chain.oss-ap-southeast-1.aliyuncs.com/privatenetwork.tar.gz
cd scripts/binNavigate to the script directory../gensimapp.sh [IPS] [USERNAME] [PASSWORD]. For example, if the machines are 10.1.1.33, 10.1.1.34, 10.1.1.35, and the server account password is simapp, 123456, then the command is./gensimapp.sh gen 10.1.1.33,10.1.1.34,10.1.1.35 simapp 123456. The following files will be generated inscripts/config:- benchmarkenv: Environment variable configuration for stress testing, mainly RPC addresses and performance parameter configuration.
- l1checkpointsender.json: Keystore account file for sending checkpoint transactions to Layer1. Ensure it has sufficient balance.
- l1checkpointsender_password: Keystore password for
l1checkpointsender.json. - l2txsender.json: Account for sending system transactions on Layer2.
- l2txsender_password: Keystore password for
l2txsender.json. - simappenv: Environment variable configuration for application chain deployment.
After executing the gensimapp.sh script, the following information will be displayed. Please ensure the addresses corresponding to deploy address, initialize address, and checkpoint address have sufficient tokens.
generate keys success please contact the official team to ensure sufficient balance for both the deploy address:0x311F5F59B1170e095709eE8da4f6880d912946F3, initialize address:0x8CFF458f3d7cFF30943701979b336adFf42D2776 and checkpoint address:0xabEe1cCfb84853d954f8a005a1Becc18d37A86ec
- deploy address: Contract deployment account address, requires PlatON testnet LAT.
- initialize address: Contract initialization account address, requires PlatON testnet LAT.
- checkpoint address: Account address for sending checkpoint transactions, requires PlatON testnet LAT.
source scripts/config/simappenvApply environment variables.cd binSwitch to the application directory../simappclient deploytemplateDeploy contract template on Layer1../simappclient createnodeGenerate node configuration../simappclient deploychildchainDeploy Layer2 contract on Layer1../simappclient creategenesisCreate genesis file../simappclient createansibleCreate ansible directory../simappclient createansiblenodeCreate ansible node.cd scripts/output/ansibleSwitch to the ansible directory.ansible-playbook -i inventories/hosts.yml playbooks/deploy.ymlDeploy to target machines.ansible-playbook -i inventories/hosts.yml playbooks/command.yml --extra-vars "cmd=init"Initialize nodes.ansible-playbook -i inventories/hosts.yml playbooks/command.yml --extra-vars "cmd=start"Start nodes.
cd scripts/bin./benchmarkcluster.sh gencontracttx 200000Generate 200000 ERC20 contract transfer transactions../benchmarkcluster.sh statusCheck if cache:200000 has been generated../benchmarkcluster.sh startcontracttxStart the stress test../benchmarkcluster.sh report [startblock] [endblock] report.csvAfter the stress test ends, use the report command to generate stress test block data.