Skip to content

Commit

Permalink
Merge branch 'dev' into renovate/ui-non-major-dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
pbennett authored Sep 11, 2024
2 parents b8c67af + 69712c4 commit e8cef50
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 58 deletions.
26 changes: 10 additions & 16 deletions contracts/bootstrap/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,39 +12,35 @@ import { StakingPoolClient } from '../contracts/clients/StakingPoolClient'
import { ValidatorRegistryClient } from '../contracts/clients/ValidatorRegistryClient'

function getNetworkConfig(network: string): [AlgoClientConfig, bigint, string] {
let nfdRegistryAppID: bigint
let registryAppID: bigint
let feeSink: string
switch (network) {
case 'devnet':
case 'localnet':
nfdRegistryAppID = 0n
registryAppID = 0n
feeSink = 'A7NMWS3NT3IUDMLVO26ULGXGIIOUQ3ND2TXSER6EBGRZNOBOUIQXHIBGDE'
return [ClientManager.getConfigFromEnvironmentOrLocalNet().algodConfig, nfdRegistryAppID, feeSink]
case 'fnet':
nfdRegistryAppID = 0n
feeSink = 'FEESINK7OJKODDB5ZB4W2SRYPUSTOTK65UDCUYZ5DB4BW3VOHDHGO6JUNE'
break
return [ClientManager.getConfigFromEnvironmentOrLocalNet().algodConfig, registryAppID, feeSink]
case 'betanet':
nfdRegistryAppID = 842656530n
registryAppID = 842656530n
feeSink = 'A7NMWS3NT3IUDMLVO26ULGXGIIOUQ3ND2TXSER6EBGRZNOBOUIQXHIBGDE'
break
case 'testnet':
nfdRegistryAppID = 84366825n
registryAppID = 84366825n
feeSink = 'A7NMWS3NT3IUDMLVO26ULGXGIIOUQ3ND2TXSER6EBGRZNOBOUIQXHIBGDE'
break
case 'mainnet':
nfdRegistryAppID = 760937186n
registryAppID = 760937186n
feeSink = 'Y76M3MSY6DKBRHBL7C3NNDXGS5IIMQVQVUAB6MP4XEMMGVF2QWNPL226CA'
break
default:
throw new Error(`Unsupported network network: ${network}`)
}
const config = {
server: `https://${network}-api.4160.nodely.dev/`,
server: `https://${network}-api.algonode.cloud/`,
port: 443,
} as AlgoClientConfig

return [config, nfdRegistryAppID, feeSink]
return [config, registryAppID, feeSink]
}

/**
Expand Down Expand Up @@ -84,20 +80,18 @@ function createViteEnvFileForLocalnet(validatorAppId: number | bigint): void {
async function main() {
const args = await yargs.option('network', {
default: 'localnet',
choices: ['localnet', 'fnet', 'betanet', 'testnet', 'mainnet'],
choices: ['localnet', 'betanet', 'testnet', 'mainnet'],
demandOption: true,
}).argv

console.log(`Network:${args.network}`)
const [algodConfig, registryAppID, feeSink] = getNetworkConfig(args.network)

// default to localnet
let algorand: AlgorandClient = AlgorandClient.defaultLocalNet()
// let compileClient: AlgorandClient
if (args.network !== 'localnet') {
algorand = AlgorandClient.fromConfig({ algodConfig, indexerConfig: undefined, kmdConfig: undefined })
}
console.log(`algo config is:${JSON.stringify(algodConfig)}`)
// const algorand = algokit.AlgorandClient.fromConfig({ algodConfig: algodconfig, kmdConfig })

let creatorAcct: Account

Expand Down
2 changes: 1 addition & 1 deletion contracts/bootstrap/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bootstrap",
"version": "0.9.9",
"version": "1.0.0",
"description": "",
"main": "index.ts",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion contracts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "reti-contracts",
"version": "0.9.9",
"version": "1.0.0",
"license": "MIT",
"scripts": {
"generate-client": "algokit generate client contracts/artifacts/ --language typescript --output contracts/clients/{contract_name}Client.ts && ./update_contract_artifacts.sh",
Expand Down
2 changes: 1 addition & 1 deletion nodemgr/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func (ac *RetiApp) initClients(ctx context.Context, cmd *cli.Command) error {
}
// quick validity check on possible network names...
switch network {
case "sandbox", "fnet", "betanet", "testnet", "mainnet", "voitestnet":
case "sandbox", "betanet", "testnet", "mainnet", "voitestnet":
default:
return fmt.Errorf("unknown network:%s", network)
}
Expand Down
4 changes: 0 additions & 4 deletions nodemgr/internal/lib/algo/networks.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,6 @@ func getDefaults(network string) NetworkConfig {
cfg.RetiAppID = 2019373722
cfg.NFDAPIUrl = "https://api.betanet.nf.domains"
cfg.NodeURL = "https://betanet-api.algonode.cloud"
case "fnet":
cfg.RetiAppID = 3221
cfg.NFDAPIUrl = "https://api.betanet.nf.domains"
cfg.NodeURL = "https://fnet-api.4160.nodely.dev"
case "sandbox":
cfg.RetiAppID = 0 // should come from .env.sandbox !!
cfg.NFDAPIUrl = "https://api.testnet.nf.domains"
Expand Down
31 changes: 0 additions & 31 deletions ui/.env.template
Original file line number Diff line number Diff line change
Expand Up @@ -73,37 +73,6 @@ VITE_NFD_REGISTRY_APP_ID=84366825
VITE_RETI_APP_ID=673404372


# ========================
# fnet configuration:
# ========================

VITE_ENVIRONMENT=local

# Algod
VITE_ALGOD_TOKEN=""
VITE_ALGOD_SERVER="https://fnet-api.4160.nodely.dev/"
VITE_ALGOD_PORT=""
VITE_ALGOD_NETWORK="fnet"

# Indexer
VITE_INDEXER_TOKEN=""
VITE_INDEXER_SERVER="https://fnet-idx.4160.nodely.dev/"
VITE_INDEXER_PORT=""

# Block Explorer
VITE_EXPLORER_ACCOUNT_URL=https://lora.algokit.io/fnet/account/
VITE_EXPLORER_TRANSACTION_URL=https://lora.algokit.io/fnet/transaction/
VITE_EXPLORER_ASSET_URL=https://lora.algokit.io/fnet/asset/
VITE_EXPLORER_APPLICATION_URL=https://lora.algokit.io/fnet/application/

# NFDomains
VITE_NFD_API_URL=https://api.testnet.nf.domains
VITE_NFD_APP_URL=https://app.testnet.nf.domains
VITE_NFD_REGISTRY_APP_ID=84366825

# Reti
VITE_RETI_APP_ID=3221

# ========================
# MainNet configuration:
# ========================
Expand Down
3 changes: 1 addition & 2 deletions ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "reti-ui",
"version": "0.9.9",
"version": "1.0.0",
"private": true,
"type": "module",
"engines": {
Expand Down Expand Up @@ -96,7 +96,6 @@
"dev:localnet": "vite --mode localnet --port 5173",
"dev:testnet": "vite --mode testnet --port 5183",
"dev:mainnet": "vite --mode mainnet --port 5193",
"dev:fnet": "vite --mode fnet --port 5203",
"build": "tsc && vite build",
"test": "vitest",
"test:watch": "vitest --watch",
Expand Down
2 changes: 0 additions & 2 deletions ui/src/utils/network/getAlgoClientConfigs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ export function getAlgodNetwork(): NetworkId {
return NetworkId.TESTNET
case 'betanet':
return NetworkId.BETANET
case 'fnet':
return NetworkId.FNET
case 'localnet':
return NetworkId.LOCALNET
default:
Expand Down

0 comments on commit e8cef50

Please sign in to comment.