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

Integrated with KCs #194

Open
wants to merge 91 commits into
base: v8/integrate-w-gamma-contracts
Choose a base branch
from
Open
Changes from 19 commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
1ec72d4
Integrated with KCs
u-hubar Dec 13, 2024
65098c6
done
Mihajlo-Pavlovic Dec 13, 2024
7aa9020
fix 1
Mihajlo-Pavlovic Dec 13, 2024
d38c5f2
rename 1
Mihajlo-Pavlovic Dec 13, 2024
7312cc1
Add tokens count
Mihajlo-Pavlovic Dec 13, 2024
c361289
Add last fixes
Mihajlo-Pavlovic Dec 13, 2024
018caf4
fixes
Mihajlo-Pavlovic Dec 13, 2024
a818c10
Bumped package version
u-hubar Dec 13, 2024
af89ee2
Fixes for blockchain
Mihajlo-Pavlovic Dec 13, 2024
ce386dd
simplify code
Mihajlo-Pavlovic Dec 14, 2024
236dab6
improve
Mihajlo-Pavlovic Dec 14, 2024
ec61366
remove redundancy
Mihajlo-Pavlovic Dec 14, 2024
1805307
fix
Mihajlo-Pavlovic Dec 14, 2024
457fd9d
Merge branch 'v8/kcs-integration' into v8/public-private-pairing-rework
Mihajlo-Pavlovic Dec 16, 2024
8a1fc08
Merge pull request #195 from OriginTrail/v8/public-private-pairing-re…
Mihajlo-Pavlovic Dec 16, 2024
b1f031b
Get improvment
Mihajlo-Pavlovic Dec 16, 2024
a13370f
try fix esm/cjs compat
aleksaelezovic Dec 16, 2024
775490f
depend on correct (new) assertion-tools version
aleksaelezovic Dec 16, 2024
a370fd3
Merge branch 'v8/kcs-integration' into v8/fix-esm-compat
u-hubar Dec 16, 2024
7cacc3d
Merge pull request #198 from aleksaelezovic/v8/fix-esm-compat
u-hubar Dec 16, 2024
0bb85dd
Merged
u-hubar Dec 16, 2024
90f484c
fix webpack issues
aleksaelezovic Dec 17, 2024
42527cd
new build
aleksaelezovic Dec 17, 2024
23be6cc
Merge pull request #199 from aleksaelezovic/v8/fix-esm-compat
u-hubar Dec 17, 2024
f7fc11a
Updated package
u-hubar Dec 17, 2024
0e75363
Adding api version
ilijaMar Dec 17, 2024
f87a70b
Changed default from v0 to v1
ilijaMar Dec 17, 2024
256a583
Asset create calls graph create
ilijaMar Dec 17, 2024
618b94a
Updated graph create to newer version
ilijaMar Dec 17, 2024
43be461
Private representation added with public sujbect if pair exsits
Mihajlo-Pavlovic Dec 17, 2024
9b8fc7f
remove token count
Mihajlo-Pavlovic Dec 17, 2024
2a3ac69
Swaped graph and asset
ilijaMar Dec 18, 2024
a312781
Repositories support
brkagithub Dec 18, 2024
966b5f9
Fixes and enable bid suggestion
Mihajlo-Pavlovic Dec 18, 2024
5d9bcbf
Merge pull request #201 from OriginTrail/remove-private-representatio…
Mihajlo-Pavlovic Dec 18, 2024
2699c3a
Merge pull request #202 from OriginTrail/v8/repositories-support
Mihajlo-Pavlovic Dec 18, 2024
e8b92b2
Changed max file size
ilijaMar Dec 18, 2024
a450f17
Merge branch 'v8/kcs-integration' into v8/addintApiVersion
Mihajlo-Pavlovic Dec 18, 2024
d57a0a6
Merge pull request #200 from OriginTrail/v8/addintApiVersion
Mihajlo-Pavlovic Dec 18, 2024
f7d9934
Integration + remove paranet UAL from create + remove update
brkagithub Dec 18, 2024
7b688d0
Merge remote-tracking branch 'origin/v8/kcs-integration' into v8/inte…
brkagithub Dec 18, 2024
08b4345
Merge branch 'v8/kcs-integration' into v8/integrate-w-new-contracts
brkagithub Dec 18, 2024
1a816ec
Merge pull request #203 from OriginTrail/v8/integrate-w-new-contracts
brkagithub Dec 18, 2024
cb85d31
remove extra create
brkagithub Dec 18, 2024
8bb83cd
Add missing imports
brkagithub Dec 18, 2024
a470054
Release sigma dkg.js
brkagithub Dec 18, 2024
a8d05ad
Add new hubs and update version
brkagithub Dec 19, 2024
5257fa3
fix ask, add new hub for testnet
brkagithub Dec 19, 2024
1562d2f
Release new version
brkagithub Dec 20, 2024
004a012
Push dkg min js
brkagithub Dec 20, 2024
58644fe
Bump version
brkagithub Dec 20, 2024
524987f
Ayo sigma boy
u-hubar Dec 20, 2024
467e382
Add hubs to constants
Mihajlo-Pavlovic Dec 20, 2024
d3b4f28
version bump
Mihajlo-Pavlovic Dec 20, 2024
3837456
Merge pull request #205 from OriginTrail/add-testnet-hubs
Mihajlo-Pavlovic Dec 20, 2024
c5359e9
Implement correct publishing cost formula
Mihajlo-Pavlovic Dec 20, 2024
49f7d8c
Version bump
Mihajlo-Pavlovic Dec 20, 2024
451c729
Add new hubs
brkagithub Dec 23, 2024
f617d1a
Dont send chunk size, send immutable
brkagithub Dec 23, 2024
f4dfc16
Update hubs again
brkagithub Dec 23, 2024
c01ef75
Merge pull request #206 from OriginTrail/improvement/add-other-testne…
brkagithub Dec 23, 2024
5613ec9
Fixes for RC
Mihajlo-Pavlovic Dec 24, 2024
0241af8
Update newest hubs
brkagithub Dec 24, 2024
b951c8f
Bump version
brkagithub Dec 24, 2024
a239d72
Merge branch 'v8/kcs-integration' into improvement/add-other-testnet-…
Mihajlo-Pavlovic Dec 24, 2024
1387f37
Merge pull request #207 from OriginTrail/improvement/add-other-testne…
Mihajlo-Pavlovic Dec 24, 2024
a05e7ed
Bump version and hubs
brkagithub Dec 25, 2024
abd1008
sigma boy
brkagithub Dec 25, 2024
df7e392
remove console log
brkagithub Dec 25, 2024
fe99ddd
fix bid
Mihajlo-Pavlovic Dec 25, 2024
8a4f834
Fixes
Mihajlo-Pavlovic Dec 25, 2024
8596691
Fix get
Mihajlo-Pavlovic Dec 25, 2024
eb8d18a
Merge pull request #208 from OriginTrail/improvement/add-other-testne…
brkagithub Dec 26, 2024
31fc380
8.0.0
brkagithub Dec 26, 2024
7959e7a
min js
brkagithub Dec 26, 2024
9a66f9f
Change oracle for gnosis
brkagithub Dec 26, 2024
f498b20
dd try catch to gnosis gas oracle
brkagithub Dec 26, 2024
a701d09
PR feedback
brkagithub Dec 26, 2024
198a731
Run build
Mihajlo-Pavlovic Dec 26, 2024
a1e019d
Merge pull request #210 from OriginTrail/fix/gnosis-gas-price
Mihajlo-Pavlovic Dec 26, 2024
b71d768
version bump
Mihajlo-Pavlovic Dec 26, 2024
5d94b7c
correct version for npm
Mihajlo-Pavlovic Dec 26, 2024
00a8886
Change defaults for other blockchains, fix defaulting
brkagithub Dec 26, 2024
d9bca33
merge
brkagithub Dec 26, 2024
8611005
Merge remote-tracking branch 'origin/v8/kcs-integration' into fix/gno…
brkagithub Dec 26, 2024
ac801ae
Bump verison, build again, fix typos
brkagithub Dec 26, 2024
4be5dea
Merge pull request #211 from OriginTrail/fix/gnosis-gas-price
u-hubar Dec 26, 2024
e168965
Implement get/increase allowance for new contracts
brkagithub Dec 27, 2024
ad287e2
Merge pull request #212 from OriginTrail/v8/allowance-backwards-compa…
brkagithub Dec 27, 2024
2ddb486
Add validation for signatures
Mihajlo-Pavlovic Dec 27, 2024
53a2289
add signature validaton code
Mihajlo-Pavlovic Dec 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
165 changes: 165 additions & 0 deletions examples/demo.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
const jsonld = require('jsonld');
const DKG = require('../index.cjs');

const ENVIRONMENT = 'development';
const OT_NODE_HOSTNAME = 'http://localhost';
const OT_NODE_PORT = '8900';
const PUBLIC_KEY = '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266';
const PRIVATE_KEY = '0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80';

const DkgClient = new DKG({
environment: ENVIRONMENT,
endpoint: OT_NODE_HOSTNAME,
port: OT_NODE_PORT,
blockchain: {
name: 'hardhat2',
publicKey: PUBLIC_KEY,
privateKey: PRIVATE_KEY,
},
maxNumberOfRetries: 30,
frequency: 2,
contentType: 'all',
nodeApiVersion: '/v1',
});

function divider() {
console.log('==================================================');
console.log('==================================================');
console.log('==================================================');
}

(async () => {
// const content = {
// public: `<uuid:1> <http://schema.org/city> <uuid:nis> .
// <uuid:3> <http://schema.org/company> "TL" .`,
// private: `<uuid:2> <http://schema.org/city> <uuid:belgrade> .
// <uuid:2> <http://schema.org/company> "OT" .
// <uuid:2> <http://schema.org/user> <uuid:user:1> .
// <uuid:3> <http://schema.org/user> <uuid:user:1> .

// `,
// };
const content = {
public: {
'@context': ['https://schema.org'],
'@id': 'uuid:1',
company: 'OT',
user: {
'@id': 'uuid:user:1',
},
city: {
'@id': 'uuid:belgrade',
},
},
private: {
'@context': ['https://schema.org'],
'@graph': [
{
'@id': 'uuid:user:1',
name: 'Adam',
lastname: 'Smith',
},
{
'@id': 'uuid:belgrade',
title: 'Belgrade',
postCode: '11000',
},
{
problem: 'empty',
},
{
solution: 'generate',
},
],
},
};

// divider();

const nodeInfo = await DkgClient.node.info();
console.log('======================== NODE INFO RECEIVED');
console.log(nodeInfo);

// divider();

// console.time('Publish (1 replication, 3 finalizations)')
// const result0 = await DkgClient.asset.create(content, {
// epochsNum: 2,
// tokenAmount: '100',
// minimumNumberOfFinalizationConfirmations: 3,
// minimumNumberOfNodeReplications: 1,
// });
// console.timeEnd('Publish (1 replication, 3 finalizations)')

// console.log(JSON.stringify(result0));

// divider();

// console.time('Publish (1 replication, 1 finalization)')
// const result1 = await DkgClient.asset.create(content, {
// epochsNum: 2,
// tokenAmount: '100',
// minimumNumberOfFinalizationConfirmations: 1,
// minimumNumberOfNodeReplications: 1,
// });
// console.timeEnd('Publish (1 replication, 1 finalization)')

// console.log(JSON.stringify(result1));

divider();

console.time('Publish (3 replications, 3 finalizations)');
const result2 = await DkgClient.asset.create(content, {
epochsNum: 2,
tokenAmount: '100000000000',
minimumNumberOfFinalizationConfirmations: 3,
minimumNumberOfNodeReplications: 3,
});
console.timeEnd('Publish (3 replications, 3 finalizations)');

console.log(result2);

// divider();

// console.time('Publish (5 replications, 5 finalizations)')
// const result3 = await DkgClient.asset.create(content, {
// epochsNum: 2,
// tokenAmount: '100',
// minimumNumberOfFinalizationConfirmations: 5,
// minimumNumberOfNodeReplications: 5,
// });
// console.timeEnd('Publish (5 replications, 5 finalizations)')

// console.log(JSON.stringify(result3));

// divider();

// const createCollectionResult = await DkgClient.graph.create(content, {
// epochsNum: 2,
// tokenAmount: '100',
// minimumNumberOfFinalizationConfirmations: 1,
// });
// console.log('======================== ASSET CREATED');
// console.log(createCollectionResult);

// divider();

// const publishFinalityResult = await DkgClient.graph.publishFinality(createAssetResult.UAL);
// console.log('======================== ASSET FINALITY');
// console.log(publishFinalityResult);

// const getOperationResult = await DkgClient.graph.get(createCollectionResult.UAL);
// console.log('======================== ASSET GET');
// console.log(getOperationResult);

// divider();

// const queryOperationResult = await DkgClient.graph.query(
// `select ?s ?p ?o where { ?s ?p ?o }`,
// 'SELECT',
// );
// console.log('======================== ASSET QUERY');
// console.log(queryOperationResult);

// divider();
})();
6 changes: 3 additions & 3 deletions examples/demo.js
Original file line number Diff line number Diff line change
@@ -76,9 +76,9 @@ function divider() {

// divider();

const nodeInfo = await DkgClient.node.info();
console.log('======================== NODE INFO RECEIVED');
console.log(nodeInfo);
// const nodeInfo = await DkgClient.node.info();
// console.log('======================== NODE INFO RECEIVED');
// console.log(nodeInfo);

// divider();

Loading