Skip to content

Commit

Permalink
Merge pull request #324 from nevermined-io/feat/integrate-new-sdk
Browse files Browse the repository at this point in the history
SDKv3 adaptation
  • Loading branch information
eruizgar91 authored May 3, 2024
2 parents 13a17ca + 4e0a96a commit 1f5774d
Show file tree
Hide file tree
Showing 39 changed files with 1,550 additions and 1,343 deletions.
3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

3 changes: 2 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"rules": {
"@next/next/no-html-link-for-pages": "off",
"@typescript-eslint/no-explicit-any": "off"
}
},
"ignorePatterns": ["node_modules", "config", "dist", "src/*.d.ts"]
}
2 changes: 1 addition & 1 deletion .github/workflows/push-to-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
build-and-push-to-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.API_TOKEN_GITHUB }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release-github.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ jobs:
runs-on: 'ubuntu-latest'
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.API_TOKEN_GITHUB }}

# Build process
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20
cache: yarn

# Add the artifacts to include in the release
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/testing-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:
steps:
- name: Reclaim some disk space
run: docker system prune --all --volumes -f
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20
- name: Install dependencies
run: |
yarn
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/testing-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20
- name: Install dependencies
run: |
yarn
Expand Down Expand Up @@ -54,7 +54,7 @@ jobs:
IPFS_PROJECT_SECRET: ${{ secrets.IPFS_PROJECT_SECRET }}
run: |
yarn run start &
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
repository: nevermined-io/sdk-dtp
path: sdk-dtp
Expand All @@ -68,7 +68,7 @@ jobs:
yarn
./scripts/wait-nevermined.sh
yarn test
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
repository: nevermined-io/sdk-js
path: sdk-js
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20
- name: Install dependencies
run: |
yarn
Expand Down
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,36 @@ All notable changes to this project will be documented in this file. Dates are d

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### [v3.0.0-rc3](https://github.com/nevermined-io/node/compare/v3.0.0-rc2...v3.0.0-rc3)

> 2 May 2024
- Automated CHANGELOG.md update [`0fd04cf`](https://github.com/nevermined-io/node/commit/0fd04cf2b0afc219aaacc1afcb241ab06365998a)
- fix: config loading [`bf72c80`](https://github.com/nevermined-io/node/commit/bf72c80e74cd99249363d336a6e5aae13c24d959)

#### [v3.0.0-rc2](https://github.com/nevermined-io/node/compare/v3.0.0-rc1...v3.0.0-rc2)

> 2 May 2024
- feat: bump versions [`918c78b`](https://github.com/nevermined-io/node/commit/918c78b7c3cfbf2173fc3bd7c4096a1f61f17a39)
- Automated CHANGELOG.md update [`61ea94f`](https://github.com/nevermined-io/node/commit/61ea94fbc1b5c31fecdb0f71a7e4a445793013eb)

#### [v3.0.0-rc1](https://github.com/nevermined-io/node/compare/v3.0.0-rc0...v3.0.0-rc1)

> 25 April 2024
- test: subscriptions it [`556bd51`](https://github.com/nevermined-io/node/commit/556bd5152eb53002caeb38177ea10d8c8f2bc825)
- chore: cleanup [`9cf2d6e`](https://github.com/nevermined-io/node/commit/9cf2d6efd1973391317de25b396fcf8c53cfe1d9)
- feat: update to latest sdk [`d287ddf`](https://github.com/nevermined-io/node/commit/d287ddf7614fcce2a696b8c0f1b8e1d91168b02d)

#### [v3.0.0-rc0](https://github.com/nevermined-io/node/compare/v2.4.9...v3.0.0-rc0)

> 11 April 2024
- feat: change to strict mode [`df4497d`](https://github.com/nevermined-io/node/commit/df4497d34b1a8dc74d511022171dfc0252e55a35)
- feat: initial changes new sdk [`1bb8616`](https://github.com/nevermined-io/node/commit/1bb86164717aba7a2c96670e5a951aa13cc94525)
- fix: sdk v3 adaptation [`07976f0`](https://github.com/nevermined-io/node/commit/07976f0c8680834ec448d2d0cd10d5e3574e74d4)

#### [v2.4.9](https://github.com/nevermined-io/node/compare/v2.4.8...v2.4.9)

> 8 April 2024
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:18-alpine
FROM node:20-alpine
LABEL maintainer="Nevermined <[email protected]>"

RUN apk add --no-cache autoconf automake alpine-sdk
Expand Down
4 changes: 2 additions & 2 deletions config/nevermined.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
const LogLevel = require('@nevermined-io/sdk').LogLevel
const ethers = require('ethers').ethers
const { NeverminedOptions } = require('@nevermined-io/sdk')
const fs = require('fs')
fs = require('fs')

const configBase = {
chainId: Number(process.env['NETWORK_ID']) || 1337,
web3ProviderUri: process.env['WEB3_PROVIDER_URL'] || 'http://contracts.nevermined.localnet',
marketplaceUri: process.env['MARKETPLACE_URI'] || 'http://marketplace.nevermined.localnet',
neverminedNodeUri: process.env['NODE_URI'] || 'http://localhost:8030',
Expand Down
18 changes: 16 additions & 2 deletions integration/config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
import { LoggerInstance, LogLevel, makeAccounts, NeverminedOptions } from '@nevermined-io/sdk'
import {
LoggerInstance,
LogLevel,
makeWallets,
NeverminedOptions,
NvmAccount,
} from '@nevermined-io/sdk'
import { Account } from 'viem'

LoggerInstance.setLevel(LogLevel.Error)

const logLevel = Number(process.env['LOG_LEVEL']) || 1 // warn by default

const configBase: NeverminedOptions = {
chainId: 1337,
web3ProviderUri: 'http://contracts.nevermined.localnet',
marketplaceUri: 'http://marketplace.nevermined.localnet',
neverminedNodeUri: process.env.NEVERMINED_NODE_URI || 'http://localhost:8030',
Expand All @@ -17,7 +25,13 @@ const configBase: NeverminedOptions = {
}

if (process.env.SEED_WORDS) {
configBase.accounts = makeAccounts(process.env.SEED_WORDS)
const wallets = makeWallets(process.env.SEED_WORDS)
configBase.accounts = wallets.map((wallet) => {
const a = NvmAccount.fromAccount(wallet)
const signer = a.getAccountSigner() as Account
LoggerInstance.debug(`Account loaded with address ${a.getAddress()} and type: ${signer.type}`)
return a
})
}

export const config: NeverminedOptions & { forceVerbose: NeverminedOptions } = configBase as any
Expand Down
91 changes: 89 additions & 2 deletions integration/resources/NFT1155SubscriptionUpgradeable.json

Large diffs are not rendered by default.

Loading

0 comments on commit 1f5774d

Please sign in to comment.