Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove local testnet code #569

Merged
merged 4 commits into from
Mar 23, 2018
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 23 additions & 25 deletions tasks/testnet.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,29 @@ async function get (url) {
async function main () {
let network = process.argv[2] || 'gaia-2'

if (network === 'local') {
runDev('./app/networks/local')
} else {
// fetch genesis.json and config.toml from github testnets repo,
// save to tmp dir and pass to app dev runner
console.log(`fetching genesis for network "${network}"`)
let genesisJson = await get(`https://github.com/tendermint/testnets/raw/master/${network}/gaia/genesis.json`)
.catch(e => {
throw new Error(`Can't load genesis.json: ${e.message}`)
})
let configToml = await get(`https://github.com/tendermint/testnets/raw/master/${network}/gaia/config.toml`)
.catch(e => {
throw new Error(`Can't load config.toml: ${e.message}`)
})
let gaiaVersionTxt = await get(`https://github.com/tendermint/testnets/raw/master/${network}/gaia/gaiaversion.txt`)
.catch(e => {
throw new Error(`Can't load config.toml: ${e.message}`)
})
let path = join(tmpdir(), Math.random().toString(36).slice(2))
mkdirp(path)
write(join(path, 'genesis.json'), genesisJson)
write(join(path, 'config.toml'), configToml)
write(join(path, 'gaiaversion.txt'), gaiaVersionTxt)
runDev(path)
}
// fetch genesis.json and config.toml from github testnets repo,
// save to tmp dir and pass to app dev runner
console.log(`fetching genesis for network "${network}"`)
let genesisJson = await get(`https://github.com/tendermint/testnets/raw/master/${network}/gaia/genesis.json`)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be const genesisJson.

.catch(e => {
throw new Error(`Can't load genesis.json: ${e.message}`)
})
let configToml = await get(`https://github.com/tendermint/testnets/raw/master/${network}/gaia/config.toml`)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const configToml

.catch(e => {
throw new Error(`Can't load config.toml: ${e.message}`)
})
let gaiaVersionTxt = await get(`https://github.com/tendermint/testnets/raw/master/${network}/gaia/gaiaversion.txt`)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const gaiaVersionTxt

.catch(e => {
throw new Error(`Can't load config.toml: ${e.message}`)
})
let path = join(tmpdir(), Math.random().toString(36).slice(2))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const path

mkdirp(path)
write(join(path, 'genesis.json'), genesisJson)
write(join(path, 'config.toml'), configToml)
write(join(path, 'gaiaversion.txt'), gaiaVersionTxt)

// run Voyager in a developmnet environment
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

development

runDev(path)
}

main().catch(function (err) {
Expand Down