SuperMap iServer supports the direct publishing of blockchain service as a data source to data services, data history service, and map services, such as REST data services、REST map services.
Publish data stored in the blockchain network
You can publish the data stored in the service blockchain network as data services, data history service, and map services through the following steps:
- Click "publish service" on the "service management homepage" or click "quickly publish service" on the "service-service management" page to enter the publishing wizard;
- The selected data source is "blockchain service", and click "Next";
- For information about configuartion service data, click "Next":
- Enter or click "Select" to select the config file storage path, and select .yaml config file.
- Enter data source alias
- input channel@chaincode,for example:channel@chaincode
- Enter blockchain user certificate name
- Select the published service type, such as rest data service, and click Next.
- Configure the corresponding service according to the selected service type, and click Publish to complete the publishing process;
- When Data services is selected as the service type, such as rest data service, WFS 1.0.0, WFS 2.0.0, ArcGIS REST feature service, it is necessary to set whether the data services is editable. Not editable by default; set the user's editing permission, and enter the editable iServer user name in "modify users". Multiple user names are separated by semicolons. In addition, you can set user edit permissions in the following ways:
-
- In the service management-basic information interface, you can modify the iServer user name that provides editing permission in "modify users". Multiple user names are separated by semicolons. Click "Save";
- Click the icon under service management-basic information to set the user access authorization, and select "specified users can access". Check "All logged-in users can access", and the editable users set above will get access and editing permission.
- When the service type selects rest map service, you also need to enter or click "Select" to select the style file in JSON format to specify the style of the map.
- The iServer provides a default Mapbox style file. The built-in style files is 【iServer installation directory】/webapps/iserver/WEB-INF/config/mapboxstyles/defaultstyle.json .
- You can also specify a custom Mapbox style file. Currently, the corresponding Mapbox style file can be generated through iDesktop. In iDesktop or Open the data source in iDesktopX, customize the target style, right click in the map window, select Generate vector tiles style, select the storage path, and click OK. When you are finished, you can find the style.json file under the store path ../styles. When you publish the map services, select this JSON file in the style configuration.
Note : (1) Currently, the map that can be used in custom style in map services must meet two conditions: a. The blockchain data is the UDB/udbx/SHP data imported by the iDesktopX blockchain tool; b. Mapbox style files is generated by iDesktop by opening UDB/udbx/SHP file. (2) This map service does not support Mapbox thematic map style. (3) When the published blockchain data set is inconsistent with the projection coordinates in map services, you need to specify the style and scope of the published data set before it can be displayed normally in map services.
- When a rest datahistory service is selected for the service type, there is no need to configure the service, and you can directly click Publish.
- After publishing, you can see the name and link of the currently published service. Click it to access the service directly.
Note 1: Before selecting the. yaml configuration file, it is necessary to check whether there are IPFS and PostGIS instructions in the configuration file. If not, the IP and port of the IPFS network node, PostGIS domain name, and other information need to be inserted at the end of the. yaml file. The example is as follows.
ipfs:
address:
192.168.11.86
port:
5001
cacheserver:
# postgis connection fixed ID: domain name: port: database name: username: password (separated by:)
postgis:postgis.orga.example.com:5432:blockchain:postgres:supermap
Note 2: When publishing services, it is necessary to add the IP and domain names of the machines where each node in the blockchain network is located to the hosts file of the machine where the iServer service is located. An example is shown below.
# server1
192.168.11.86 orderer0.example.com
192.168.11.86 peer0.orga.example.com
192.168.11.86 couchdb.orga.example.com
192.168.11.86 ca.orga.example.com