Part 1: Ethereum Blockchain on IBM Cloud :- Deploying Private Ethereum Blockchain on IBM Cloud Containers
What is IBM Cloud ?
IBM Cloud is a cloud platform developed by IBM which is based on Cloud Foundry and runs of SoftLayer Infrastructure. It supports various programming languages, Databases, Services, as well as integrated DevOps to build, run, deploy and manage applications on the cloud using IBM Container service.
Signup for IBM Cloud free trial
Install IBM Cloud cli
Install and Setup Kubectl
Build your Docker Image
Clone my Git repository
> git clone https://github.com/SaifRehman/IBMCLOUD-Ethereum-Blockchain.git
> cd IBMCLOUD-Ethereum-Blockchain/
Build the Image from the Dockerfile
> docker build -t myimage .
Check if you have the image in your system
> docker images
Login to IBM Cloud & Create a new Container
Create a lite container on IBM Cloud by choosing container service. Do not forget to give your container a name 🙂 Let’s name it “ether”
Setup your Container
Do not follow along these steps unless your container is fully deployed!
Install container-service bx plugin
> bx plugin install container-service -r Bluemix
Log in to your IBM Cloud account.
> bx login -a https://api.ng.bluemix.net
Set your terminal context to your cluster
> bx cs cluster-config ether
Export environment variables to start using Kubernetes by copy pasting the resulting yellow line of code
> export KUBECONFIG=/Users/saifrehman/.bluemix/plugins/container-service/clusters/ether/kube-config-dal10-ether.yml
Push the image from your machine to IBM Cloud Private Registery
Tag an image to point to this registry. Choose a local image, target namespace, and target repository.
Install the Container Registry plug-in.
> bx plugin install container-registry -r Bluemix
Choose a name for your first namespace, and create that namespace. Use this namespace for the rest of the Quick Start.
bx cr namespace-add
> bx cr namespace-add etherprivate
Log your local Docker daemon into the IBM Cloud Container Registry.
> bx cr login
> docker tag myimage registry.ng.bluemix.net/etherprivate/myimage
docker push registry.ng.bluemix.net/
> docker push registry.ng.bluemix.net/etherprivate/myimage
Deploy your Image to Kubernetes Cluster on IBM Cloud
Setup your service.deployment.yml file
> kubectl create -f service-deployment.yml
Test if you can access
Don’t worry if you do not seen any output, it will not return you anything 🙂
Access your Private Ethereum Blockchain running on IBM Container
> geth attach http://188.8.131.52:30090
Let’s start mining Ether!
Create and unlock your new account to start mining
> personal.unlockAccount(web3.eth.coinbase, "password", 15000)
Start mining to get enough ether for us to deploy smart contract in our next tutorial 🙂
Check your Ether Balance
> web3.fromWei(eth.getBalance(eth.coinbase), "ether")
Congratulation you have successfully setup your Private Ethereum Blockchain on IBM Cloud!
Working with solidity to deploy your first ethereum smart contract on IBM Cloud and creating Dapp front-end on Angular 4
Part 1: Ethereum Blockchain on IBM Cloud :- Deploying Private Ethereum Blockchain on IBM Cloud… was originally published in Coinmonks on Medium, where people are continuing the conversation by highlighting and responding to this story.