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

Issue in demo setup. #48

Open
35C4n0r opened this issue Apr 17, 2024 · 9 comments
Open

Issue in demo setup. #48

35C4n0r opened this issue Apr 17, 2024 · 9 comments

Comments

@35C4n0r
Copy link

35C4n0r commented Apr 17, 2024

I followed step 2 in the README.md
I would really appreciate if I can get some help here
@vatsa287 @amarts @adi-a11y

upon running the docker Command I get

$ docker run --network host dhiway/cord:develop --dev
2024-04-17 18:18:23 Dhiway CORD
2024-04-17 18:18:23 ✌️  version 0.9.2-34843b507bc
2024-04-17 18:18:23 ❤️  by Dhiway Networks <[email protected]>, 2019-2024
2024-04-17 18:18:23 📋 Chain specification: Cord Ignite
2024-04-17 18:18:23 🏷  Node name: wanting-knowledge-1575
2024-04-17 18:18:23 👤 Role: AUTHORITY
2024-04-17 18:18:23 💾 Database: RocksDb at /tmp/substrate8ZE49U/chains/dev/db/full
2024-04-17 18:18:35 🔨 Initializing Genesis block/state (state: 0x2409…8e4f, header-hash: 0x71a7…7b1f)
2024-04-17 18:18:35 👴 Loading GRANDPA authority set from genesis on what appears to be first startup.
2024-04-17 18:18:35 👶 Creating empty BABE epoch changes on what appears to be first startup.
2024-04-17 18:18:35 🏷  Local node identity is: 12D3KooWAU2yguQZbPujYo66vZu1fv5RbMG5vYQ9QppY9jA5pth4
2024-04-17 18:18:35 💻 Operating system: linux
2024-04-17 18:18:35 💻 CPU architecture: x86_64
2024-04-17 18:18:35 💻 Target environment: gnu
2024-04-17 18:18:35 💻 CPU: Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz
2024-04-17 18:18:35 💻 CPU cores: 2
2024-04-17 18:18:35 💻 Memory: 6939MB
2024-04-17 18:18:35 💻 Kernel: 5.15.146.1-microsoft-standard-WSL2
2024-04-17 18:18:35 💻 Linux distribution: Debian GNU/Linux 11 (bullseye)
2024-04-17 18:18:35 💻 Virtual machine: yes
2024-04-17 18:18:35 📦 Highest known block at #0
2024-04-17 18:18:35 Running JSON-RPC server: addr=127.0.0.1:9944, allowed origins=["*"]
2024-04-17 18:18:35 〽️ Prometheus exporter started at 127.0.0.1:9615
2024-04-17 18:18:35 🏁 CPU score: 584.19 MiBs
2024-04-17 18:18:35 🏁 Memory score: 7.35 GiBs
2024-04-17 18:18:35 🏁 Disk score (seq. writes): 328.60 MiBs
2024-04-17 18:18:35 🏁 Disk score (rand. writes): 133.69 MiBs
2024-04-17 18:18:35 ⚠️  The hardware does not meet the minimal requirements Failed checks: BLAKE2-256(expected: 783.27 MiBs, found: 584.19 MiBs), Copy(expected: 11.49 GiBs, found: 7.35 GiBs), Seq Write(expected
: 950.00 MiBs, found: 328.60 MiBs), Rnd Write(expected: 420.00 MiBs, found: 133.69 MiBs),  for role 'Authority'.
2024-04-17 18:18:35 👶 Starting BABE Authorship worker
2024-04-17 18:18:36 🙌 Starting consensus session on top of parent 0x71a782090e07d72ae70ebfa353c7e0bafc9ff49d67b9a20ea72e442e77707b1f
2024-04-17 18:18:36 🎁 Prepared block for proposing at 1 (2 ms) [hash: 0xa66a0f611957d9d9d5142e085bad61b3bd6537812f396e3bf7011bdd97ed58c3; parent_hash: 0x71a7…7b1f; extrinsics (1): [0x4760…75b3]
2024-04-17 18:18:36 🔖 Pre-sealed block for proposal at 1. Hash now 0x59391436815459d19133bb72a4726a54dbdcabf10b0d39d92c56daf83b6c8cc4, previously 0xa66a0f611957d9d9d5142e085bad61b3bd6537812f396e3bf7011bdd97ed5
8c3.
2024-04-17 18:18:36 👶 New epoch 0 launching at block 0x5939…8cc4 (block slot 571125972 >= start slot 571125972).
2024-04-17 18:18:36 👶 Next epoch starts at slot 571126012
2024-04-17 18:18:36 ✨ Imported #1 (0x5939…8cc4)
2024-04-17 18:18:39 🙌 Starting consensus session on top of parent 0x59391436815459d19133bb72a4726a54dbdcabf10b0d39d92c56daf83b6c8cc4
2024-04-17 18:18:39 🎁 Prepared block for proposing at 2 (1 ms) [hash: 0x8b70b0ec52ed333e6560840c9730964d198b544c1fc6629baeb966019c301b6d; parent_hash: 0x5939…8cc4; extrinsics (1): [0x3b60…0778]
2024-04-17 18:18:39 🔖 Pre-sealed block for proposal at 2. Hash now 0xa0203149654f60c842fe27a1e3b4a6e1370bb476d01852a0e31fdbf0f478d181, previously 0x8b70b0ec52ed333e6560840c9730964d198b544c1fc6629baeb966019c301
b6d.
2024-04-17 18:18:39 ✨ Imported #2 (0xa020…d181)
2024-04-17 18:18:40 💤 Idle (0 peers), best: #2 (0xa020…d181), finalized #0 (0x71a7…7b1f), ⬇ 0 ⬆ 0
2024-04-17 18:18:42 🙌 Starting consensus session on top of parent 0xa0203149654f60c842fe27a1e3b4a6e1370bb476d01852a0e31fdbf0f478d181
2024-04-17 18:18:42 🎁 Prepared block for proposing at 3 (1 ms) [hash: 0x50866134fc6fdc88dc5e35b508f49094fd1618ca8f32ba3b122a36079dd429a3; parent_hash: 0xa020…d181; extrinsics (1): [0x57ff…d663]
2024-04-17 18:18:42 🔖 Pre-sealed block for proposal at 3. Hash now 0xe0f7ae1aa0149b0ed8e41efe7a4906c4dc058722af405314faad234b1bbcba37, previously 0x50866134fc6fdc88dc5e35b508f49094fd1618ca8f32ba3b122a36079dd42
9a3.
2024-04-17 18:18:42 ✨ Imported #3 (0xe0f7…ba37)
2024-04-17 18:18:45 🙌 Starting consensus session on top of parent 0xe0f7ae1aa0149b0ed8e41efe7a4906c4dc058722af405314faad234b1bbcba37
2024-04-17 18:18:45 🎁 Prepared block for proposing at 4 (1 ms) [hash: 0x187088d92ddd7bdd19c69751bcc9aa9dd07cc26e7213177baf350207bb83b09d; parent_hash: 0xe0f7…ba37; extrinsics (1): [0xafdb…b2a6]
2024-04-17 18:18:45 🔖 Pre-sealed block for proposal at 4. Hash now 0x5b2a34978eb0011ee788e277fbc3c83a33817ce212c0ab62fff00a64c92bf19a, previously 0x187088d92ddd7bdd19c69751bcc9aa9dd07cc26e7213177baf350207bb83b
09d.



so on, so forth...

But the browser doesn't seem to connect, same issue while running the demo scripts
image

$ npx tsx src/func-test.ts
(node:23400) ExperimentalWarning: `--experimental-loader` may be removed in the future; instead use `register()`:
--import 'data:text/javascript,import { register } from "node:module"; import { pathToFileURL } from "node:url"; register("file%3A///D%3A/Jay/C4GT/DMP/CORD/cord-demo-scripts/node_modules/tsx/dist/loader.js", pa
thToFileURL("./"));'
(Use `node --trace-warnings ...` to show where the warning was created)
Applied changes: logLevel=Error to log groups 'all'.
2024-04-18 00:15:06          API-WS: disconnected from ws://127.0.0.1:9944: 1006:: Abnormal Closure
2024-04-18 00:15:08          API-WS: disconnected from ws://127.0.0.1:9944: 1006:: Abnormal Closure
2024-04-18 00:15:11          API-WS: disconnected from ws://127.0.0.1:9944: 1006:: Abnormal Closure
2024-04-18 00:15:13          API-WS: disconnected from ws://127.0.0.1:9944: 1006:: Abnormal Closure
2024-04-18 00:15:16          API-WS: disconnected from ws://127.0.0.1:9944: 1006:: Abnormal Closure

@35C4n0r
Copy link
Author

35C4n0r commented Apr 17, 2024

'ws://127.0.0.1:9944'

@adi-a11y the issue still seems to persists.

$ docker run --network host dhiway/cord:develop --dev
2024-04-17 18:44:10 Dhiway CORD
2024-04-17 18:44:10 ✌️  version 0.9.2-34843b507bc
2024-04-17 18:44:10 ❤️  by Dhiway Networks <[email protected]>, 2019-2024
2024-04-17 18:44:10 📋 Chain specification: Cord Ignite
2024-04-17 18:44:10 🏷  Node name: different-start-3894
2024-04-17 18:44:10 👤 Role: AUTHORITY
2024-04-17 18:44:10 💾 Database: RocksDb at /tmp/substrateCxvTlm/chains/dev/db/full
2024-04-17 18:44:20 🔨 Initializing Genesis block/state (state: 0x2409…8e4f, header-hash: 0x71a7…7b1f)
2024-04-17 18:44:20 👴 Loading GRANDPA authority set from genesis on what appears to be first startup.
2024-04-17 18:44:20 👶 Creating empty BABE epoch changes on what appears to be first startup.
2024-04-17 18:44:20 🏷  Local node identity is: 12D3KooWKLBDtTg97qgVSTcXUjfz1Si2j8Gx1KiobdxiEB6aw2bs
2024-04-17 18:44:20 💻 Operating system: linux
2024-04-17 18:44:20 💻 CPU architecture: x86_64
2024-04-17 18:44:20 💻 Target environment: gnu
2024-04-17 18:44:20 💻 CPU: Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz
2024-04-17 18:44:20 💻 CPU cores: 2
2024-04-17 18:44:20 💻 Memory: 6939MB
2024-04-17 18:44:20 💻 Kernel: 5.15.146.1-microsoft-standard-WSL2
2024-04-17 18:44:20 💻 Linux distribution: Debian GNU/Linux 11 (bullseye)
2024-04-17 18:44:20 💻 Virtual machine: yes
2024-04-17 18:44:20 📦 Highest known block at #0
2024-04-17 18:44:20 Running JSON-RPC server: addr=127.0.0.1:9944, allowed origins=["*"]
2024-04-17 18:44:20 〽️ Prometheus exporter started at 127.0.0.1:9615
2024-04-17 18:44:20 🏁 CPU score: 732.46 MiBs
2024-04-17 18:44:20 🏁 Memory score: 8.45 GiBs
2024-04-17 18:44:20 🏁 Disk score (seq. writes): 208.38 MiBs
2024-04-17 18:44:20 🏁 Disk score (rand. writes): 132.60 MiBs
2024-04-17 18:44:20 ⚠️  The hardware does not meet the minimal requirements Failed checks: BLAKE2-256(expected: 783.27 MiBs, found: 732.46 MiBs), Copy(expected: 11.49 GiBs, found: 8.45 GiBs), Seq Write(expected
: 950.00 MiBs, found: 208.38 MiBs), Rnd Write(expected: 420.00 MiBs, found: 132.60 MiBs),  for role 'Authority'.
2024-04-17 18:44:20 👶 Starting BABE Authorship worker
2024-04-17 18:44:21 🙌 Starting consensus session on top of parent 0x71a782090e07d72ae70ebfa353c7e0bafc9ff49d67b9a20ea72e442e77707b1f
2024-04-17 18:44:21 🎁 Prepared block for proposing at 1 (1 ms) [hash: 0x20eb2cb53987280dcb9611cf27d9a33fde15278be706f7a5d296315919f45ff3; parent_hash: 0x71a7…7b1f; extrinsics (1): [0x7d0a…538c]
2024-04-17 18:44:21 🔖 Pre-sealed block for proposal at 1. Hash now 0xeaff61b7c1034bc6384cb60141e94e7bd42a972f7771753daeb081a044bb912d, previously 0x20eb2cb53987280dcb9611cf27d9a33fde15278be706f7a5d296315919f45
ff3.
2024-04-17 18:44:21 👶 New epoch 0 launching at block 0xeaff…912d (block slot 571126487 >= start slot 571126487).
2024-04-17 18:44:21 👶 Next epoch starts at slot 571126527
2024-04-17 18:44:21 ✨ Imported #1 (0xeaff…912d)
2024-04-17 18:44:24 🙌 Starting consensus session on top of parent 0xeaff61b7c1034bc6384cb60141e94e7bd42a972f7771753daeb081a044bb912d
2024-04-17 18:44:24 🎁 Prepared block for proposing at 2 (1 ms) [hash: 0x1a37f0b0f0a6220ea1f037df78faf45a6ea15e162e85bf66eee291285ca5f914; parent_hash: 0xeaff…912d; extrinsics (1): [0xddf4…8b9a]
2024-04-17 18:44:24 🔖 Pre-sealed block for proposal at 2. Hash now 0x75f63f06c5b257ce899789734ef4477715f7ac9949b5c2aaa35a213ecb285750, previously 0x1a37f0b0f0a6220ea1f037df78faf45a6ea15e162e85bf66eee291285ca5f
914.
2024-04-17 18:44:24 ✨ Imported #2 (0x75f6…5750)
2024-04-17 18:44:25 💤 Idle (0 peers), best: #2 (0x75f6…5750), finalized #0 (0x71a7…7b1f), ⬇ 0 ⬆ 0
2024-04-17 18:44:27 🙌 Starting consensus session on top of parent 0x75f63f06c5b257ce899789734ef4477715f7ac9949b5c2aaa35a213ecb285750
2024-04-17 18:44:27 🎁 Prepared block for proposing at 3 (1 ms) [hash: 0x8340b547b331b388b55b96efaa4b4722d125fcdde47331632fd5ad114f32401b; parent_hash: 0x75f6…5750; extrinsics (1): [0x4524…6ad4]
2024-04-17 18:44:27 🔖 Pre-sealed block for proposal at 3. Hash now 0x3de8ae69a2dc02f4c1ee1d294355667198255a4758ffafe47df0caaab9f34832, previously 0x8340b547b331b388b55b96efaa4b4722d125fcdde47331632fd5ad114f324
01b.

$ npx tsx src/func-test.ts
(node:23400) ExperimentalWarning: `--experimental-loader` may be removed in the future; instead use `register()`:
--import 'data:text/javascript,import { register } from "node:module"; import { pathToFileURL } from "node:url"; register("file%3A///D%3A/Jay/C4GT/DMP/CORD/cord-demo-scripts/node_modules/tsx/dist/loader.js", pa
thToFileURL("./"));'
(Use `node --trace-warnings ...` to show where the warning was created)
Applied changes: logLevel=Error to log groups 'all'.
2024-04-18 00:15:06          API-WS: disconnected from ws://127.0.0.1:9944: 1006:: Abnormal Closure
2024-04-18 00:15:08          API-WS: disconnected from ws://127.0.0.1:9944: 1006:: Abnormal Closure
2024-04-18 00:15:11          API-WS: disconnected from ws://127.0.0.1:9944: 1006:: Abnormal Closure

image

@35C4n0r
Copy link
Author

35C4n0r commented Apr 17, 2024

I tried Step 3 too, with staging network in the browser

image

@vatsa287
Copy link
Member

@35C4n0r Will have to check with the documentation for docker images again.
Is CORD running at port 9944? If not please refer to CORD repo docs for starting a CORD network.
For now run CORD in bare metal mode, then run the scripts.

@35C4n0r
Copy link
Author

35C4n0r commented Apr 18, 2024

@vatsav https://github.com/dhiway/cord?tab=readme-ov-file#using-docker this works.
Ig in this command the issue is that we are not mapping the docker to our local ports https://github.com/dhiway/cord-demo-scripts?tab=readme-ov-file#how-to-run-the-demo-code-with-local-node

@35C4n0r
Copy link
Author

35C4n0r commented Apr 18, 2024

but ig there are a few errors in func-test
I'll try debugging it and make a PR if required

$ npx tsx src/func-test.ts
(node:8784) ExperimentalWarning: `--experimental-loader` may be removed in the future; instead use `register()`:
--import 'data:text/javascript,import { register } from "node:module"; import { pathToFileURL } from "node:url"; register("file%3A///D%3A/Jay/C4GT/DMP/CORD/cord-demo-scripts/node_modules/tsx/dist/loader.js", pa
thToFileURL("./"));'
(Use `node --trace-warnings ...` to show where the warning was created)
Applied changes: logLevel=Error to log groups 'all'.
Applied changes: logLevel=Error to log groups 'all'.

❄️  New Network Member
🏦  Member (ed25519): 3vdCDybikN5W8BntHESfCxjnwQwuqnaWbPeTSyWwc3eAgD2q
✅ Network Authority created!
🏦  Member (ed25519): 3u1tj4axZUhMCqztnMnEtPJR9b5VaCCdQdnV27i1uAvBeHjd
🔏  Member permissions updated
🔏  Member identity info updated
🔏  Member identity judgement requested
d:\Jay\C4GT\DMP\CORD\cord-demo-scripts\src\utils\createRegistrar.ts:91
  const identityHash = identityInfos.unwrap().info.hash.toHex()
                                              ^


TypeError: Cannot read properties of undefined (reading 'hash')
    at provideJudgement (d:\Jay\C4GT\DMP\CORD\cord-demo-scripts\src\utils\createRegistrar.ts:91:47)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at main (d:\Jay\C4GT\DMP\CORD\cord-demo-scripts\src\func-test.ts:57:3)

Node.js v20.11.0

@vatsa287
Copy link
Member

@35C4n0r There is a PR which is open with newly updated scripts. Which will be merged soon. Then you can try it with a rebase.

@amarts ^^

@vatsa287
Copy link
Member

@35C4n0r Please try now. Demo scripts are now updated.
yarn demo-statement, yarn demo-asset, yarn demo-score.

@35C4n0r
Copy link
Author

35C4n0r commented Apr 22, 2024

Thanks @vatsa287, I was just preparing the proposal the demo-scripts will help me out a lot.
Just one last thing, do I need strong knowledge of blockchain to even attempt the Python SDK Projects?

@vatsa287
Copy link
Member

vatsa287 commented Apr 23, 2024

Thanks @vatsa287, I was just preparing the proposal the demo-scripts will help me out a lot. Just one last thing, do I need strong knowledge of blockchain to even attempt the Python SDK Projects?

@35C4n0r
Yes knowledge of blockchain would be required, because when building SDK you would be interacting with the chain itself.

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

No branches or pull requests

2 participants