PermaLink is a lite tool provided to developers. For developers who want to build fully DApps, it provides users with the unique entry to access their web3 DApp.
Usually, front-end interface can be easily upgraded a new version in the web2 world - just deploy the new version on the server to replace the old one. For the fully DApp built in arweave, if the front-end interface is upgraded, it will regain a new url. For the user, it means that a new link must be obtained again, rather than a permanent domain name - like a web2 web page.
PermaLink uses smart contract (warp contract) technology to provide users with a unique link to DApp. When developers update the version, users can access the new version in time. At the same time, PermaLink also provides users with historical version information, so that users can view and access any version of the application at any time, truly achieving "complete decentralization". See this demo.
Ofcourse, first of all, clone this repository to local.
Copy your wallet key file to directory contract/deploy
and rename filename with key-file.json
. And then run the following command:
cd contract/deploy
ts-node deploy-contract.ts
If it shows ContractTxId
on your console, that means contract has deployed successfully. And meanwhile, contract transaction ID will write to file contract-txid.json
.
After one minute or two, you may found your contract deployed to arweave in sonAR website.
Open file src/Defines.js
and set custom variables:
export const appLogo = <svg> your DApp logo </svg>
export const appName = "your DApp name";
export const adminWalletAddress = "administration wallet address"
export const contractTxId = "contract ID generated by previous step"
export const autoPilot = "whether use auto-pilot mode - auto navigate to the newest version";
Run the following commands:
npm install
npm run build
arkb deploy ./build --wallet path/to/your_wallet_keyfile.json
Wait your files mined by arweave blockchain, and expectly you will see homepage when open https://arweave.net/foobar
like link.
When it is the first time you open the link above, you will get prompt No commits found
.
And you need to click admin
link to access manage page.
Login(ps. you need to use the wallet same in src/Defines.js
adminWalletAddress
) and fill url
, description
, version
and click 'submit'.
All done.👏
E-mail: marslab.2022@gmail.com
Twitter: @mARsLab_2022