### Start Development Server Source: https://github.com/jordanmack/ckb-tools/blob/main/README.md Initiates the development server for the CKB.tools application. This command compiles and serves the application, allowing for local development and testing. ```sh npm run start ``` -------------------------------- ### Start Development Server with Legacy OpenSSL Source: https://github.com/jordanmack/ckb-tools/blob/main/README.md Starts the development server using a configuration that accommodates older OpenSSL versions or specific Node.js environments. Use this command if `npm run start` fails with OpenSSL-related errors. ```sh npm run start-legacy ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/jordanmack/ckb-tools/blob/main/README.md Installs the necessary project dependencies using npm. The `--force` flag is used to resolve potential dependency conflicts, ensuring all packages are installed. ```sh npm i --force ``` -------------------------------- ### Build Project for Production Source: https://github.com/jordanmack/ckb-tools/blob/main/README.md Compiles and bundles the CKB.tools project into a production-ready build. The output files are placed in the `build` directory, ready for deployment. ```sh npm run build ``` -------------------------------- ### Export Node.js OpenSSL Legacy Provider Option Source: https://github.com/jordanmack/ckb-tools/blob/main/README.md Sets an environmental variable to enable the OpenSSL legacy provider. This is often necessary for Node.js versions 17+ when encountering `error:0308010C:digital envelope routines::unsupported` errors during build or start processes. ```sh export NODE_OPTIONS=--openssl-legacy-provider ``` -------------------------------- ### Build Project with Legacy OpenSSL Source: https://github.com/jordanmack/ckb-tools/blob/main/README.md Builds the project for production using a configuration that supports legacy OpenSSL. This alternative build command is useful if `npm run build` encounters OpenSSL-related errors. ```sh npm run build-legacy ``` -------------------------------- ### Define AWS S3 CORS Configuration Source: https://github.com/jordanmack/ckb-tools/blob/main/assets/s3/config.txt This JSON snippet sets up Cross-Origin Resource Sharing (CORS) rules for an AWS S3 bucket. It allows all headers, all common HTTP methods (GET, HEAD, PUT, POST, DELETE), and all origins ('*') to interact with the bucket, with a maximum age for preflight requests set to 3000 seconds. ```JSON [ { "AllowedHeaders": [ "*" ], "AllowedMethods": [ "GET", "HEAD", "PUT", "POST", "DELETE" ], "AllowedOrigins": [ "*" ], "ExposeHeaders": [], "MaxAgeSeconds": 3000 } ] ``` -------------------------------- ### Configure AWS S3 Bucket Policy for Public Listing Source: https://github.com/jordanmack/ckb-tools/blob/main/assets/s3/config.txt This JSON snippet defines an AWS S3 bucket policy that allows any principal ('*') to perform the 's3:ListBucket' action on the bucket 'arn:aws:s3:::cdn.ckb.tools'. This is typically used to make bucket contents publicly listable. ```JSON { "Version": "2012-10-17", "Id": "Policy1623126614412", "Statement": [ { "Sid": "Stmt1623126610084", "Effect": "Allow", "Principal": "*", "Action": "s3:ListBucket", "Resource": "arn:aws:s3:::cdn.ckb.tools" } ] } ``` -------------------------------- ### Remove Problematic Node Module File Source: https://github.com/jordanmack/ckb-tools/blob/main/README.md Deletes a specific file (`index.d.ts`) within the `node_modules/hookrouter/dist` directory. This step is required to work around a known issue with the `hookrouter` NPM package. ```sh rm -f node_modules/hookrouter/dist/index.d.ts ``` -------------------------------- ### JavaScript S3 Bucket Configuration for CKB Snapshots Source: https://github.com/jordanmack/ckb-tools/blob/main/assets/s3/snapshots.s3.html This JavaScript snippet defines essential variables for configuring access to an S3 bucket containing Nervos CKB snapshots. It includes settings for ignoring path, specifying the bucket name and URL, defining the root directory for snapshots, and setting the sorting order. Commented-out lines show optional region and exclusion file settings. ```JavaScript var S3BL_IGNORE_PATH = true; var BUCKET_NAME = 'cdn.ckb.tools'; var BUCKET_URL = 'https://s3.amazonaws.com'; var S3B_ROOT_DIR = 'snapshots'; var S3B_SORT = 'NEW2OLD'; // var S3_REGION = 's3'; // var EXCLUDE_FILE = 'index.html'; ``` -------------------------------- ### JavaScript S3 Bucket Listing Configuration Source: https://github.com/jordanmack/ckb-tools/blob/main/assets/s3/snapshots.do.html This JavaScript snippet defines configuration variables for an S3 bucket listing tool. It specifies whether to ignore paths, the root directory for listings, the sorting order (newest to oldest), and a regular expression to exclude HTML and JavaScript files from the listing. These settings are crucial for customizing how Nervos CKB snapshots are presented or managed within an S3 environment. ```JavaScript var S3BL_IGNORE_PATH = true; // var BUCKET_NAME = 'cdn-ckb-tools'; // var BUCKET_URL = 'https://s3.amazonaws.com'; var S3B_ROOT_DIR = ''; var S3B_SORT = 'NEW2OLD'; // var S3_REGION = 's3'; var EXCLUDE_FILE = /(?:\\.html|\\.js)$/; ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.