Compare commits

...
6 Commits
10 changed files with 44 additions and 31 deletions
+3
View File
@@ -29,6 +29,9 @@ async function startServer () {
// Connect to the Mongo Database.
mongoose.Promise = global.Promise
mongoose.set('useCreateIndex', true) // Stop deprecation warning.
console.log(
`Connecting to MongoDB with this connection string: ${config.database}`
)
await mongoose.connect(config.database, {
useUnifiedTopology: true,
useNewUrlParser: true
+7 -1
View File
@@ -5,6 +5,10 @@
/* eslint no-unneeded-ternary:0 */
const ipfsCoordName = process.env.COORD_NAME
? process.env.COORD_NAME
: 'ipfs-bch-wallet-service'
module.exports = {
// Configure TCP port.
port: process.env.PORT || 5001,
@@ -41,11 +45,13 @@ module.exports = {
// Information passed to other IPFS peers about this node.
apiInfo: 'https://ipfs-service-provider.fullstack.cash/',
ipfsCoordName: ipfsCoordName,
// JSON-LD and Schema.org schema with info about this app.
announceJsonLd: {
'@context': 'https://schema.org/',
'@type': 'WebAPI',
name: 'ipfs-bch-wallet-service',
name: ipfsCoordName,
description:
'IPFS service providing BCH blockchain access needed by a wallet.',
documentation: 'https://ipfs-bch-wallet-service.fullstack.cash/',
+1 -1
View File
@@ -7,6 +7,6 @@
module.exports = {
session: 'secret-boilerplate-token',
token: 'secret-jwt-token',
database: 'mongodb://localhost:27017/ipfs-service-dev',
database: 'mongodb://localhost:27017/bch-service-dev',
env: 'dev'
}
+3 -1
View File
@@ -10,6 +10,8 @@
module.exports = {
session: 'secret-boilerplate-token',
token: 'secret-jwt-token',
database: 'mongodb://172.17.0.1:5555/ipfs-service-prod',
database: process.env.DBURL
? process.env.DBURL
: 'mongodb://172.17.0.1:5555/bch-service-prod',
env: 'prod'
}
+1 -1
View File
@@ -7,6 +7,6 @@
module.exports = {
session: 'secret-boilerplate-token',
token: 'secret-jwt-token',
database: 'mongodb://localhost:27017/ipfs-service-test',
database: 'mongodb://localhost:27017/bch-service-test',
env: 'test'
}
+2 -2
View File
@@ -53,7 +53,7 @@ VOLUME /home/safeuser/ipfsdata
VOLUME /home/safeuser/orbitdb
# Start the application.
COPY start-production start-production
CMD ["./start-production"]
COPY start-production.sh start-production.sh
CMD ["./start-production.sh"]
#CMD ["npm", "start"]
Regular → Executable
View File
@@ -4,25 +4,25 @@ bch-wallet-mongodb:
image: mongo
container_name: mongo-bch-service
ports:
- '5704:27017' # <host port>:<container port>
- '5555:27017' # <host port>:<container port>
volumes:
- ./database:/data/db
command: mongod --logpath=/dev/null # -- quiet
restart: always
bch-wallet-service:
build: ./production/
build: ./
dockerfile: Dockerfile
container_name: bch-wallet-service
links:
- bch-wallet-mongodb
ports:
# <host port>:<container port>
- '5700:5700' # REST API
- '5701:5701' # IPFS TCP Port
- '5702:5702' # IPFS WS Port
- '5001:5001' # REST API
- '5668:5668' # IPFS TCP Port
- '5669:5669' # IPFS WS Port
volumes:
- ./ipfsdata:/home/safeuser/ipfsdata
- ./orbitdb:/home/safeuser/orbitdb
- ../ipfsdata:/home/safeuser/ipfsdata
- ../orbitdb:/home/safeuser/orbitdb
restart: always
-18
View File
@@ -1,18 +0,0 @@
#!/bin/bash
# Customize these environment variables for your own installation.
export AUTHSERVER=https://auth.fullstack.cash
export APISERVER=https://api.fullstack.cash/v5/
export FULLSTACKLOGIN=bch-ipfs@bchtest.net
export FULLSTACKPASS=bchoveripfs
# Ports
export PORT=5700 # REST API
export IPFS_TCP_PORT=5701 # IPSF TCP Port
export IPFS_WS_PORT=5701 # IPFS WS Port
export ENABLE_CIRCUIT_RELAY=1
export SVC_ENV=production
npm start
+20
View File
@@ -0,0 +1,20 @@
#!/bin/bash
# Customize these environment variables for your own installation.
export AUTHSERVER=https://auth.fullstack.cash
export APISERVER=https://api.fullstack.cash/v5/
export FULLSTACKLOGIN=demo@demo.com
export FULLSTACKPASS=demo
# Ports
export PORT=5001 # REST API
export IPFS_TCP_PORT=5668 # IPSF TCP Port
export IPFS_WS_PORT=5669 # IPFS WS Port
# Production database connection string.
export DBURL=mongodb://172.17.0.1:5555/ipfs-service-prod
#export ENABLE_CIRCUIT_RELAY=1
export SVC_ENV=production
npm start