@scom/scom-node

0.1.1 • Public • Published

Setting up and Installing on Local Environment

To get started, follow the steps below:

1. Create a new file in the /scripts directory called user_name.txt. Inside the file, add your GitHub username.

2. Create another file in the /scripts directory called personal_token.txt. Inside the file, add your GitHub personal token.

3. To install all the local repositories, run the following command in your terminal:

npm run setup:local

4. Install all the dependencies by running the following command:

docker-compose up install

5. Clone data/config.template.js into data/config.js and replace the contents with the following:

const RootPath = process.cwd();
const Path = require('path');
const redis = {
    host: "redis.local_network",
    port: 6379,
    password: '',
    db: 0,
};
const database = {
    type: 'mysql',
    connection: {
        host: 'db',
        port: 3306,
        user: 'root',
        password: 'ijs@work',
        database: 'sc'
    }
};
module.exports = {
    database: database,
    redis: redis,
    storage: {
        s3: {
            endpoint: '',
            bucket: '',
            key: '',
            secret: ''
        },
        localCache: {
            path: 'cache'
        }
    },
    router: {
        cors: true,
        enabled: true,
        port: 8100
    },
    scheduler: {
        enabled: true,
        // queue: redis
    },
    worker: {
        enabled: false,
        queue: redis
    },
    domains: {
        "127.0.0.1": {
            app: Path.join(RootPath, 'repos/sc-domain-marketplace/dist'),
            worker: Path.join(RootPath, 'repos/sc-domain-data'),
            plugins: {
                db: database,
                wallet: {
                    chainId: 43113,
                    accounts: [],
                    networks: {
                        43113: {
                            provider: 'https://api.avax-test.network/ext/bc/C/rpc'
                        }
                    }
                },
                cache: {
                    redis: redis
                }
            }
        }
    }
}

6. To compile the application, run the following command:

docker-compose up build

7. Start Redis by running the following command:

docker-compose up -d redis

8. Start the database by running the following command:

cd mysql && docker-compose up -d db

9. Start the application by running the following command:

docker-compose up start

10. Finally, access the dev server by navigating to http://127.0.0.1:8100/ in your web browser..

Readme

Keywords

none

Package Sidebar

Install

npm i @scom/scom-node

Weekly Downloads

113

Version

0.1.1

License

none

Unpacked Size

153 kB

Total Files

26

Last publish

Collaborators

  • ijstech