scio-labs / inkathon Goto Github PK
View Code? Open in Web Editor NEWFull-Stack DApp Boilerplate for Substrate and ink! Smart Contracts
Home Page: https://inkathon.xyz/
License: GNU General Public License v3.0
Full-Stack DApp Boilerplate for Substrate and ink! Smart Contracts
Home Page: https://inkathon.xyz/
License: GNU General Public License v3.0
I have a method get_my_item
in contract which takes argument AccountId
. How do I add arguments while using ContractQuery
const result = await contractQuery(api, '', contract, 'get_my_item')
Is done in https://github.com/scio-labs/inkathon/tree/ink-v4. See changes: scio-labs:main...ink-v4.
https://github.com/scio-labs/inkathon?tab=readme-ov-file#2-build--deploy-contracts-on-a-local-node
script to automate installation of all the pre-requisites
I was getting errors when trying to run the cargo install step 3 in the readme, needed to go to substrates installation docs and install everything there before I could run step 3's cargo install
As of now the deployment.ts
format is very basic
export const address = '5Ga8H7rtX66J3fn754cnTX1ZfCxZxwxzaZuqy5mfTRAfifQi'
export const blockNumber = 1
But this is not very future proof as this does not allow for the following things:
A new format will have trade offs but I think solving the mentioned issues with this format will proof itself handy for longer lasting production dapps. Upgrades of contracts happen, same as multiple deployments of the same contract on a single chain.
We could get some inspiration from this plugin from hardhat or whatever foundry is doing right now. π€
Setting up a working rust & cargo contract environment for compiling ink! can be painful and can be error-prone. Providing easy documentation & shorthand scripts on how to do this within a docker container would be beneficial.
.env.local
upon installts-node
script execution shorthand in contracts/package.json
husky
to simple-git-hooks
contracts/src
directorySee #12 (comment)
on adding openbrush latest version which is suitable for latest ink 4.0.0 release doesn't work on inkathon greeter contract
build with pnpm build
and throws below error but on running with +nightly works fine. I have checked on freshly created ink project no issue there.
openbrush = { tag = "3.0.0", git = "https://github.com/727-Ventures/openbrush-contracts", default-features = false, features = [
"psp22",
] }
Currently, the rpc selection is too simple. It just picks the first item in the rpcUrls
array of PolkadotProviderChain
(see https://github.com/scio-labs/inkathon/blob/main/packages/frontend/src/components/web3/PolkadotProvider.tsx#L64) and creates an creates an WsProvider
object (which fails if the provided url is not a websocket).
scio-labs/use-inkathon
contracts
directory in build & test scriptsHi,
I've got the following error in my craco app.
attempted import error: 'webcrypto' is not exported from 'crypto' (imported as 'nc').
ERROR in ./node_modules/useink/dist/chunk-CFOEQQMR.mjs 16721:66-78
export 'webcrypto' (imported as 'nc') was not found in 'crypto' (possible exports: Cipher, Cipheriv, Decipher, Decipheriv, DiffieHellman, DiffieHellmanGroup, Hash, Hmac, Sign, Verify, constants, createCipher, createCipheriv, createCredentials, createDecipher, createDecipheriv, createDiffieHellman, createDiffieHellmanGroup, createECDH, createHash, createHmac, createSign, createVerify, getCiphers, getDiffieHellman, getHashes, listCiphers, pbkdf2, pbkdf2Sync, privateDecrypt, privateEncrypt, prng, pseudoRandomBytes, publicDecrypt, publicEncrypt, randomBytes, randomFill, randomFillSync, rng)
My tsconfig.json
"module": "ESNext",
"moduleResolution": "Node",
I know that moduleResolution
should be "nodenext"
according to by your documentation. (For importing useink/chains
But this change breaks many imports of my app. So I can't configure like it is.
Is there any alternative way?
Thanks,
Add deployment addresses for testnets included in scio-labs/use-inkathon#36.
For more context:
scio-labs/use-inkathon#36 (comment)
Live testnet to be deployed:
Create a CLI tool that creates a full ready-to-use ink!athon monorepo app structure. With a command like npm create create-inkathon-app
.
Potential options:
See https://github.com/facebook/create-react-app & https://github.com/t3-oss/create-t3-app for inspiration.
When I follow the readme step configuration, the deploy script command don't exist ( and no reference in package.json )
# Deploy the contracts on the local node
pnpm run deploy
[frontend-prod builder 1/1] RUN NEXT_BUILD_STANDALONE=true pnpm --filter='*frontend' build && pnpm --filter='*frontend' deploy pruned --prod:
8.166
8.166 > @inkathon/[email protected] build /app/frontend
8.166 > NODE_ENV=production next build
8.166
9.318 Attention: Next.js now collects completely anonymous telemetry regarding usage.
9.318 This information is used to shape Next.js' roadmap and prioritize features.
9.318 You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
9.318 https://nextjs.org/telemetry
9.318
9.865 β² Next.js 14.2.3
9.865 - Environments: .env.local
9.865
10.28 Creating an optimized production build ...
11.90
11.90 (process:37): VIPS-WARNING **: 20:02:53.317: threads clipped to 1024
23.87 Failed to compile.
23.87
23.87 ./src/app/page.tsx
23.87 Module not found: Can't resolve '@/app/components/home-page-title'
23.87
23.87 https://nextjs.org/docs/messages/module-not-found
23.87
23.87 ./src/app/page.tsx
23.87 Module not found: Can't resolve '@/components/web3/chain-info'
23.87
23.87 https://nextjs.org/docs/messages/module-not-found
23.87
23.87 ./src/app/page.tsx
23.87 Module not found: Can't resolve '@/components/web3/connect-button'
23.87
23.87 https://nextjs.org/docs/messages/module-not-found
23.87
23.87 ./src/app/page.tsx
23.87 Module not found: Can't resolve '@/components/web3/greeter-contract-interactions'
23.87
23.87 https://nextjs.org/docs/messages/module-not-found
23.87
23.87 ./src/app/providers.tsx
23.87 Module not found: Can't resolve '@/deployments/deployments'
23.87
23.87 https://nextjs.org/docs/messages/module-not-found
23.87
23.89
23.89 > Build failed because of webpack errors
23.90 /app/frontend:
23.90 βERR_PNPM_RECURSIVE_RUN_FIRST_FAILβ @inkathon/[email protected] build:NODE_ENV=production next build
23.90 Exit status 1
failed to solve: process "/bin/sh -c NEXT_BUILD_STANDALONE=true pnpm --filter='*frontend' build && pnpm --filter='*frontend' deploy pruned --prod" did not complete successfully: exit code: 1`
OS: Windows 11 with Ubuntu 20.04
Docker Desktop version Current version: 4.28.0 (139021)
Could you add Swanky support to the ink!athon repository?
https://use.ink/getting-started/swanky/
In my experience the versions of polkadot.js dependencies are not compatible which makes the current ink!athon front-end hard to use.
Running docker compose command to build the production app
docker-compose -f ./docker-compose.frontend.yaml up
will show an error such as below:
=> ERROR [frontend-prod builder 1/1] RUN NEXT_BUILD_STANDALONE=true pnpm --filter='*frontend' build && pnpm --filter='*frontend' deploy pruned --prod 48.0s
------
> [frontend-prod builder 1/1] RUN NEXT_BUILD_STANDALONE=true pnpm --filter='*frontend' build && pnpm --filter='*frontend' deploy pruned --prod:
0.550
0.550 > @inkathon/[email protected] build /app/frontend
0.550 > NODE_ENV=production next build
0.550
1.388 Attention: Next.js now collects completely anonymous telemetry regarding usage.
1.388 This information is used to shape Next.js' roadmap and prioritize features.
1.388 You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
1.388 https://nextjs.org/telemetry
1.388
1.446 β² Next.js 14.2.3
1.446 - Environments: .env.local
1.446
1.509 Creating an optimized production build ...
29.38 β Compiled successfully
29.38 Linting and checking validity of types ...
34.60 Collecting page data ...
35.44 Generating static pages (0/5) ...
35.91 Generating static pages (1/5)
35.91 Generating static pages (2/5)
35.91 Generating static pages (3/5)
35.92 β Generating static pages (5/5)
36.32 Finalizing page optimization ...
36.32 Collecting build traces ...
45.36
45.37 Route (app) Size First Load JS
45.37 β β / 59.3 kB 562 kB
45.37 β β /_not-found 872 B 88.2 kB
45.37 + First Load JS shared by all 87.3 kB
45.37 β chunks/350-517ce4390b75eaef.js 31.5 kB
45.37 β chunks/8a6c70d3-b137850d6336eb59.js 53.6 kB
45.37 β other shared chunks (total) 2.19 kB
45.37
45.37
45.37 β (Static) prerendered as static content
45.37
45.76 βERR_PNPM_DEPLOY_DIR_NOT_EMPTYβ Deploy path /app/pruned is not empty
------
failed to solve: process "/bin/sh -c NEXT_BUILD_STANDALONE=true pnpm --filter='*frontend' build && pnpm --filter='*frontend' deploy pruned --prod" did not complete successfully: exit code: 1
Since the path /app/pruned
is not empty, we need to force remove it to avoid failure on subsequent runs (see pnpm/pnpm#7561).
shadcn/ui
components (via CLI)twin-merge
, cva
, and the cn
helpertwin.macro
& chakra-ui
dependenciesMigrate the current pages directory to the Next.js 13 app directory/router (https://nextjs.org/docs/app).
https://github.com/scio-labs/inkathon/blob/main/packages/frontend/src/deployments/chains.ts
Consider outsourcing this definitions file into its own "chainlist-like" repository. The SS58-Registry unfortunately does not contain test-networks and does not contain rpc-urls.
The command line deploy arguments of cargo contract should be used to create "hardhat-deploy-like" shorthand scripts to:
.env
file{chain}.json
file that the frontend can importA declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.