1. Set Up an EC2 instance:
chmod 400 /Users/markwindsor/Desktop/binanceKey.pem
  1. Connect to the EC2 instance:

  2. Install Python:

  3. Write your Python Script:

  4. Set Up cron:

  5. Logging

  6. Permissions:

  7. Testing:


Cloning Repo from Github into your EC2 Instance

  1. Update the EC2 Instance:

    It's a good practice to ensure your instance is updated. If it's an Amazon Linux or similar instance, you can use:

    sudo yum update -y
    
  2. Install Git:

    If git isn't already installed, you'll need to install it:

  3. Clone the Repository:

    Use the git clone command followed by the repository URL:

    git clone <https://github.com/atlas-finance-io/atlas_trade_prod.git>
    
    
  4. Navigate to the Cloned Directory:

    After cloning, you can navigate to the directory:

    cd atlas_trade_prod
    

    From here, you can see all the files in the repository using the ls command and proceed with any other actions you'd like to perform.


    1. Install pip for Python 3:
    sudo yum install python3-pip -y 
    
    1. After installing pip3, install virtualenv:
    pip3 install --user virtualenv
    
    1. Ensure the path for user-based installations is added to your PATH: If the virtualenv command is still not found after installation, it might be because the local bin directory where user-specific Python packages are installed isn't in your PATH. Add it:
    echo 'export PATH=$PATH:/home/ec2-user/.local/bin' >> ~/.bashrc
    source ~/.bashrc
    

    Now, try creating your virtual environment with the virtualenv command.

    1. Create a Virtual Environment:
    virtualenv venv
    

    This will create a new directory named venv in your project directory.

    1. Activate the Virtual Environment:
    source venv/bin/activate
    

    Once activated, your terminal prompt should change, indicating that the virtual environment is active.

    1. Install Required Python Packages: Now, with your virtual environment active, you can install Python packages required for your project:
    pip3 install -r requirements.txt
    

    This assumes you have a requirements.txt file with your project dependencies.


    Clear Logfile

    truncate -s 0 logfile.log
    

    ** IP address of EC2 instance changes when you start and stop the instance