diff --git a/.dockerignore b/.dockerignore index fc12c0c09..3974f0f56 100644 --- a/.dockerignore +++ b/.dockerignore @@ -7,3 +7,4 @@ Jenkinsfile target hooks **/target +checkpoint.toml \ No newline at end of file diff --git a/.github/workflows/Fn_Check.yml b/.github/workflows/Fn_Check.yml new file mode 100644 index 000000000..cfd527920 --- /dev/null +++ b/.github/workflows/Fn_Check.yml @@ -0,0 +1,46 @@ +name: FN_CHECK +on: + push: + branches: + - main + - add-fn-ckeck + pull_request: + branches: + - main +env: + CARGO_TERM_COLOR: always +jobs: + build: + strategy: + matrix: + platform: [scalable] + runs-on: ${{ matrix.platform }} + steps: + - uses: actions/checkout@v3 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + components: rustfmt + - name: Prepare key + shell: bash + run: | + tar -C ~/.ssh -zcf key.tar.gz ./ + + - name: Build rust base image + shell: bash + run: | + make ci_build_binary_rust_base + + - name: Build debug_env image and Start + shell: bash + run: | + docker build -t findorad:debug_env -f container/Dockerfile-debug-env . + docker run -d --rm --network host --name findorad-debug-env findorad:debug_env + sleep 120 + + - name: Run fn_check + shell: bash + run: | + docker exec findorad-debug-env /platform/tools/fn_check.sh + docker rm -f findorad-debug-env diff --git a/.github/workflows/WasmCat.yml b/.github/workflows/WasmCat.yml index 0daa65028..c851fa764 100644 --- a/.github/workflows/WasmCat.yml +++ b/.github/workflows/WasmCat.yml @@ -2,7 +2,8 @@ name: Wasm Building And Pushing on: push: branches: - - '**' + - main + - develop tags: - '*-release' diff --git a/container/Dockerfile-debug-env b/container/Dockerfile-debug-env new file mode 100644 index 000000000..5687d26cc --- /dev/null +++ b/container/Dockerfile-debug-env @@ -0,0 +1,20 @@ +FROM binary-rust-base +ENV WORK_DIR /platform +ENV WASM_DIR /tmp/wasm-js-bindings +ENV VERGEN_SHA_EXTERN release_build +ENV PATH=$PATH:/root/.cargo/bin/ + +COPY . $WORK_DIR +WORKDIR $WORK_DIR + +RUN apt-get install -y procps + +RUN rustup toolchain install stable && \ + rustup component add clippy --toolchain stable && \ + rustup component add rustfmt + +RUN mkdir -p /root/.cargo/bin/ && make debug_env + +RUN printf "./tools/devnet/startnodes.sh\ntail -f /tmp/findora/devnet/node0/consensus.log" > docker_debug_env.sh +RUN chmod +x docker_debug_env.sh +CMD ["sh","-c","./docker_debug_env.sh"] diff --git a/tools/devnet/startnodes.sh b/tools/devnet/startnodes.sh index 01e0600a8..a35667c48 100755 --- a/tools/devnet/startnodes.sh +++ b/tools/devnet/startnodes.sh @@ -18,7 +18,7 @@ if [ -z "$Node" ] || ([ ! -z "$Node" ] && [ "$Node" = "$node" ]); then TD_NODE_SELF_ADDR=$SelfAddr \ RUST_LOG=$ABCI_LOG_LEVEL \ LEDGER_DIR=$DEVNET/$node/abci \ - ENABLE_LEDGER_SERVICE=true \ + ENABLE_QUERY_SERVICE=true \ ENABLE_ETH_API_SERVICE=true \ abcid $DEVNET/$node >> $DEVNET/$node/abcid.log 2>&1 & fi diff --git a/tools/fn_check.sh b/tools/fn_check.sh new file mode 100755 index 000000000..6397ef12e --- /dev/null +++ b/tools/fn_check.sh @@ -0,0 +1,57 @@ +#! /bin/bash +set -e + +echo "Set Faucet Mnemonic" +echo "zoo nerve assault talk depend approve mercy surge bicycle ridge dismiss satoshi boring opera next fat cinnamon valley office actor above spray alcohol giant" > /tmp/Faucet_Mnemonic +fn setup -O /tmp/Faucet_Mnemonic -S http://localhost + +echo "Init network" +stt init +sleep 15 + +echo "1. transfer" +fn transfer -n 1000000 -t WJZKo8_BwLMeSz3h7jYdfjjBZlJiRdhUXkqgUVzReE0= + +echo "2. confidential-amount transfer" +fn transfer -n 1000000 -t WJZKo8_BwLMeSz3h7jYdfjjBZlJiRdhUXkqgUVzReE0= --confidential-amount + +echo "3. confidential-type transfer" +fn transfer -n 1000000 -t WJZKo8_BwLMeSz3h7jYdfjjBZlJiRdhUXkqgUVzReE0= --confidential-type + +echo "4. confidential-amount and confidential-type transfer" +fn transfer -n 1000000 -t WJZKo8_BwLMeSz3h7jYdfjjBZlJiRdhUXkqgUVzReE0= --confidential-amount --confidential-type + +echo "5. transfer-batch" +echo -e "WJZKo8_BwLMeSz3h7jYdfjjBZlJiRdhUXkqgUVzReE0=\nevNR_3Jk8lSMSSHNdkk3d8Lq2peHicpKl0-_Wf2clfo=\nEGrwne7CoB6c3NgydG_CBmQFBL-27Shd6_cZ68ktOR8=" > /tmp/batch_list +fn transfer-batch -n 1000000 -t /tmp/batch_list + +echo "6. Create Asset" +fn asset --create --memo TTT --decimal 6 --code VG9rZW4wMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDBUVFQ= --transferable +sleep 30 + +echo "7. Issue Asset" +fn asset --issue --code VG9rZW4wMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDBUVFQ= --amount 8000000 +sleep 30 + +echo "8. Asset transfer" +fn transfer -n 1000000 -t WJZKo8_BwLMeSz3h7jYdfjjBZlJiRdhUXkqgUVzReE0= --asset VG9rZW4wMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDBUVFQ= +fn transfer -n 1000000 -t WJZKo8_BwLMeSz3h7jYdfjjBZlJiRdhUXkqgUVzReE0= --confidential-amount --asset VG9rZW4wMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDBUVFQ= +fn transfer -n 1000000 -t WJZKo8_BwLMeSz3h7jYdfjjBZlJiRdhUXkqgUVzReE0= --confidential-type --asset VG9rZW4wMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDBUVFQ= +fn transfer -n 1000000 -t WJZKo8_BwLMeSz3h7jYdfjjBZlJiRdhUXkqgUVzReE0= --confidential-amount --confidential-type --asset VG9rZW4wMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDBUVFQ= + +echo "9. Stake" +fn delegate -n 1000000 --validator 611C922247C3BE7EA13455B191B6EFD909F10196 +sleep 30 + +echo "10. Claim rewards" +fn claim + +echo "11. Unstake" +fn undelegate -n 900000 --validator 611C922247C3BE7EA13455B191B6EFD909F10196 + +echo "12. UTXO to EVM" +fn contract-deposit -a 0xE89441fDD60b473fBaC19F6DBcee7e7D61Bd99e6 -n 1000000 +sleep 30 + +echo "13. EVM to UTXO" +fn contract-withdraw -n 900000 -e "abuse plug bench require oval youth spike country ten pudding power hedgehog"