Search Preview
在 IBM Cloud 上创建和部署区块链聊天应用
uml.org.cnbody { margin: 0px;padding:0 } #div1 { display: none; position: absolute; z-index: 1000; height: 100%; width: 100%; backgrou
.cn > uml.org.cn
SEO audit: Content analysis
Language | Error! No language localisation is found. | ||||||
---|---|---|---|---|---|---|---|
Title | 在 IBM Cloud 上创建和部署区块链聊天应用 | ||||||
Text / HTML ratio | 48 % | ||||||
Frame | Excellent! The website does not use iFrame solutions. | ||||||
Flash | Excellent! The website does not have any flash contents. | ||||||
Keywords cloud | |||||||
Keywords consistency |
|
||||||
Headings | Error! The website does not use (H) tags. | ||||||
Images | We found 40 images on this web page. |
SEO Keywords (Single)
Keyword | Occurrence | Density |
---|
SEO Keywords (Two Word)
Keyword | Occurrence | Density |
---|
SEO Keywords (Three Word)
Keyword | Occurrence | Density | Possible Spam |
---|
SEO Keywords (Four Word)
Keyword | Occurrence | Density | Possible Spam |
---|
Internal links in - uml.org.cn
文章-火龙果软件工程
iProcess--火龙果软件工程技术中心
一文深入了解:分布式系统中的缓存架构-数据库
基于 Bitbucket Pipeline + Amazon S3 的自动化运维体系-IT运维管理
DAGOR:微信微服务过载控制系统-移动端开发
数据库-火龙果软件工程
IT运维管理-火龙果软件工程
微服务-火龙果软件工程
理解vuex的状态管理模式架构
运用TensorFlow处理简单的NLP问题-人工智能-火龙果软件
JavaScript-火龙果软件工程
人工智能-火龙果软件工程
从系统和代码实现角度解析TensorFlow的内部实现原理-人工智能-火龙果软件
使用IPython增强交互式体验-Python
在 IBM Cloud 上创建和部署区块链聊天应用
python-火龙果软件工程
云计算-火龙果软件工程
VUE.JS组件化开发实践
瑞萨C++多线程开发培训-火龙果软件
产品经理产品管理培训| 产品经理培训
使用Selenium进行有效的自动化测试-火龙果软件-UML软件工程组织
高可用架构培训|软件架构培训-火龙果软件
基于UML+EA进行嵌入式系统分析设计培训-火龙果软件-UML软件工程组织
工作量估算管理培训-火龙果软件
培训案例-火龙果软件
软件架构师认证|软件架构师培训-火龙果软件
软件架构师认证|软件架构师培训-火龙果软件
软件架构师认证|软件架构培训-火龙果软件
软件架构师认证|软件架构师培训-火龙果软件
Github使用快速上手-配置管理
用 Vuex 构建一个笔记应用 -web开发
配置管理-火龙果软件工程
基于matplotlib的数据可视化 -Python
Online Learning算法理论与实践-火龙果软件
每月技术月刊--UML软件工程组织
火龙果软件工程技术中心
联系我们-UML软件工程组织
Uml.org.cn Spined HTML
IBM Cloud ϴͲӦ Ծ֧ǵĹҵ 1Ԫ 10Ԫ 50Ԫ ֤룺 ֪ Ŀ Lib Ƶ Code iProcess γ ֤ ѯ ɳ֮· Ա Ҫ ÿ15ƪ ı IBM Cloud ϴͲӦ 53 ۣ 2018-11-29 ༭Ƽ: IBMҪʹ Tendermint Lotionjs ɽȨ֤ӦΪ֤߽ڵ㲿 IBM ǰ Ҫװ IBM Cloud CLIڹ IBM Cloud еӦáܹԴн DockerʹӦõƽ̨ Kubectl Kubernetes ϲӦõй Դΰļ֮һ֧Ϣֵּ֧ϰӦѧ棬ǰδеĴоݱչиҵҵڽӦʵҵ ҲһոµļٿӦԭͲƶءTendermint ڿٴӦãΪɴλڵײ㣨磬ʶͬʱͨ ABCIӦӿڣ۽Ӧò㡣ڱ̳Уҽչʾʹ Tendermint Lotionjs ɴӦã䲿 IBM Cloud ʲô Tendermint ֮Tendermint ǿκηֲʽƽ̨ʵְռͥݴ (BFT) ӹܹƷֲʽݿ⣬ʹ TendermintTendermint Ҫļ ʶ棨ҲΪ Tendermint ģͨȨ֤ʶȷÿ̨аͬ˳¼ÿ ABCIӦӿڣ֧κα Tendermint ԣ ռͥݴTendermint ߿֮һĻϡȷĶΪ ״̬ƣTendermint ɸκαԱдȷ״̬ ȫ P2Pͨ Tendermint о֤ļϵͳ Gossip ЭͶԵȽڵ㷢֡ ٶȣTendermint ֧ÿǧ1000 ӳ١ ʲô Lotionjs Lotion JavaScript дӦõһֿٶȤķǻ Tendermint ʹ ABCI Э鹹ġ 1Ŀ Ŀ¼Ŀ¼ $ mkdir blockchain $ cd blockchain װĿ⣺ $ npm i lotion --save $ npm i dotenv --save 2 2 ֤߽ڵ˽Կʹʼļ ʼļ touch genesis.json ʼ䵽 genesis.json У { "genesis_time": "0001-01-01T00:00:00Z", "chain_id": "name", "validators": [ ], "app_hash": "" } 2 ֤߽ڵԿ $ ./node_modules/lotion/bin/tendermint gen_validator > privkey0.json $ ./node_modules/lotion/bin/tendermint gen_validator > privkey1.json ˽Կ£Կ˽Կɵģ { "address": "B809574EC51377DE48454094BF3302989CBB50A9", "pub_key": { "type": "ed25519", "data": "8A049817BA6D1B065C30D927A529AAFA7147BE0D147 E1CCD7A25FAADBE80C8D0" }, "priv_key": { "type": "ed25519", "data": "57BAFDD6136E1140FA9F906313BF2CFC75802F044704DD7AAF3 0BC1010E6519C8A049817BA6D1B065C30D927A529AAFA7147BE0D147E1CCD7A25F AADBE80C8D0" } } ƹԿϢճ genesis.json С֤ߺ£ { "genesis_time": "0001-01-01T00:00:00Z", "chain_id": "name", "validators": [ { "pub_key": { "type": "ed25519", "data": "8A049817BA6D1B065C30D927A529AAFA7147BE0D1 47E1CCD7A25FAADBE80C8D0" }, "power": 10, "name": "saif" }, { "pub_key": { "type": "ed25519", "data": "5FD1FBF59759E50BD1C23911E832198AB78A4F7E6F 1F23A64AAFEC5992608CA8" }, "power": 20, "name": "prerna" } ], "app_hash": "" } 3֤ 1 node1 ļУ mkdir node1 node1 Ŀ¼ cd node1 װĿ⣺ $ npm i lotion --save $ npm i dotenv --save ǰɵ genesis.json privkey0.json Ƶ node1 ļС node1 Ļļ $ touch .env-node1 node1.js ݽб룺 LOTION_HOME="./.lotion_node1" node1.js $ touch node1.js node1.js ݽб룺 require('dotenv').config({path: ".env-node1"}); let lotion = require('lotion') let app = lotion({ genesis: './genesis.json', tendermintPort: 30090, initialState: { messages: [] }, p2pPort: 30092, logTendermint: true, keys: 'privkey0.json', peers: ['workernode2:30092'] }) app.use((state, tx,chainInfo) => { if (typeof tx.sender === 'string' && typeof tx.message === 'string') { state.messages.push({ sender: tx.sender, message: tx.message }) } }) app.listen(3000).then(({ GCI }) => { console.log(GCI) }) Dockerfile $ touch Dockerfile Dockerfile ݽб룺 FROM node:carbon WORKDIR /usr/src/app COPY package*.json ./ COPY privkey0.json ./ COPY .env-node1 ./ RUN npm install COPY .. EXPOSE 30090 30092 CMD [ "node", "node1.js" ] 4֤ 2 node2 ļУ mkdir node2 node2 Ŀ¼ cd node2 װĿ⣺ $ npm i lotion --save $ npm i dotenv --save ǰɵ genesis.json privkey0.json Ƶ node2 ļС node2 Ļļ $ touch .env-node2 node2.js ݽб룺 LOTION_HOME="./.lotion_node2" node2.js $ touch node1.js node2.js ݽб룺 require('dotenv').config({path: ".env-node2"}); let lotion = require('lotion') let app = lotion({ genesis: './genesis.json', tendermintPort: 30090, initialState: { messages: [] }, p2pPort: 30092, logTendermint: true, keys: 'privkey1.json', peers: ['workernode1:30092'] }) app.use((state, tx,chainInfo) => { if (typeof tx.sender === 'string' && typeof tx.message === 'string') { state.messages.push({ sender: tx.sender, message: tx.message }) } }) app.listen(3000).then(({ GCI }) => { console.log(GCI) }) Dockerfile $ touch Dockerfile Dockerfile ݽб룺 FROM node:carbon WORKDIR /usr/src/app COPY package*.json ./ COPY privkey0.json ./ COPY .env-node1 ./ RUN npm install COPY .. EXPOSE 30090 30092 CMD [ "node", "node2.js" ] 5֤߽ڵ㲿 IBM Cloud ע IBM Cloud װ Cloud Foundry CLI װ IBM Cloud CLI װ Kubernetes CLI node1 Ŀ¼ $ cd node1 Docker $ docker build -t node1 . ת IBM Cloud ̨ Containers ѡ Create Cluster һ¼Ⱥ ļȺһȺȴӣԱȫ˼Ⱥȫ˼ȺԲ鿴ѲȺĸ ѲȺĸ ർе AccessѭָʾϢв װ $ bx plugin install container-service -r Bluemix ¼ IBM Cloud ʻ $ bx login -a https://api.eu-de.bluemix.net $ bx cs region-set eu-central CLI üȺĻ ȡû Kubernetes ļ $ bx cs cluster-config NameOfYourCluster KUBECONFIG ǰƲճնڡ гĹڵ㣬֤ǷӵԼļȺ $ kubectl get nodes ת IBM Cloud Container Registry ѡƿռƣƿռ䡣 $ bx cr namespace-add <my_namespace> Docker ػ¼ IBM Cloud Container Registry У $ bx cr login ѡ洢ʶıǩڱ̵̳ಿʹͬĴ洢ͱǩ $ docker tag node1 <registry>/<my_namespace>/node1:latest ; $ docker push <registry>/<my_namespace>/node1:latest ֤ľǷλ˽עУ $ bx cr image-list ȻѲ IBM ϣʱʹ Kubernetes һЩ pod ˡ ʹø/ճƴע˽ƸΪơλ service-deployment.yml ļеľԽ˽עеľͬ apiVersion: extensions/v1beta1 kind: Deployment metadata: name: tendermintnodeone # requite any name spec: replicas: 1 template: metadata: name: tendermintnodeone labels: run: tendermint1 spec: containers: - name: saif1cluster image: "<registry>/<my_namespace>/node1:latest" # your registry name imagePullPolicy: Always --- apiVersion: v1 kind: Service metadata: name: my-service-tendermint-11 # requite a service name labels: run: tendermint1 spec: type: NodePort selector: run: tendermint1 ports: - protocol: TCP name: tendermint1 port: 30090 nodePort: 30090 - protocol: TCP name: port port: 30092 nodePort: 30092 Kubernetes Դ podͲ $ kubectl create -f service-deployment.yml ɾв $ kubectl delete deployments --all ɾз $ kubectl delete services --all pod ־ $ kubectl get pods $ kubectl logs podname Tendermint RPC APIhttp://workerip:30092 node2 ظͬIJ衣 6ͻִж/д װ lotion-connect $ npm install lotion-connect --save write.js $ touch read-write.js read-write.js ݽб룺 let { connect } = require('lotion-connect') async function main() { let { state, send } = rely connect(null, { genesis: require('./genesis.json'), nodes: [ 'ws://wordernode1:30092','ws://wordernode2:30092' ] }) console.log(await state) console.log(await send({ "sender": 'saif',"message":"himom" })) process.exit(); } main() Tendermint ҵԱдӦã IBM Cloud ˴ӦõIJͲ 53 : Ƽļܹ Ƽģ Ƽļ ˽Ƽ© ĵ Ƽ Ƽưȫ һ--Ƽ dzƼ ؿγ ƼԭӦ ƼӦ뿪 CMMIϵʵ CMMI֤ Ƚ---ưȫ ƼƤ ƼͨѶ¼Ʒ ƼĵӦ йʽƼģʽ Ƽ㼼ϵṹ ... ѵγ ƼԭӦ Windows Azure ƼӦ γ... ɹ Ħ ƽ̨ĹӦ ͨù˾GE Dockerԭʵ ijз Openstackʵ ֪ӹ˾ ƽ̨ܹӦ ijҵ ƽ̨Ʒ ƼWindows Azureѵ ƼԭӦ ... ÿ2ĵ/Ƶ ɨŶά붩 ļ¿ ÿ300Դ | ϵ | ICP10020922 110108001071