Skip to content

Commit

Permalink
refactor(devnet): use dev- prefix instead of local-
Browse files Browse the repository at this point in the history
naming the container after the chain id after the container id won't work for now
  • Loading branch information
egasimus committed Jan 19, 2024
1 parent 481e604 commit 26a5c34
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion devnet/devnet-impl.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default async () => {
equal(Impl.initPort({ nodePortMode: 'grpcWeb' }).nodePort, 9091)
equal(Impl.initPort({ nodePortMode: 'rpc' }).nodePort, 26657)
equal(Impl.initChainId({ chainId: 'foo', platform: 'bar' }).chainId, 'foo')
ok(Impl.initChainId({ platform: 'bar' }).chainId.startsWith('local-bar-'))
ok(Impl.initChainId({ platform: 'bar' }).chainId.startsWith('dev-bar-'))

throws(()=>Impl.initChainId({}))

Expand Down
2 changes: 1 addition & 1 deletion devnet/devnet-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export function initChainId (
) {
if (!devnet.chainId) {
if (devnet.platform) {
devnet.chainId = `local-${devnet.platform}-${Core.randomBase16(4).toLowerCase()}`
devnet.chainId = `dev-${devnet.platform}-${Core.randomBase16(4).toLowerCase()}`
} else {
throw new Error('no platform or chainId specified')
}
Expand Down
6 changes: 1 addition & 5 deletions devnet/devnet.init.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,10 @@ import { existsSync, readFileSync, writeFileSync, chmodSync } from 'node:fs'
import { homedir } from 'node:os'
import { resolve } from 'node:path'

const CHAIN_ID = process.argv[2]
if (!CHAIN_ID) {
throw new Error('The chain ID must be passed as first argument to devnet launcher script.')
}

const {
VERBOSE = false,

CHAIN_ID = `dev-${DAEMON}`,
TOKEN = 'unspecified',
ACCOUNTS = '{"init":[]}',
AMOUNT = `1000000000000000000${TOKEN}`,
Expand Down

0 comments on commit 26a5c34

Please sign in to comment.