Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running Testnet #10

Open
da-moon opened this issue Dec 19, 2018 · 1 comment
Open

Running Testnet #10

da-moon opened this issue Dec 19, 2018 · 1 comment

Comments

@da-moon
Copy link

da-moon commented Dec 19, 2018

It would be great if you could provide some type of local testnet with the cli. the functionality would be like ganache-cli or when you run truffle develop

@da-moon
Copy link
Author

da-moon commented Jan 6, 2019

a while ago I wrote a docker file that downloads and builds Aion kernel based on git tag. It could be useful to you guys if you ever decide to dockerize the cli, ide and a test net and provide a docker compose file that sets up the environment.

FROM ubuntu:latest
LABEL maintainer "0x405910207d7cabe46fc67c6c93ec068b"
LABEL image_type "Aion Docker File Docker Image With JDK 11"
ARG AION_MINING_ADDRESS=0x618d1ce29422bb29f280dc8533bcbcf6ff8b9d85651a21a6073fa31de26e2e7a
ENV AION_MINING_ADDRESS ${AION_MINING_ADDRESS}
ARG IS_MINING=false
ENV IS_MINING ${IS_MINING}

ARG CORS_ENABLED=true
ENV CORS_ENABLED ${CORS_ENABLED}

ARG KERNEL_VERSION=v0.3.2
ENV KERNEL_VERSION ${KERNEL_VERSION}
ARG UID=999
ENV UID ${UID}
ARG GUID=999
ENV GUID ${GUID}
ENV JAVA_HOME /usr/lib/jvm/java-11-oracle 
ENV VERSION 11.0.1 
ENV BUILD 13 
ENV SIG 90cf5d8f270a4347a95050320eef3fb7 
RUN apt-get update && apt-get dist-upgrade -y && \
    apt-get install apt-utils ca-certificates bzip2 lsb-release wget curl jq locales nano -y && \
    curl --silent --location --retry 3 --cacert /etc/ssl/certs/GeoTrust_Global_CA.pem \
    --header "Cookie: oraclelicense=accept-securebackup-cookie;" \
    http://download.oracle.com/otn-pub/java/jdk/"${VERSION}"+"${BUILD}"/"${SIG}"/jdk-"${VERSION}"_linux-x64_bin.tar.gz \
    | tar xz -C /tmp && \
    mkdir -p /usr/lib/jvm && mv /tmp/jdk-${VERSION} "${JAVA_HOME}" && \
    update-alternatives --install "/usr/bin/java" "java" "${JAVA_HOME}/bin/java" 1 && \
    update-alternatives --install "/usr/bin/javac" "javac" "${JAVA_HOME}/bin/javac" 1 && \
    update-alternatives --set java "${JAVA_HOME}/bin/java" && \
    update-alternatives --set javac "${JAVA_HOME}/bin/javac" && \
    curl -s https://api.github.com/repos/aionnetwork/aion/releases/tags/$KERNEL_VERSION | jq --raw-output '.assets[0] | .browser_download_url' | xargs wget -O kernel.tar.bz2 && \ 
    tar -xvjf ./kernel.tar.bz2 && \ 
    sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
    locale-gen && \ 
    sed '/\/rt\/bin\/java/ i\sleep \5;' -i /aion/aion.sh && \
    sed 's/ip=\"127.0.0.1\"/ip=\"0.0.0.0\"/g' -i /aion/config/mainnet/config.xml && \
    sed 's/ip=\"127.0.0.1\"/ip=\"0.0.0.0\"/g' -i /aion/config/mastery/config.xml && \
    sed "s/<rpc active=\"false\"/<rpc active=\"true\"/g" -i /aion/config/mastery/config.xml && \
    sed "s/<rpc active=\"false\"/<rpc active=\"true\"/g" -i /aion/config/mainnet/config.xml && \
    sed "s/<miner-address>.*\/miner-address>/<miner-address>$AION_MINING_ADDRESS<\/miner-address>/g" -i /aion/config/mainnet/config.xml && \
    sed "s/<mining>.*\/mining>/<mining>$IS_MINING<\/mining>/g" -i /aion/config/mainnet/config.xml && \
    sed "s/<mining>.*\/mining>/<mining>$IS_MINING<\/mining>/g" -i /aion/config/mastery/config.xml && \
    sed "s/<cors-enabled>.*\/cors-enabled>/<cors-enabled>$CORS_ENABLED<\/cors-enabled>/g" -i /aion/config/mainnet/config.xml && \
    sed "s/<cors-enabled>.*\/cors-enabled>/<cors-enabled>$CORS_ENABLED<\/cors-enabled>/g" -i /aion/config/mastery/config.xml && \
    apt-get autoclean && apt-get --purge -y autoremove && \
    rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /kernel.tar.bz2
ENV LANG en_US.UTF-8  
ENV LANGUAGE en_US:en  
ENV LC_ALL en_US.UTF-8   
EXPOSE 8545 8546 30303 30303/udp
CMD /aion/aion.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant