Solidity development on a tablet

Steps to setup blockchain development on OnePlus Pad tablet

  • Order OnePlus Pad, wait for the delivery, unpack the tablet, recognize that you don’t have a proper charger, order it and now let’s dive further.

  • Connect Bluetooth devices that might help: Keyboard, Mouse, etc.

Keyboard + mouse
Keyboard + mouse
  • Download and install Termux. You will have a complete Linux terminal after launching the app.

  • Let’s install & launch Ubuntu terminal:

    pkg up
    pkg install proot-distro
    proot-distro install ubuntu
    proot-distro login ubuntu
    
  • Now when you have Ubuntu shell let’s install foundry

    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
    source "$HOME/.cargo/env"
    curl -L https://foundry.paradigm.xyz | bash
    source .bashrc
    foundryup
    
  • Now you have Foundry installed, let’s dive deeper and install remix-ide and it’s dependencies.

    apt-get install python3-pip
    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh
    exit
    proot-distro login ubuntu
    nvm install 20
    npm i -g yarn
    yarn global add @remix-project/remixd nx
    git clone https://github.com/ethereum/remix-project.git
    cd remix-project
    PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true yarn
    yarn run build:production # takes a few minutes
    python3 -m http.server 8081 -d "dist/apps/remix-ide"
    

    The last command serves local remix deployment which is available from Chrome

  • Now open new Termux session by swapping from left to right and clone some Foundry repo to test

    proot-distro login ubuntu
    git clone git@github.com:SunWeb3Sec/DeFiHackLabs.git
    
  • Now you can run forge test to test the setup

    cd DeFiHackLabs
    forge test --contracts ./src/test/2024-04/Yield_exp.sol -vvv
    
  • Next command will share local folder to self-hosted remix-ide

    remixd -s /root/DeFiHackLabs/ --remix-ide http://127.0.0.1:8081
    
remixd
remixd
self-hosted remix-ide
self-hosted remix-ide
  • After clicking on Start coding you will see this page where you need to choose “connect to localhost” in the dropdown

connecting to local project
connecting to local project
  • If everything is OK you will see the local project connected

local project in local remix-ide
local project in local remix-ide
  • Now you have the best development setup on $400 tablet. Enjoy your amazing coding setup!

it compiles
it compiles