> It is necessary to enable [circle relay](https://github.com/ipfs/js-ipfs/tree/master/examples/circuit-relaying) in the node to be able to replicate the database to react with js-ipfs for it is necessary to use the following configuration
>We also need to make sure our go node can be dialed from the browser. For that, we need to enable a transport that both the browser and the go node can communicate over. We will use the web sockets transport.
>To enable the transport and set the interface and port we need to edit the ~/.ipfs/config one more time. Let's find the Swarm array and add our desired address there.
OrbitDB is a **serverless, distributed, peer-to-peer database**. OrbitDB uses [IPFS](https://ipfs.io) as its data storage and [IPFS Pubsub](https://github.com/ipfs/go-ipfs/blob/master/core/commands/pubsub.go#L23) to automatically sync databases with peers. It's an eventually consistent database that uses [CRDTs](https://en.wikipedia.org/wiki/Conflict-free_replicated_data_type) for conflict-free database merges making OrbitDB an excellent choice for decentralized apps (dApps), blockchain applications and offline-first web applications.
Run index.js with uncomment line 24, 25, the first log is your orbitdb address (See the Wiki for more information), the second is your orbitDB address database copy this address and pass in index.js in line 6, and in interfaz.js in the same line.
**If you want to debug orbitdb in bash**
```sh
$ export LOG="orbit*" node
```
**Start the DecaCC replicated**
```sh
$ node index.js
```
Later in the nodes that will work like peers only, install the requeriments and run index.js with the new address.
**Start the DecaCC Interface**
```sh
$ node interfaz.js
```
In the node that can write run interfaz.js and choose an option.
```sh
$ Show Carbon Credit records
$ Insert Carbon credit
$ Delete Carbon credit
$ Exit
```
**Note: If the nodes will replicated you need connect before with IPFS Daemon (See Wiki).**
*Note 2: Remember dont lost your orbitdb folder because your identity.id change and cant write in a database another time*
## Connect Nodes
In order to connect nodes, we create a bash script which resolves the domain name of each node and ipfs swarms them,
this script should be configured in a crontab to run every 5 minutes. The crontab should be configured as the user
that holds this repository and that runs the orbitdb.
*Open the crontab as the user that holds the script*
```sh
$ crontab -e
```
*Append the following line at the end of the editor and write it*
You can help us to increase the speed of replication of the database at react [DECA Carbon Credits](http://search.deca.green/). To do this, once the node is configured as a service and the database is replicated, it is necessary to enable the connection through WebSocket Secure to do so in order to have a DNS.
### Requirements
* Nginx >= 1.14.0
* Certbot >= 1.6
Install Nginx
```sh
$ sudo apt update
$ sudo apt install nginx
```
Install Certbot
```sh
$ sudo add-apt-repository ppa:certbot/certbot
$ sudo apt update
$ sudo apt install python-certbot-nginx
```
> In a nginx configuration add the proxy pass to the websocket.
```sh
$ vim /etc/nginx/conf.d/example.com.conf
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name example.com www.example.com;
root /var/www/example.com;
index index.html;
try_files $uri /index.html;
location / {
proxy_pass http://localhost:4004;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
```
### Add SSL Certificate
**This is necessary because otherwise the web browser will not be able to connect to the WebSocket**
```sh
$ sudo certbot --nginx -d example.com
```
Finally renew the certificate with the following command and restart nginx
**You can help us by pinning DECA's project receipts into IPFS which will give deeper trust to DECA.**
We have a script in order to pin (replicate into your node) the projects receipts that DECA got, so that
any one can have a proof that we bought this receipts as public information. Also you can store a copy of this receipts which will be added by IPFS hash into this script.
As you can see in the above example we pin the receipt by running " ./receipts.sh ", also we Download this receipt with should be allocated in the directory projects Receipts.