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 2.0 - How Tos - Client #1510

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/build/iota-sdk/2.0/docs/_admonitions/_account-client.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
:::tip Client in Wallet

If you are using a wallet you can always get the client by calling the `client()`/`getClient()`/`get_client()` method

:::
7 changes: 7 additions & 0 deletions docs/build/iota-sdk/2.0/docs/_admonitions/_edit_dot_env.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

:::info .env

Make sure you copy the `.env.example` file in the examples directory to `.env` and edit any values you see fit before
running the examples.

:::
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
:::warning Safe Password Storage

In a production setup, do not store passwords in the host's environment variables or in the source code. See
our [backup and security recommendations](/introduction/stardust/how_tos/backup_security) for
production setups.

:::
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
```json
{
name: 'iota-core',
version: '1.0.0-alpha.8',
status: {
isHealthy: true,
acceptedTangleTime: '1708628528546618200',
relativeAcceptedTangleTime: '1708628528758643341',
confirmedTangleTime: '1708628528546618200',
relativeConfirmedTangleTime: '1708628528755227042',
latestCommitmentId: '0xeb6cd4628d84672db3598f89737b742355dac0d606be0013ff29a08a785458b2e60c0000',
latestFinalizedSlot: 3302,
latestAcceptedBlockSlot: 3305,
latestConfirmedBlockSlot: 3305,
pruningEpoch: 0
},
metrics: {
blocksPerSecond: '32',
confirmedBlocksPerSecond: '32',
confirmationRate: '100'
},
protocolParameters: [ { parameters: [Object], startEpoch: 0 } ],
baseToken: {
name: 'RMS',
tickerSymbol: 'RMS',
unit: 'RMS',
subunit: 'glow',
decimals: 6
}
}
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
```json
{
"name": "iota-core",
"version": "1.0.0-alpha.8",
"status": {
"is_healthy": true,
"accepted_tangle_time": 1708628022003812788,
"relative_accepted_tangle_time": 1708628022260355411,
"confirmed_tangle_time": 1708628022003812788,
"relative_confirmed_tangle_time": 1708628022255670879,
"latest_commitment_id": "0x697da80c29ef67feb807585d2a02daf25eb5dd76937ce07fa7215f905f087b93b30c0000",
"latest_finalized_slot": 3251,
"latest_accepted_block_slot": 3254,
"latest_confirmed_block_slot": 3254,
"pruning_epoch": 0
},
"metrics": {
"blocks_per_second": 32.0,
"confirmed_blocks_per_second": 31.8,
"confirmation_rate": 99.375
},
"protocol_parameters": [
{
"start_epoch": 0,
"parameters": {
"type": 0,
"version": 3,
"network_name": "docker-1708595536",
"bech32_hrp": "rms",
"storage_score_parameters": {
"storage_cost": 100,
"factor_data": 1,
"offset_output_overhead": 10,
"offset_ed25519_block_issuer_key": 100,
"offset_staking_feature": 100,
"offset_delegation": 100
},
"work_score_parameters": {
"data_byte": 500,
"block": 110000,
"input": 7500,
"context_input": 40000,
"output": 90000,
"native_token": 50000,
"staking": 40000,
"block_issuer": 70000,
"allotment": 5000,
"signature_ed25519": 15000
},
"mana_parameters": {
"bits_count": 63,
"generation_rate": 1,
"generation_rate_exponent": 17,
"decay_factors": [
4290989755,
...,
],
"decay_factors_exponent": 32,
"decay_factor_epochs_sum": 2262417561,
"decay_factor_epochs_sum_exponent": 21,
"annual_decay_factor_percentage": 70
},
"token_supply": 1813620509061365,
"genesis_slot": 5,
"genesis_unix_timestamp": 1708595536,
"slot_duration_in_seconds": 10,
"slots_per_epoch_exponent": 13,
"staking_unbonding_period": 10,
"validation_blocks_per_slot": 10,
"punishment_epochs": 10,
"liveness_threshold_lower_bound": 10,
"liveness_threshold_upper_bound": 15,
"min_committable_age": 3,
"max_committable_age": 6,
"epoch_nearing_threshold": 8,
"congestion_control_parameters": {
"min_reference_mana_cost": 1,
"increase": 1,
"decrease": 1,
"increase_threshold": 400000000,
"decrease_threshold": 250000000,
"scheduler_rate": 50000000,
"max_buffer_size": 1000,
"max_validation_buffer_size": 100
},
"version_signaling_parameters": {
"window_size": 7,
"window_target_ratio": 5,
"activation_offset": 7
},
"rewards_parameters": {
"profit_margin_exponent": 8,
"bootstrapping_duration": 1079,
"reward_to_generation_ratio": 2,
"initial_target_rewards_rate": 616067521149261,
"final_target_rewards_rate": 226702563632670,
"pool_coefficient_exponent": 11,
"retention_period": 384
},
"target_committee_size": 32,
"chain_switching_threshold": 3
}
}
],
"base_token": {
"name": "RMS",
"ticker_symbol": "RMS",
"unit": "RMS",
"decimals": 6,
"subunit": "glow"
}
}
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
```json
{
"name": "iota-core",
"version": "1.0.0-alpha.8",
"status": {
"isHealthy": true,
"acceptedTangleTime": "1708627911633941263",
"relativeAcceptedTangleTime": "1708627911848677178",
"confirmedTangleTime": "1708627911633941263",
"relativeConfirmedTangleTime": "1708627911843992606",
"latestCommitmentId": "0x58b3fd243d97bb3d31e50d7f71516b83071ab1294222ef1f33772df92bbc950da80c0000",
"latestFinalizedSlot": 3240,
"latestAcceptedBlockSlot": 3243,
"latestConfirmedBlockSlot": 3243,
"pruningEpoch": 0
},
"metrics": {
"blocksPerSecond": "32",
"confirmedBlocksPerSecond": "32.1",
"confirmationRate": "100.3125"
},
"protocolParameters": [
{
"parameters": {
"type": 0,
"version": 3,
"networkName": "docker-1708595536",
"bech32Hrp": "rms",
"storageScoreParameters": {
"storageCost": "100",
"factorData": 1,
"offsetOutputOverhead": "10",
"offsetEd25519BlockIssuerKey": "100",
"offsetStakingFeature": "100",
"offsetDelegation": "100"
},
"workScoreParameters": {
"dataByte": 500,
"block": 110000,
"input": 7500,
"contextInput": 40000,
"output": 90000,
"nativeToken": 50000,
"staking": 40000,
"blockIssuer": 70000,
"allotment": 5000,
"signatureEd25519": 15000
},
"manaParameters": {
"bitsCount": 63,
"generationRate": 1,
"generationRateExponent": 17,
"decayFactors": [
4290989755,
...,
],
"decayFactorsExponent": 32,
"decayFactorEpochsSum": 2262417561,
"decayFactorEpochsSumExponent": 21,
"annualDecayFactorPercentage": 70
},
"tokenSupply": "1813620509061365",
"genesisSlot": 5,
"genesisUnixTimestamp": "1708595536",
"slotDurationInSeconds": 10,
"slotsPerEpochExponent": 13,
"stakingUnbondingPeriod": 10,
"validationBlocksPerSlot": 10,
"punishmentEpochs": 10,
"livenessThresholdLowerBound": 10,
"livenessThresholdUpperBound": 15,
"minCommittableAge": 3,
"maxCommittableAge": 6,
"epochNearingThreshold": 8,
"congestionControlParameters": {
"minReferenceManaCost": "1",
"increase": "1",
"decrease": "1",
"increaseThreshold": 400000000,
"decreaseThreshold": 250000000,
"schedulerRate": 50000000,
"maxBufferSize": 1000,
"maxValidationBufferSize": 100
},
"versionSignalingParameters": {
"windowSize": 7,
"windowTargetRatio": 5,
"activationOffset": 7
},
"rewardsParameters": {
"profitMarginExponent": 8,
"bootstrappingDuration": 1079,
"rewardToGenerationRatio": 2,
"initialTargetRewardsRate": "616067521149261",
"finalTargetRewardsRate": "226702563632670",
"poolCoefficientExponent": 11,
"retentionPeriod": 384
},
"targetCommitteeSize": 32,
"chainSwitchingThreshold": 3
},
"startEpoch": 0
}
],
"baseToken": {
"name": "RMS",
"tickerSymbol": "RMS",
"unit": "RMS",
"subunit": "glow",
"decimals": 6
}
}
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
```json
First output of query:
ID: 0x20b4a5998917561e90f89c232aaf92b620703e48880abec5417d31de387e6f1ec39500000000
OutputResponse {
output: BasicOutput {
type: 0,
amount: '1000000000',
unlockConditions: [ [AddressUnlockCondition] ],
mana: '1000'
},
metadata: {
outputId: '0x20b4a5998917561e90f89c232aaf92b620703e48880abec5417d31de387e6f1ec39500000000',
blockId: '0x48950030b7828b40c9f90dfe645b5fa677a2700d055d486424682920edef6379c6950000',
included: {
slot: 38342,
transactionId: '0x20b4a5998917561e90f89c232aaf92b620703e48880abec5417d31de387e6f1ec3950000',
commitmentId: '0x04deb8da1217e3d1221b4451e3bc438ac20f6342d0851871f6bb73e132dab3aec6950000'
},
latestCommitmentId: '0xd26c15b6113bfad7510392d306bada36e01eb022be46307b8ab0783ee257411d02800100'
}
}
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
```json
First output of query:
ID: OutputId {
id: "0x20b4a5998917561e90f89c232aaf92b620703e48880abec5417d31de387e6f1ec39500000000",
transaction_id: TransactionId {
id: "0x20b4a5998917561e90f89c232aaf92b620703e48880abec5417d31de387e6f1ec3950000",
slot_index: SlotIndex(
38339,
),
},
output_index: 0,
}
OutputResponse {
output: BasicOutput {
amount: 1000000000,
mana: 1000,
unlock_conditions: UnlockConditions(
[
AddressUnlockCondition(
Ed25519Address(0x7ffec9e1233204d9c6dce6812b1539ee96af691ca2e4d9065daa85907d33e5d3),
),
],
),
features: Features(
[],
),
},
output_id_proof: OutputIdProof {
slot: SlotIndex(
38339,
),
output_index: 0,
transaction_commitment: "0x94fc67bc63c988fba38587f83cb45a0e3bf806cff17f73567701ae15c6b6701a",
output_commitment_proof: HashableNode(
HashableNode {
kind: 0,
l: ValueHash(
ValueHash {
kind: 2,
hash: [
86,
...
],
},
),
r: LeafHash(
LeafHash {
kind: 1,
hash: [
10,
...
],
},
),
},
),
},
}
```