This repository was archived by the owner on Feb 17, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
md file #179
Open
fabriziogianni7
wants to merge
7
commits into
tutorials
Choose a base branch
from
getting-started-md
base: tutorials
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
md file #179
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| # Nevermined SDK Tutorial | ||
|
|
||
| ## Overview | ||
|
|
||
| This tutorial demonstrates a basic example of using the Nevermined SDK to interact with the Nevermined network. The provided code, written in TypeScript, initializes the SDK, configures it, and retrieves information about SDK versions. | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| Ensure you have the following installed: | ||
|
|
||
| - Node.js | ||
| - npm (Node Package Manager) | ||
fabriziogianni7 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ## Setup | ||
|
|
||
| 1. Install the Nevermined SDK package: | ||
|
|
||
| ```bash | ||
| npm install @nevermined-io/sdk | ||
|
|
||
| 2. Create a TypeScript file (e.g., main.ts) and paste the following code: | ||
| ```bash | ||
| import { Nevermined, NeverminedOptions } from '@nevermined-io/sdk' | ||
|
|
||
| const main = async () => { | ||
| const config: NeverminedOptions = { | ||
| // The web3 endpoint of the blockchain network to connect to, could be an Infura endpoint, Quicknode, or any other web3 provider | ||
| web3ProviderUri: 'https://goerli-rollup.arbitrum.io/rpc', | ||
| // The url of the marketplace api if you connect to one. It could be your own service if you run a Marketplace API | ||
| marketplaceUri: 'https://marketplace-api.goerli.nevermined.app', | ||
| // The url to a Nevermined node. It could be your own if you run a Nevermined Node | ||
| neverminedNodeUri: 'https://node.goerli.nevermined.app', | ||
| // The public address of the above Node | ||
| neverminedNodeAddress: '0x5838B5512cF9f12FE9f2beccB20eb47211F9B0bc', | ||
| // The url to access the nevermined subgraphs required to query for on-chain events | ||
| graphHttpUri: 'https://api.thegraph.com/subgraphs/name/nevermined-io/public', | ||
| // Folder where are copied the ABIs of the Nevermined Smart Contracts | ||
| artifactsFolder: './artifacts', | ||
| } | ||
|
|
||
| const sdk = await Nevermined.getInstance(config) | ||
| console.log(await sdk.utils.versions.get()) | ||
| } | ||
|
|
||
| main().then(() => process.exit(0)) | ||
| ``` | ||
|
|
||
| ## Running the Code | ||
| Execute the following command to run the TypeScript file: | ||
|
|
||
| npm install @nevermined-io/sdk | ||
|
|
||
|
|
||
fabriziogianni7 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| This will initialize the Nevermined SDK, configure it with the specified options, and output information about SDK versions. | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.