简介 MATRIX公网功能强大,私网只具备公网部分主要功能,但私网搭建简单,方便用户自己搭建体验。本章介绍了用户如何在linux centos环境下搭建个人的MATRIX私网。
搭建流程
导入文件,使用rz命令,将compose-gman.yaml、compose-exp.yaml两个文件导入。
compose-gman.yaml文件内容:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 version: '3.5' services: GMAN: image: dockermatrix123/matrix container_name: matrix stdin_open: true tty: true networks: extnetwork: ipv4_address: 10.0 .75 .2 ports: - 8567 :8567 networks: extnetwork: ipam: config: - subnet: 10.0 .75 .0 /24
compose-exp.yaml文件内容:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 version: '3.5' services: EXP: image: dockermatrix123/matrixexp container_name: explore privileged: true environment: IP: 10.0 .75 .2 ports: - 3012 :3000 - 8011 :80 stdin_open: true tty: true networks: extnetwork: networks: extnetwork: ipam: config: - subnet: 10.0 .75 .0 /24
1 yum -y install docker-compose
1 2 docker pull dockermatrix123/matrix docker pull dockermatrix123/matrixexp
先执行:
1 docker-compose -f compose-gman.yaml up –d
再执行:
1 docker-compose -f compose-exp.yaml up –d
安装完成后,可通过8567端口访问gman
使用JS SDK发送请求
1 2 3 4 5 6 7 8 var AIMan = require ('AIMan' );if (typeof aiman !== 'undefined' ) { aiman = new AIMan(aiman.currentProvider); } else { aiman = new AIMan(new AIMan.providers.HttpProvider("http://localhost:8567" )); }