Skip to content

Commit

Permalink
rmv: mnemonic (#4230)
Browse files Browse the repository at this point in the history
  • Loading branch information
sanchaymittal authored May 16, 2023
1 parent 688c868 commit c6a729b
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 11 deletions.
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

0 comments on commit c6a729b

Please sign in to comment.