Skip to content

Commit ef6fc0b

Browse files
committed
initial
0 parents  commit ef6fc0b

File tree

112 files changed

+9136
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+9136
-0
lines changed

.env

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
XRPLD_ENV=testnet
2+
XRPLD_HOST=0.0.0.0
3+
XRPLD_PORT=6006

.eslintrc.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
module.exports = {
2+
parser: "@typescript-eslint/parser",
3+
parserOptions: {
4+
ecmaVersion: "latest", // Allows the use of modern ECMAScript features
5+
sourceType: "module", // Allows for the use of imports
6+
},
7+
extends: ["plugin:@typescript-eslint/recommended", "plugin:prettier/recommended"], // Uses the linting rules from @typescript-eslint/eslint-plugin
8+
plugins: ["prettier"],
9+
env: {
10+
node: true, // Enable Node.js global variables
11+
},
12+
};

.github/dependabot.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: npm
4+
directory: "/"
5+
schedule:
6+
interval: monthly
7+
time: "15:00"
8+
open-pull-requests-limit: 10

.github/pull_request_template.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
## High Level Overview of Change
2+
3+
<!--
4+
Please include a summary/list of the changes.
5+
If too broad, please consider splitting into multiple PRs.
6+
If a relevant Asana task, please link it here.
7+
-->
8+
9+
### Context of Change
10+
11+
<!--
12+
Please include the context of a change.
13+
If a bug fix, when was the bug introduced? What was the behavior?
14+
If a new feature, why was this architecture chosen? What were the alternatives?
15+
If a refactor, how is this better than the previous implementation?
16+
17+
If there is a design document for this feature, please link it here.
18+
-->
19+
20+
### Type of Change
21+
22+
<!--
23+
Please check relevant options, delete irrelevant ones.
24+
-->
25+
26+
- [ ] Bug fix (non-breaking change which fixes an issue)
27+
- [ ] New feature (non-breaking change which adds functionality)
28+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
29+
- [ ] Refactor (non-breaking change that only restructures code)
30+
- [ ] Tests (You added tests for code that already exists, or your new feature included in this PR)
31+
- [ ] Documentation Updates
32+
- [ ] Release
33+
34+
## Before / After
35+
36+
<!--
37+
If just refactoring / back-end changes, this can be just an in-English description of the change at a technical level.
38+
If a UI change, screenshots should be included.
39+
-->
40+
41+
## Test Plan
42+
43+
<!--
44+
Please describe the tests that you ran to verify your changes and provide instructions so that others can reproduce.
45+
-->
46+
47+
<!--
48+
## Future Tasks
49+
For future tasks related to PR.
50+
-->
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: [ main, 1.x ]
17+
pull_request:
18+
# The branches below must be a subset of the branches above
19+
branches: [ main ]
20+
schedule:
21+
- cron: '44 5 * * 6'
22+
23+
jobs:
24+
analyze:
25+
name: Analyze
26+
runs-on: ubuntu-latest
27+
28+
strategy:
29+
fail-fast: false
30+
matrix:
31+
language: [ 'javascript' ]
32+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
33+
# Learn more:
34+
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
35+
36+
steps:
37+
- name: Checkout repository
38+
uses: actions/checkout@v2
39+
40+
# Initializes the CodeQL tools for scanning.
41+
- name: Initialize CodeQL
42+
uses: github/codeql-action/init@v1
43+
with:
44+
languages: ${{ matrix.language }}
45+
# If you wish to specify custom queries, you can do so here or in a config file.
46+
# By default, queries listed here will override any specified in a config file.
47+
# Prefix the list here with "+" to use these queries and those in the config file.
48+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
49+
50+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
51+
# If this step fails, then you should remove it and run the build manually (see below)
52+
- name: Autobuild
53+
uses: github/codeql-action/autobuild@v1
54+
55+
# ℹ️ Command-line programs to run using the OS shell.
56+
# 📚 https://git.io/JvXDl
57+
58+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
59+
# and modify them (or add more) to build your code if your project
60+
# uses a compiled language
61+
62+
#- run: |
63+
# make bootstrap
64+
# make release
65+
66+
- name: Perform CodeQL Analysis
67+
uses: github/codeql-action/analyze@v1

.github/workflows/nodejs.yml

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3+
4+
name: Node.js CI
5+
6+
on:
7+
push:
8+
branches: [main, 1.x]
9+
pull_request:
10+
workflow_dispatch:
11+
12+
jobs:
13+
build-and-lint:
14+
runs-on: ubuntu-latest
15+
timeout-minutes: 10
16+
17+
strategy:
18+
matrix:
19+
node-version: [18.x, 20.x]
20+
21+
steps:
22+
- uses: actions/checkout@v3
23+
- name: Use Node.js ${{ matrix.node-version }}
24+
uses: actions/setup-node@v3
25+
with:
26+
node-version: ${{ matrix.node-version }}
27+
28+
- name: 'Setup jq'
29+
uses: dcarbone/[email protected]
30+
with:
31+
version: '${{ inputs.version }}'
32+
force: '${{ inputs.force }}'
33+
- name: 'Check jq'
34+
run: |
35+
which jq
36+
jq --version
37+
38+
- name: Setup npm version 7
39+
run: |
40+
npm i -g npm@7 --registry=https://registry.npmjs.org
41+
42+
- name: Cache node modules
43+
id: cache-nodemodules
44+
uses: actions/cache@v3
45+
env:
46+
cache-name: cache-node-modules
47+
with:
48+
# caching node_modules
49+
path: |
50+
node_modules
51+
*/*/node_modules
52+
key: ${{ runner.os }}-deps-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
53+
restore-keys: |
54+
${{ runner.os }}-deps-${{ matrix.node-version }}-
55+
${{ runner.os }}-deps-
56+
57+
- name: Install Dependencies
58+
if: steps.cache-nodemodules.outputs.cache-hit != 'true'
59+
run: yarn install
60+
61+
- run: yarn run lint
62+
63+
integration-c:
64+
runs-on: ubuntu-latest
65+
timeout-minutes: 10
66+
67+
strategy:
68+
matrix:
69+
node-version: [18.x, 20.x]
70+
71+
steps:
72+
- uses: actions/checkout@v3
73+
- name: Use Node.js ${{ matrix.node-version }}
74+
uses: actions/setup-node@v3
75+
with:
76+
node-version: ${{ matrix.node-version }}
77+
78+
- name: Run docker in background
79+
run: |
80+
docker run --detach --rm --name rippled-service -p 6006:6006 --health-cmd="wget localhost:6006 || exit 1" --health-interval=5s --health-retries=10 --health-timeout=2s transia/xahaudjs:latest
81+
82+
- name: Setup npm version 7
83+
run: |
84+
npm i -g npm@7 --registry=https://registry.npmjs.org
85+
86+
- name: Cache node modules
87+
id: cache-nodemodules
88+
uses: actions/cache@v3
89+
env:
90+
cache-name: cache-node-modules
91+
with:
92+
# caching node_modules
93+
path: |
94+
node_modules
95+
*/*/node_modules
96+
key: ${{ runner.os }}-deps-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
97+
restore-keys: |
98+
${{ runner.os }}-deps-${{ matrix.node-version }}-
99+
${{ runner.os }}-deps-
100+
101+
- name: Install Dependencies
102+
if: steps.cache-nodemodules.outputs.cache-hit != 'true'
103+
run: yarn install
104+
105+
- run: npm i -g @xahau/hooks-cli
106+
- run: yarn run build
107+
- run: hooks-cli compile-c contracts-c/toolbox build
108+
- run: hooks-cli compile-c contracts-c/txns build
109+
- run: yarn run test:integration-c
110+
env:
111+
HOOKS_COMPILE_HOST: https://hook-buildbox.xrpl.org
112+
XAHAU_ENV: standalone
113+
114+
- name: Stop docker container
115+
if: always()
116+
run: docker stop rippled-service

.gitignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
.DS_Store
2+
build
3+
# config.json
4+
node_modules
5+
/dist
6+
yarn-error.log
7+
debug.log
8+
9+
# smartnet
10+
11+
playground.ts
12+
playground.js
13+
**/tmp
14+
**/dist
15+
smartnet/rippled
16+
17+
# Generated by Cargo
18+
# will have compiled files and executables
19+
debug/
20+
target/
21+
deploy/

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.eslintrc.js
2+
updateDefinitions.ts

.prettierrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"singleQuote": true,
3+
"trailingComma": "es5",
4+
"semi": false
5+
}

.vscode/settings.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"[typescript]": {
3+
"editor.defaultFormatter": "esbenp.prettier-vscode",
4+
"editor.formatOnSave": true
5+
},
6+
"[javascript]": {
7+
"editor.defaultFormatter": "esbenp.prettier-vscode",
8+
"editor.formatOnSave": true
9+
},
10+
"cmake.configureOnOpen": false,
11+
"cmake.sourceDirectory": "/Users/dustedfloor/projects/xrpl-labs/the-hooks-library/binaryen/test/lit",
12+
"C_Cpp.errorSquiggles": "disabled"
13+
}

0 commit comments

Comments
 (0)