Skip to content

Commit

Permalink
feat(2756): rename tigerbeetle to tigerBeetle.
Browse files Browse the repository at this point in the history
  • Loading branch information
koekiebox committed Jun 19, 2024
1 parent f9eb877 commit 88330e7
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/node-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- uses: actions/checkout@v4
- uses: ./.github/workflows/rafiki/env-setup
- run: pnpm --filter backend build:deps
- run: NODE_OPTIONS="--max-old-space-size=4096 --experimental-vm-modules" pnpm --filter backend test:ci
- run: NODE_OPTIONS="--max-old-space-size=4096" pnpm --filter backend test:ci
- name: AsyncAPI extension
run: |
echo "{\"extends\":[\"spectral:oas\",\"spectral:asyncapi\"]}" >> .spectral.json
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/accounting/psql/balance.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe('Balances', (): void => {
let asset: Asset

beforeAll(async (): Promise<void> => {
const deps = initIocContainer({ ...Config, useTigerbeetle: false })
const deps = initIocContainer({ ...Config, useTigerBeetle: false })
appContainer = await createTestApp(deps)
serviceDeps = {
logger: await deps.use('logger'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('Ledger Account', (): void => {
let asset: Asset

beforeAll(async (): Promise<void> => {
const deps = initIocContainer({ ...Config, useTigerbeetle: false })
const deps = initIocContainer({ ...Config, useTigerBeetle: false })
appContainer = await createTestApp(deps)
serviceDeps = {
logger: await deps.use('logger'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('Ledger Transfer', (): void => {
let asset: Asset

beforeAll(async (): Promise<void> => {
const deps = initIocContainer({ ...Config, useTigerbeetle: false })
const deps = initIocContainer({ ...Config, useTigerBeetle: false })
appContainer = await createTestApp(deps)
serviceDeps = {
logger: await deps.use('logger'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('Ledger Transfer Model', (): void => {
let asset: Asset

beforeAll(async (): Promise<void> => {
const deps = initIocContainer({ ...Config, useTigerbeetle: false })
const deps = initIocContainer({ ...Config, useTigerBeetle: false })
appContainer = await createTestApp(deps)
knex = appContainer.knex
})
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/accounting/psql/service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ describe('Psql Accounting Service', (): void => {
let asset: Asset

beforeAll(async (): Promise<void> => {
deps = initIocContainer({ ...Config, useTigerbeetle: false })
deps = initIocContainer({ ...Config, useTigerBeetle: false })
appContainer = await createTestApp(deps)
knex = appContainer.knex
accountingService = await deps.use('accountingService')
Expand Down
8 changes: 4 additions & 4 deletions packages/backend/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,13 +210,13 @@ export function initIocContainer(
const knex = await deps.use('knex')
const config = await deps.use('config')

if (config.useTigerbeetle) {
if (config.useTigerBeetle) {
container.singleton('tigerbeetle', async (deps) => {
const config = await deps.use('config')
return createClient({
cluster_id: BigInt(config.tigerbeetleClusterId),
cluster_id: BigInt(config.tigerBeetleClusterId),
replica_addresses: await parseAndLookupAddresses(
config.tigerbeetleReplicaAddresses
config.tigerBeetleReplicaAddresses
)
})
})
Expand Down Expand Up @@ -535,7 +535,7 @@ export const gracefulShutdown = async (
await knex.destroy()

const config = await container.use('config')
if (config.useTigerbeetle) {
if (config.useTigerBeetle) {
const tigerbeetle = await container.use('tigerbeetle')
tigerbeetle?.destroy()
}
Expand Down
26 changes: 13 additions & 13 deletions packages/backend/src/tests/tigerbeetle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,30 @@ export async function startTigerbeetleContainer(clusterId?: number): Promise<{
container: StartedTestContainer
port: number
}> {
const tigerbeetleClusterId = clusterId || Config.tigerbeetleClusterId
const { name: tigerbeetleDir } = tmp.dirSync({ unsafeCleanup: true })
const tigerbeetleFile = `cluster_${tigerbeetleClusterId}_replica_0_test.tigerbeetle`
const tigerbeetleContainerVersion = 'ghcr.io/tigerbeetle/tigerbeetle:0.15.3'
const tigerBeetleClusterId = clusterId || Config.tigerBeetleClusterId
const { name: tigerBeetleDir } = tmp.dirSync({ unsafeCleanup: true })
const tigerBeetleFile = `cluster_${tigerBeetleClusterId}_replica_0_test.tigerbeetle`
const tigerBeetleContainerVersion = 'ghcr.io/tigerbeetle/tigerbeetle:0.15.3'

const tbContFormat = await new GenericContainer(tigerbeetleContainerVersion)
const tbContFormat = await new GenericContainer(tigerBeetleContainerVersion)
.withExposedPorts(TIGERBEETLE_PORT)
.withBindMounts([
{
source: tigerbeetleDir,
source: tigerBeetleDir,
target: TIGERBEETLE_DIR
}
])
.withAddedCapabilities('IPC_LOCK')
.withCommand([
'format',
'--cluster=' + tigerbeetleClusterId,
'--cluster=' + tigerBeetleClusterId,
'--replica=0',
'--replica-count=1',
`${TIGERBEETLE_DIR}/${tigerbeetleFile}`
`${TIGERBEETLE_DIR}/${tigerBeetleFile}`
])
.withWaitStrategy(
Wait.forLogMessage(
`info(main): 0: formatted: cluster=${tigerbeetleClusterId} replica_count=1`
`info(main): 0: formatted: cluster=${tigerBeetleClusterId} replica_count=1`
)
)
.start()
Expand All @@ -48,23 +48,23 @@ export async function startTigerbeetleContainer(clusterId?: number): Promise<{
.on('end', () => console.log('Stream closed for [tb-format]'))
}

const tbContStart = await new GenericContainer(tigerbeetleContainerVersion)
const tbContStart = await new GenericContainer(tigerBeetleContainerVersion)
.withExposedPorts(TIGERBEETLE_PORT)
.withBindMounts([
{
source: tigerbeetleDir,
source: tigerBeetleDir,
target: TIGERBEETLE_DIR
}
])
.withAddedCapabilities('IPC_LOCK')
.withCommand([
'start',
'--addresses=0.0.0.0:' + TIGERBEETLE_PORT,
`${TIGERBEETLE_DIR}/${tigerbeetleFile}`
`${TIGERBEETLE_DIR}/${tigerBeetleFile}`
])
.withWaitStrategy(
Wait.forLogMessage(
`info(main): 0: cluster=${tigerbeetleClusterId}: listening on 0.0.0.0:${TIGERBEETLE_PORT}`
`info(main): 0: cluster=${tigerBeetleClusterId}: listening on 0.0.0.0:${TIGERBEETLE_PORT}`
)
)
.start()
Expand Down

0 comments on commit 88330e7

Please sign in to comment.