The exploration version of the large group of robots supports the separation of http service and message service.
- node
- go
- postgres
- redis > 6
git clone https://github.com/MixinNetwork/supergroup-botField introduction
| Field | Introduction |
|---|---|
| port | The running port, such as 7001 |
| lang | Language, currently only supports (zh/en) |
| database | postgres database information |
| monitor | Used for message data monitoring, can be empty |
| qiniu | Used to save resources for live broadcast of graphics, text and voice, can be empty |
| redis_addr | redis address |
| client_list | A list of client_ids that need to connect to http and message services |
| show_client_list | Client list displayed in the discovery community |
| luck_coin_app_id | red envelope app_id |
Currently the red envelope app_id only supports two, the Chinese version of
1ab1f241-b809-4790-bcfd-a1779bb1d313and the English version of70b94e54-8f75-41f5-91e2-12522112ee71
First configure the three fields lang | database | redis_addr.
Field introduction
| Field | Introduction |
|---|---|
| client | Large group of keystore information |
| client.client_secret | Large group of secret keys |
| client.host | Open the homepage of the large group on the web side, such as: http://localhost:8000 |
| client.name | Group name |
| client.description | Introduction to the authorization page group |
| client.asset_id | The default asset of the large group, can be empty |
| level | Member level |
| replay.join_msg | Default replies received by members who have not joined the group |
| replay.welcome | The default reply that new members will receive |
| manager_list | The user_id or identity_number list of the administrator, can be empty |
Configure client and replay first
2.x has been updated to automatically create and update tables.
After preparing client.json and config.json
go run. -service add_clientImprove the client_list and show_client_list in config.json. In these two arrays, add the newly imported client_id
go run. #Start http service
go run. -service blaze & go run. -service create_message & go run. -service distribute_message # Start message serviceThe following files introduce the working directory is /client
Field introduction
| Field | Introduction |
|---|---|
| LANG | Currently only supports en/zh |
| MIXIN_BASE_URL | Currently only supports https://mixin-api.zeromesh.net/https://api.mixin.one |
| RED_PACKET_ID | is the luck_coin_app_id configured on the server side |
| SERVER_URL | Please configure the development version as the server address, such as http://localhost:7001 |
| LIVE_REPLAY_URL | The video prefix used for live playback, can be empty |
| HAS_OTC | Used to display OTC transactions. 0 means no display, 1 means display. |
If you want to deploy online, please see the deployment article later
Reference configuration
import { defineConfig } from 'umi';
export default defineConfig({
define: {
'process.env.LANG': 'zh',
'process.env.MIXIN_BASE_URL': 'https://api.mixin.one',
'process.env.RED_PACKET_ID': '70b94e54-8f75-41f5-91e2-12522112ee71',
'process.env.SERVER_URL': 'http://192.168.2.237:7001',
'process.env.LIVE_REPLAY_URL': '',
'process.env.HAS_OTC': '0',
},
});npm installnpm run startNote:
- The browser address started here is the value of
client.hostthat the server needs to configure, and it must match to start normally- In developers.mixin.one/dashboard, the added robot also needs to configure the home page address to the value of
client.host, and then verify that the address is${client.host}/auth
mkdir supergroup-botAnd fill in the corresponding information
- You need to open two domain names. For example, if you want to open a btc community, you can create two second-level domain names
- btc.xxx.com
- btc-api.xxx.com
- Need to open
https - In
https://developers.mixin.one/dashboard, change the homepage address tohttps://btc.xxx.comand the verification address tohttps://btc.xxx.com/ auth - Configure
btc-api.xxx.cominnginxto the back-end specified port service - Configure
btc.xxx.cominnginxto the specified working directory of the front end - Modify
SERVER_URLtohttps://btc-api.xxx.comin/client/.umirc.prod.ts - The preparations are now complete
- Server start service
./supergroup # start http service
./supergroup -service blaze & ./supergroup -service create_message & ./supergroup -service distribute_message # start message serviceOr you can configure
systemctlornohubto manage services.
- Client start service
npm run buildThen put the dist folder in the path specified by btc.xxx.com by nginx.
- End of deployment