mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-07 22:35:48 +00:00
chore: switch to rippleci Docker container (#2534)
* fix docker container * fix attempt * use fix for browser tests too * update contributing * fix tests * fix integration tests issues * use variable for docker image
This commit is contained in:
@@ -105,65 +105,66 @@ validators.txt
|
||||
# Note: The version of rippled you use this config with must have an implementation for the amendments you attempt to enable or it will crash.
|
||||
# If you need the version of rippled to be more up to date, you may need to make a comment on this repo: https://github.com/WietseWind/docker-rippled
|
||||
|
||||
[amendments]
|
||||
[features]
|
||||
# Devnet amendments as of June 28th, 2023
|
||||
B4E4F5D2D6FB84DF7399960A732309C9FD530EAE5941838160042833625A6076 NegativeUNL
|
||||
DF8B4536989BDACE3F934F29423848B9F1D76D09BE6A1FCFE7E7F06AA26ABEAD fixRemoveNFTokenAutoTrustLine
|
||||
3C43D9A973AA4443EF3FC38E42DD306160FBFFDAB901CD8BAA15D09F2597EB87 NonFungibleTokensV1
|
||||
98DECF327BF79997AEC178323AD51A830E457BFC6D454DAF3E46E5EC42DC619F CheckCashMakesTrustLine
|
||||
B6B3EEDC0267AB50491FDC450A398AF30DBCD977CECED8BEF2499CAB5DAC19E2 fixRmSmallIncreasedQOffers
|
||||
452F5906C46D46F407883344BFDD90E672B672C5E9943DB4891E3A34FEEEB9DB fixSTAmountCanonicalize
|
||||
AF8DF7465C338AE64B1E937D6C8DA138C0D63AD5134A68792BBBE1F63356C422 FlowSortStrands
|
||||
955DF3FA5891195A9DAEFA1DDC6BB244B545DDE1BAA84CBB25D5F12A8DA68A0C TicketBatch
|
||||
B4D44CC3111ADD964E846FC57760C8B50FFCD5A82C86A72756F6B058DDDF96AD fix1201
|
||||
89308AF3B8B10B7192C4E613E1D2E4D9BA64B2EE2D5232402AE82A6A7220D953 fixQualityUpperBound
|
||||
3012E8230864E95A58C60FD61430D7E1B4D3353195F2981DC12B0C7C0950FFAC FlowCross
|
||||
DC9CA96AEA1DCF83E527D1AFC916EFAF5D27388ECA4060A88817C1238CAEE0BF EnforceInvariants
|
||||
B9E739B8296B4A1BB29BE990B17D66E21B62A300A909F25AC55C22D6C72E1F9D fix1523
|
||||
1F4AFA8FA1BC8827AD4C0F682C03A8B671DCDF6B5C4DE36D44243A684103EF88 HardenedValidations
|
||||
3CBC5C4E630A1B82380295CDA84B32B49DD066602E74E39B85EF64137FA65194 DepositPreauth
|
||||
586480873651E106F1D6339B0C4A8945BA705A777F3F4524626FF1FC07EFE41D MultiSignReserve
|
||||
58BE9B5968C4DA7C59BA900961828B113E5490699B21877DEF9A31E9D0FE5D5F fix1623
|
||||
42426C4D4F1009EE67080A9B7965B44656D7714D104A72F9B4369F97ABF044EE FeeEscalation
|
||||
08DE7D96082187F6E6578530258C77FAABABE4C20474BDB82F04B021F1A68647 PayChan
|
||||
67A34F2CF55BFC0F93AACD5B281413176FEE195269FA6D95219A2DF738671172 fix1513
|
||||
00C1FC4A53E60AB02C864641002B3172F38677E29C26C5406685179B37E1EDAC RequireFullyCanonicalSig
|
||||
CA7C02118BA27599528543DFE77BA6838D1B0F43B447D4D7F53523CE6A0E9AC2 fix1543
|
||||
532651B4FD58DF8922A49BA101AB3E996E5BFBF95A913B3E392504863E63B164 TickSize
|
||||
25BA44241B3BD880770BFA4DA21C7180576831855368CBEC6A3154FDE4A7676E fix1781
|
||||
8F81B066ED20DAECA20DF57187767685EEF3980B228E0667A650BAF24426D3B4 fixCheckThreading
|
||||
5D08145F0A4983F23AFFFF514E83FAD355C5ABFBB6CAB76FB5BC8519FF5F33BE fix1515
|
||||
1562511F573A19AE9BD103B5D6B9E01B3B46805AEC5D3C4805C902B514399146 CryptoConditions
|
||||
1D3463A5891F9E589C5AE839FFAC4A917CE96197098A1EF22304E1BC5B98A454 fix1528
|
||||
621A0B264970359869E3C0363A899909AAB7A887C8B73519E4ECF952D33258A8 fixPayChanRecipientOwnerDir
|
||||
CC5ABAE4F3EC92E94A59B1908C2BE82D2228B6485C00AFF8F22DF930D89C194E SortedDirectories
|
||||
FBD513F1B893AC765B78F250E6FFA6A11B573209D1842ADC787C850696741288 fix1578
|
||||
7117E2EC2DBF119CA55181D69819F1999ECEE1A0225A7FD2B9ED47940968479C fix1571
|
||||
4F46DF03559967AC60F2EB272FEFE3928A7594A45FF774B87A7E540DB0F8F068 fixAmendmentMajorityCalc
|
||||
2CD5286D8D687E98B41102BDD797198E81EA41DF7BD104E6561FEB104EFF2561 fixTakerDryOfferRemoval
|
||||
C4483A1896170C66C098DEA5B0E024309C60DC960DE5F01CD7AF986AA3D9AD37 fixMasterKeyAsRegularKey
|
||||
740352F2412A9909880C23A559FCECEDA3BE2126FED62FC7660D628A06927F11 Flow
|
||||
07D43DCE529B15A10827E5E04943B496762F9A88E3268269D69C44BE49E21104 Escrow
|
||||
6781F8368C4771B83E8B821D88F580202BCB4228075297B19E4FDC5233F1EFDC TrustSetAuth
|
||||
30CD365592B8EE40489BA01AE2F7555CAC9C983145871DC82A42A31CF5BAE7D9 DeletableAccounts
|
||||
F64E1EABBE79D55B3BB82020516CEC2C582A98A6BFE20FBE9BB6A0D233418064 DepositAuth
|
||||
E2E6F2866106419B88C50045ACE96368558C345566AC8F2BDF5A5B5587F0E6FA fix1368
|
||||
6C92211186613F9647A89DFFBAB8F94C99D4C7E956D495270789128569177DA1 fix1512
|
||||
42EEA5E28A97824821D4EF97081FE36A54E9593C6E4F20CBAE098C69D2E072DC fix1373
|
||||
4C97EBA926031A7CF7D7B36FDE3ED66DDA5421192D63DE53FFB46E43B9DC8373 MultiSign
|
||||
157D2D480E006395B76F948E3E07A45A05FE10230D88A7993C71F97AE4B1F2D1 Checks
|
||||
32A122F1352A4C7B3A6D790362CC34749C5E57FCE896377BFDC6CCD14F6CD627 NonFungibleTokensV1_1
|
||||
NegativeUNL
|
||||
fixRemoveNFTokenAutoTrustLine
|
||||
NonFungibleTokensV1
|
||||
CheckCashMakesTrustLine
|
||||
fixRmSmallIncreasedQOffers
|
||||
fixSTAmountCanonicalize
|
||||
FlowSortStrands
|
||||
TicketBatch
|
||||
fix1201
|
||||
fixQualityUpperBound
|
||||
FlowCross
|
||||
EnforceInvariants
|
||||
fix1523
|
||||
HardenedValidations
|
||||
DepositPreauth
|
||||
MultiSignReserve
|
||||
fix1623
|
||||
FeeEscalation
|
||||
PayChan
|
||||
fix1513
|
||||
RequireFullyCanonicalSig
|
||||
fix1543
|
||||
TickSize
|
||||
fix1781
|
||||
fixCheckThreading
|
||||
fix1515
|
||||
CryptoConditions
|
||||
fix1528
|
||||
fixPayChanRecipientOwnerDir
|
||||
SortedDirectories
|
||||
fix1578
|
||||
fix1571
|
||||
fixAmendmentMajorityCalc
|
||||
fixTakerDryOfferRemoval
|
||||
fixMasterKeyAsRegularKey
|
||||
Flow
|
||||
Escrow
|
||||
TrustSetAuth
|
||||
DeletableAccounts
|
||||
DepositAuth
|
||||
fix1368
|
||||
fix1512
|
||||
fix1373
|
||||
MultiSign
|
||||
Checks
|
||||
NonFungibleTokensV1_1
|
||||
# 1.10.0 Amendments
|
||||
47C3002ABA31628447E8E9A8B315FAA935CE30183F9A9B86845E469CA2CDC3DF DisallowIncoming
|
||||
73761231F7F3D94EC3D8C63D91BDD0D89045C6F71B917D1925C01253515A6669 fixNonFungibleTokensV1_2
|
||||
F1ED6B4A411D8B872E65B9DCB4C8B100375B0DD3D62D07192E011D6D7F339013 fixTrustLinesToSelf
|
||||
2E2FB9CF8A44EB80F4694D38AADAE9B8B7ADAFD2F092E10068E61C98C4F092B0 fixUniversalNumber
|
||||
75A7E01C505DD5A179DFE3E000A9B6F1EDDEB55A12F95579A23E15B15DC8BE5A ImmediateOfferKilled
|
||||
93E516234E35E08CA689FA33A6D38E103881F8DCB53023F728C307AA89D515A7 XRPFees
|
||||
DisallowIncoming
|
||||
fixNonFungibleTokensV1_2
|
||||
fixTrustLinesToSelf
|
||||
fixUniversalNumber
|
||||
ImmediateOfferKilled
|
||||
XRPFees
|
||||
# 1.11.0 Amendments
|
||||
B2A4DB846F0891BF2C76AB2F2ACC8F5B4EC64437135C6E56F3F859DE5FFD5856 ExpandedSignerList
|
||||
# 1.12.0-b1 Amendments
|
||||
56B241D7A43D40354D02A9DC4C8DF5C7A1F930D92A9035C4E12291B3CA3E1C2B featureClawback
|
||||
27CD95EE8E1E5A537FF2F89B6CEB7C622E78E9374EBD7DCBEDFAE21CD6F16E0A fixReducedOffersV1
|
||||
# Added August 9th, 2023
|
||||
AE35ABDEFBDE520372B31C957020B34A7A4A9DC3115A69803A44016477C84D6E fixNFTokenRemint
|
||||
ExpandedSignerList
|
||||
# 1.12.0 Amendments
|
||||
Clawback
|
||||
fixReducedOffersV1
|
||||
fixNFTokenRemint
|
||||
# 2.0.0-b1 Amendments
|
||||
XChainBridge
|
||||
|
||||
7
.github/workflows/nodejs.yml
vendored
7
.github/workflows/nodejs.yml
vendored
@@ -9,6 +9,9 @@ on:
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
RIPPLED_DOCKER_IMAGE: rippleci/rippled:2.0.0-b3
|
||||
|
||||
jobs:
|
||||
build-and-lint:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -105,7 +108,7 @@ jobs:
|
||||
|
||||
- name: Run docker in background
|
||||
run: |
|
||||
docker run --detach --rm --name rippled-service -p 6006:6006 --volume "${{ github.workspace }}/.ci-config/":"/config/" --health-cmd="wget localhost:6006 || exit 1" --health-interval=5s --health-retries=10 --health-timeout=2s --env "ENV_ARGS=-a --start" --env GITHUB_ACTIONS=true --env CI=true xrpllabsofficial/xrpld:1.12.0-b1
|
||||
docker run --detach --rm --name rippled-service -p 6006:6006 --volume "${{ github.workspace }}/.ci-config/":"/opt/ripple/etc/" --health-cmd="wget localhost:6006 || exit 1" --health-interval=5s --health-retries=10 --health-timeout=2s --env GITHUB_ACTIONS=true --env CI=true ${{ env.RIPPLED_DOCKER_IMAGE }} /opt/ripple/bin/rippled -a --conf /opt/ripple/etc/rippled.cfg
|
||||
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v3
|
||||
@@ -162,7 +165,7 @@ jobs:
|
||||
|
||||
- name: Run docker in background
|
||||
run: |
|
||||
docker run --detach --rm --name rippled-service -p 6006:6006 --volume "${{ github.workspace }}/.ci-config/":"/config/" --health-cmd="wget localhost:6006 || exit 1" --health-interval=5s --health-retries=10 --health-timeout=2s --env "ENV_ARGS=-a --start" --env GITHUB_ACTIONS=true --env CI=true xrpllabsofficial/xrpld:1.12.0-b1
|
||||
docker run --detach --rm --name rippled-service -p 6006:6006 --volume "${{ github.workspace }}/.ci-config/":"/opt/ripple/etc/" --health-cmd="wget localhost:6006 || exit 1" --health-interval=5s --health-retries=10 --health-timeout=2s --env GITHUB_ACTIONS=true --env CI=true ${{ env.RIPPLED_DOCKER_IMAGE }} /opt/ripple/bin/rippled -a --conf /opt/ripple/etc/rippled.cfg
|
||||
|
||||
- name: Setup npm version 9
|
||||
run: |
|
||||
|
||||
@@ -47,7 +47,7 @@ npm run lint
|
||||
|
||||
## Running Tests
|
||||
|
||||
For integration and browser tests, we use a `rippled` node in standalone mode to test xrpl.js code against. To set this up, you can either configure and run `rippled` locally, or set up the Docker container `xrpllabsofficial/xrpld:1.12.0-b1` by [following these instructions](#integration-tests). The latter will require you to [install Docker](https://docs.docker.com/get-docker/).
|
||||
For integration and browser tests, we use a `rippled` node in standalone mode to test xrpl.js code against. To set this up, you can either configure and run `rippled` locally, or set up the Docker container `rippleci/rippled` by [following these instructions](#integration-tests). The latter will require you to [install Docker](https://docs.docker.com/get-docker/).
|
||||
|
||||
### Unit Tests
|
||||
|
||||
@@ -64,7 +64,7 @@ From the top-level xrpl.js folder (one level above `packages`), run the followin
|
||||
```bash
|
||||
npm install
|
||||
# sets up the rippled standalone Docker container - you can skip this step if you already have it set up
|
||||
docker run -p 6006:6006 --interactive -t --volume $PWD/.ci-config:/config/ xrpllabsofficial/xrpld:1.12.0-b1 -a --start
|
||||
docker run -p 6006:6006 --interactive -t --volume $PWD/.ci-config:/opt/ripple/etc/ --platform linux/amd64 rippleci/rippled:2.0.0-b3 /opt/ripple/bin/rippled -a --conf /opt/ripple/etc/rippled.cfg
|
||||
npm run build
|
||||
npm run test:integration
|
||||
```
|
||||
@@ -74,9 +74,8 @@ Breaking down the command:
|
||||
* `--interactive` allows you to interact with the container.
|
||||
* `-t` starts a terminal in the container for you to send commands to.
|
||||
* `--volume $PWD/.ci-config:/config/` identifies the `rippled.cfg` and `validators.txt` to import. It must be an absolute path, so we use `$PWD` instead of `./`.
|
||||
* `xrpllabsofficial/1.12.0-b1` is an image that is regularly updated with the latest `rippled` releases and can be found here: https://github.com/WietseWind/docker-rippled
|
||||
* `-a` starts `rippled` in standalone mode
|
||||
* `--start` signals to start `rippled` with the specified amendments in `rippled.cfg` enabled immediately instead of voting for 2 weeks on them.
|
||||
* `rippleci/rippled` is an image that is regularly updated with the latest `rippled` releases
|
||||
* `/opt/ripple/bin/rippled -a --conf /opt/ripple/etc/rippled.cfg` starts `rippled` in standalone mode
|
||||
|
||||
### Browser Tests
|
||||
|
||||
@@ -91,7 +90,7 @@ This should be run from the `xrpl.js` top level folder (one above the `packages`
|
||||
```bash
|
||||
npm run build
|
||||
# sets up the rippled standalone Docker container - you can skip this step if you already have it set up
|
||||
docker run -p 6006:6006 -it -v $PWD/.ci-config:/config/ xrpllabsofficial/1.12.0-b1 -a --start
|
||||
docker run -p 6006:6006 --interactive -t --volume $PWD/.ci-config:/opt/ripple/etc/ --platform linux/amd64 rippleci/rippled:2.0.0-b3 /opt/ripple/bin/rippled -a --conf /opt/ripple/etc/rippled.cfg
|
||||
npm run test:browser
|
||||
```
|
||||
|
||||
|
||||
@@ -156,7 +156,7 @@ describe('subscribe', function () {
|
||||
const ledgerResponse: LedgerStreamResponse =
|
||||
response.result as LedgerStreamResponse
|
||||
// Explicitly checking that there are only known fields in the return
|
||||
const expectedResult = {
|
||||
const expectedResult: LedgerStreamResponse = {
|
||||
fee_base: ledgerResponse.fee_base,
|
||||
ledger_hash: ledgerResponse.ledger_hash,
|
||||
ledger_index: ledgerResponse.ledger_index,
|
||||
@@ -165,6 +165,9 @@ describe('subscribe', function () {
|
||||
reserve_inc: ledgerResponse.reserve_inc,
|
||||
validated_ledgers: ledgerResponse.validated_ledgers,
|
||||
}
|
||||
if (ledgerResponse.fee_ref) {
|
||||
expectedResult.fee_ref = ledgerResponse.fee_ref
|
||||
}
|
||||
assert.equal(response.type, 'response')
|
||||
assert.deepEqual(response.result, expectedResult)
|
||||
|
||||
|
||||
@@ -191,6 +191,7 @@ export async function verifySubmittedTransaction(
|
||||
'ledger_index',
|
||||
'meta',
|
||||
'validated',
|
||||
'ctid',
|
||||
]),
|
||||
typeof tx === 'string' ? decode(tx) : tx,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user