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

sdk-server cleanup #4230

Merged
merged 1 commit into from
May 16, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 1 addition & 5 deletions packages/examples/sdk-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,20 @@ Create `config.json` or copy `config.json.example` in the root of this package (
"5": {
"provider": ["https://goerli.infura.io/v3/..."]
}
},
"mnemonic": "<add mnemonic here>"
}
}
```

**_OR_**

Create a `.env` in the root of this package (`packages/sdk-server`) with the following keys:

- `NXTP_MNEMONIC`: \_required\* string mnemonic of the wallet you wish to connect with.

- `NXTP_CHAIN_CONFIG`: _required_ Stringified JSON object mapping `chainId` to an array of provider URLs. Example: `'{"4":{"provider":["https://rinkeby.infura.io/v3/"]},"5": {"provider":["https://goerli.infura.io/v3/"]}}'`

- `NXTP_NETWORK`: _optional_ Override default network mainnet to any existing network(local, testnet, mainnet).
- `NXTP_NATS_URL`: _optional_ Override default NATS URL. Example: `ws://localhost:4221`
- `NXTP_AUTH_URL`: _optional_ Override default auth URL. Example: `http://localhost:5040`
- `NXTP_LOG_LEVEL`: _optional_ Override default LogLevel info. Example: `debug`
- `NXTP_MESSAGING_MNEMONIC`: _optional_ Override Random messaging key.
- `NXTP_SKIP_POLLING`: _optional_ skip auction waiting for testing.

## First time setup
Expand Down
1 change: 0 additions & 1 deletion packages/examples/sdk-server/config.json.example
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
}
},
"logLevel": "debug",
"mnemonic": "<YOUR MNEMONIC HERE>",
"environment": "production",
"network": "testnet"
}
6 changes: 1 addition & 5 deletions packages/examples/sdk-server/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,7 @@ export const sdkServer = async (): Promise<FastifyInstance> => {
process.exit(1);
}

const privateKey: string = configJson.privateKey;
const mnemonic: string = configJson.mnemonic;
const signer = privateKey
? new ethers.Wallet(privateKey)
: ethers.Wallet.fromMnemonic(mnemonic) ?? ethers.Wallet.createRandom();
const signer = ethers.Wallet.createRandom();
const signerAddress = await signer.getAddress();

const configuredProviders: Record<string, providers.JsonRpcProvider> = {};
Expand Down