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

docs: add configuration.md file #2687

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open

Conversation

ivaylonikolov7
Copy link
Contributor

Description:
Add CONFIGURATION.md file.

Fixes
#2627

Checklist

  • Documented (Code comments, README, etc.)

Signed-off-by: Ivaylo Nikolov <[email protected]>
Signed-off-by: Ivaylo Nikolov <[email protected]>
Signed-off-by: Ivaylo Nikolov <[email protected]>
Signed-off-by: Ivaylo Nikolov <[email protected]>
Signed-off-by: Ivaylo Nikolov <[email protected]>
Signed-off-by: Ivaylo Nikolov <[email protected]>
Signed-off-by: Ivaylo Nikolov <[email protected]>
Signed-off-by: Ivaylo Nikolov <[email protected]>
Signed-off-by: Ivaylo Nikolov <[email protected]>
Signed-off-by: Ivaylo Nikolov <[email protected]>
Signed-off-by: Ivaylo Nikolov <[email protected]>
Signed-off-by: Ivaylo Nikolov <[email protected]>
@ivaylonikolov7 ivaylonikolov7 force-pushed the feat/docs-configuration branch from 4eeece9 to 2cb086e Compare December 8, 2024 20:46
@ivaylonikolov7 ivaylonikolov7 force-pushed the feat/docs-configuration branch from 7d052b7 to 50dea5f Compare December 8, 2024 21:40
@ivaylonikolov7 ivaylonikolov7 marked this pull request as ready for review December 8, 2024 21:40
@ivaylonikolov7 ivaylonikolov7 requested review from a team as code owners December 8, 2024 21:40
Signed-off-by: Ivaylo Nikolov <[email protected]>
Copy link

sonarqubecloud bot commented Dec 8, 2024


To verify which type of key is required, check the example code for the initialization method in the client/wallet. Look for either `fromStringED25519` or `fromStringECDSA`.

_Note that some examples (like the ones that interact with the relay) are designed to work only with ECDSA private keys. _
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe format error here?


### Examples

The examples use both ED25519 and ECDSA keys. These examples come with a pre-filled .env file, so you generally don’t need to make changes. However, if you modify the .env file, ensure the correct type of private key is used.
Copy link
Contributor

Choose a reason for hiding this comment

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

I would emphasize the word .env either by bolding it or formatting it as code.

Comment on lines +77 to +83
### React Native Example

This example uses `fromString`, which internally will try to execute the example with `fromStringED25519`.

### Simple REST Signature Provider

This example behaves the same as the React Native example.
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider including the file path in the examples to make it easier for the user to navigate.

- If local-node has been inactive for a while, it might enter sleep mode. Restarting it is often necessary to rerun tests. This is not an SDK-related issue but is a frequently encountered scenario.
- Always use the `task install` command to install dependencies. Avoid manual installation with npm or yarn, as it can lead to configuration problems.

## Should I have multiple .env files like .env.local, .env.production, .envdevelopment etc?
Copy link
Contributor

Choose a reason for hiding this comment

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

You could give an example what we're doing here—adding environment variables for all networks, commenting out the ones not in use, and leaving only the one needed at the moment.

```javascript
const operatorId = AccountId.fromString("...");
const operatorKey = PrivateKey.generateED25519();
let client = Client.forNetwork().setOperator(operatorId, operatorKey);
Copy link
Contributor

Choose a reason for hiding this comment

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

Use const for consistency across examples.

```

- `setTransportSecurity` - The `setTransportSecurity` method in the Hedera JavaScript SDK is used to enable or disable transport security for the communication between the SDK and the Hedera network nodes. Transport security refers to the mechanisms used to secure the communication channel, typically involving encryption and authentication protocols.
When transport security is enabled, the SDK will establish a secure connection with the Hedera network nodes using protocols like Transport Layer Security (TLS) or its predecessor, Secure Sockets Layer (SSL). This ensures that the data transmitted between the SDK and the nodes is encrypted, protecting it from eavesdropping and tampering. It also provides authentication mechanisms to verify the identity of the nodes and prevent man-in-the-middle attacks.
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's specify that only TLS is being used because that is how it is currently implemented, avoiding any impression that we're uncertain about what is being used.


The setSignOnDemand method in the Hedera JavaScript SDK allows you to configure how transactions are signed before being submitted to the Hedera network. By default, transactions are signed immediately after being constructed. However, in some cases, you may want to delay the signing process until just before the transaction is submitted. This can be useful in scenarios where you need to perform additional operations or validations on the transaction before signing it.

When you call client.setSignOnDemand(true), it instructs the SDK to defer the signing of transactions until the transaction.sign() method is explicitly called. This means that when you create a transaction using the SDK, it will not be signed automatically. Instead, you will need to call transaction.sign() manually before submitting the transaction to the network.
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe present the code examples with "code" formatting for better visualization

### Node Management

- `setMaxNodesPerTransaction` - Set maximum nodes per transaction
This sets the maximum amount of nodes that the transaction will try to execute to.Setting a higher value for setMaxNodesPerTransaction can improve the reliability of transaction execution, but it also increases the network load and the overall cost of the transaction (since you'll be paying transaction fees for each node that executes the transaction).
Copy link
Contributor

Choose a reason for hiding this comment

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

to.Setting typo?


- `setNodeMaxBackoff` - It sets the maximum seconds allowed for the node backoff explained in the previous setting.

- `setNodeMinReadmitPeriod` - Set minimum node readmit period
Copy link
Contributor

Choose a reason for hiding this comment

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

When typo?

client.setLogger(infoLogger);
```

There are different LogLevels: `LogLevel.Info`, ``LogLevel.Silent`, `LogLeve.Trace`, `LogLevel.Debug`, `LogLevel.Warn`, `LogLevel.Error`, `LogLevel.Fatal`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Visualization typo

Copy link
Contributor

@Nana-EC Nana-EC left a comment

Choose a reason for hiding this comment

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

I like the coverage here.
Just suggestions on organization for developer experience and one missing item ut in general this was the missing doc. Thanks


There are different LogLevels: `LogLevel.Info`, ``LogLevel.Silent`, `LogLeve.Trace`, `LogLevel.Debug`, `LogLevel.Warn`, `LogLevel.Error`, `LogLevel.Fatal`.

### Default values:
Copy link
Contributor

Choose a reason for hiding this comment

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

setMaxExecutionTime() is missing


### Default values:

| Key Name | Default Value |
Copy link
Contributor

Choose a reason for hiding this comment

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

I would actually move this to the top right below the table with operator.
As a dev I want to quickly know what all my options are with summaries.
Then I can read further down to dig into details

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants