설명에 앞서, 이 문서에서는 네트워크를 통해 체인 스펙 파일을 다운로드 받아 사용하는 방법만을 설명합니다. 만약 해당 방식으로 진행을 원치 않을 경우, 파일을 업로드하거나 서버에서 직접 체인 스펙 파일을 만드는 등 다양한 방법으로 체인 스펙 파일을 등록하시기 바랍니다.
서버 배포 방법은 3가지 방법이 있습니다.
Systemd
Docker
Kubernetes
3가지 방법을 사용하여 배포하는 방법을 알아보겠습니다.
Systemd
Systemd는 Linux 호스트에서 서비스를 관리하는 일반적인 방법입니다. 프로세스가 활성화되어 실행 중인지 확인하고, 재시작에 대한 정책을 설정할 수 있으며, 호스트를 실행하는 사용자를 설정하고, 메모리 사용량을 제한하는 등의 작업을 수행할 수 있습니다.
또한 환경 변수 파일을 사용하여 변수를 서버별 자체 파일로 추상화할 수 있습니다.
Systemd를 사용하기 위해서는 먼저 service로 등록을 해주어야 합니다. 그러기 위해서 /etc/systemd/system 경로에 Infrablockspace.service를 만들어줍니다. 이후 아래 코드를 복사 붙여넣기 해준 다음 <binary file> 과 <options>에 필요한 옵션 값들을 넣어줍니다. <binary file>에는 릴레이체인일 땐 infrablockspace, 파라체인일 땐 infrablockspace-parachain을 입력해줍니다.
apiVersion: v1
kind: Service
metadata:
name: infra-did-service-clusterip
spec:
selector:
app: infra-did
mode: para
type: ClusterIP
ports:
- name: infra-did-http
protocol: TCP
port: 9933
targetPort: 9933
- name: infra-did-ws
protocol: TCP
port: 9944
targetPort: 9944
# If you set the `spec.type` field to `NodePort` and you want a specific port number,
# # you can specify a value in the `spec.ports[*].nodePort` field.
- name: relay-peer
protocol: TCP
port: 30333
targetPort: 30333
---
apiVersion: v1
kind: Service
metadata:
name: infra-did-headless-service
spec:
clusterIP: None
selector:
app: infra-did
mode: para
ports:
- name: infra-did-http
protocol: TCP
port: 9933
targetPort: 9933
- name: infra-did-ws
protocol: TCP
port: 9944
targetPort: 9944
# If you set the `spec.type` field to `NodePort` and you want a specific port number,
# you can specify a value in the `spec.ports[*].nodePort` field.
- name: relay-peer
protocol: TCP
port: 30333
targetPort: 30333