- Download gMidArch (https://github.com/gfads/midarch.git) into any place you like (<path-to-gmidarch>)
- Configure environment variable GMIDARCH=<path-to-gmidarch>
If you are going to use TLS then configure TLS environment variables:
- Configure CA_PATH=<path-to-ca-cert-file>
- Configure CRT_PATH=<path-to-cert-file>
- Configure KEY_PATH=<path-to-cert-key-file>
If you don't have certificades and want to generate certificates just for developing and/or testing:
mkdir -p ./examples/certs/
cd ./examples/certs/
# Generate CA key
openssl genrsa -out myCA.key 1024
# Generate the CA Certificate
## Ask for common name, country, ...
openssl req -x509 -new -nodes -key myCA.key -sha256 -days 3650 -out myCA.pem
## Or provide in script common name, country, ...
openssl req -x509 -new -nodes -key myCA.key -sha256 -days 3650 -out myCA.pem -subj '/CN=MidArchCA/C=BR/ST=Pernambuco/L=Recife/O=MidArch'
# Generate Server Certificate
openssl req -new -nodes -newkey rsa:1024 -out server.csr -keyout server.key -subj '/CN=localhost/C=BR/ST=Pernambuco/L=Recife/O=MidArch'
# Sign the Server Certificate
openssl x509 -req -in server.csr -CA myCA.pem -CAkey myCA.key -CAcreateserial -sha256 -days 3650 -out server.pem -extfile <(printf "subjectAltName=DNS:localhost")
Where:
- CN = <Common Name (e.g. server FQDN or YOUR name)>
- C = <Country Name (2 letter code)>
- ST = <State or Province Name (eg, city)>
- L = <Locality Name (eg, city)>
- O = <Organization Name (eg, company)>
- OU = <Organizational Unit Name (eg, section)>
To use QUIC on linux it is necessary to increase the maximum buffer size.
sysctl -w net.core.rmem_max=2500000
More on https://github.com/quic-go/quic-go/wiki/UDP-Receive-Buffer-Size
- Download (https://cocotec.io/fdr/index.html) into /fdr4
- Install FDR4
- Configure FDR4=/fdr4
- Go to GMIDARCH/pkg/apps/artefacts/madls
- Edit 'midfibonacciserver.madl' (set 'Adaptability' to 'None')
- Go to GMIDARCH/examples/fibonaccidistributed/naming
- Compile 'go build naming.go'
- Start Naming Service: './naming'
- Go to GMIDARCH/examples/fibonaccidistributed/server
- Compile 'go build server.go'
- Start Fibonacci Server: './server'
- Go to GMIDARCH/examples/fibonaccidistributed/client
- Compile 'go build client.go'
- Start Fibonacci: './client '
- Go to GMIDARCH/pkg/apps/artefacts/madls
- Edit 'midfibonacciserver.madl' (set 'Adaptability' to 'Evolutive')
- Go to GMIDARCH/examples/fibonaccidistributed/naming
- Compile 'go build naming.go'
- Start Naming Service: './naming'
- Go to GMIDARCH/examples/fibonaccidistributed/server
- Compile 'go build server.go'
- Start Fibonacci Server: './server'
- Go to GMIDARCH/examples/fibonaccidistributed/client
- Compile 'go build client.go'
- Start Fibonacci Client: './client '